Mercurial > hg > nnchat
annotate Makefile.gen @ 490:9141f13be70c dev-1_0_3
Don't set conn->err if we are handling EINTR and it isn't supposed to get to
higher level. Fixes NNChat quitting unexpectedly when resizing a terminal
window causes EINTR for select() in the network polling.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 27 May 2012 09:23:12 +0300 |
parents | 796508f828f6 |
children | 52c56ada3816 |
rev | line source |
---|---|
263 | 1 CFLAGS += -g -W -Wall -Wextra -DTH_NO_DEFAULTS |
2 CFLAGS += -O2 | |
3 #CFLAGS += -std=c99 -pedantic | |
383
6d3ce7f28b65
Use a Makefile setting for th-libs location.
Matti Hamalainen <ccr@tnsp.org>
parents:
381
diff
changeset
|
4 THLIBS=th-libs/ |
0 | 5 |
6 # | |
213 | 7 # Version strings |
8 # | |
9 NN_VERSION := $(shell cat VERSION) | |
10 comma:= , | |
11 NN_VERSION_COM := $(subst .,$(comma),$(NN_VERSION)) | |
465
c3b3b6d89084
Simplify buildsystem a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
413
diff
changeset
|
12 CFLAGS += -DNN_VERSION=\"$(NN_VERSION)\" |
213 | 13 |
14 # | |
0 | 15 # Objects |
16 # | |
384 | 17 THLIBS_A=$(OBJPATH)thlibs.a |
18 THLIBS_OBJ=th_util.o th_string.o th_args.o th_config.o | |
465
c3b3b6d89084
Simplify buildsystem a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
413
diff
changeset
|
19 |
466
796508f828f6
Refactor much of the "windowing" UI code into a new module, ui.[ch]
Matti Hamalainen <ccr@tnsp.org>
parents:
465
diff
changeset
|
20 NNCHAT_OBJ=main.o util.o network.o ui.o |
0 | 21 NNCHAT_BIN=$(BINPATH)nnchat$(EXEEXT) |
22 | |
384 | 23 TARGETS+=$(THLIBS_A) $(NNCHAT_BIN) |
0 | 24 |
25 | |
26 # | |
27 # Target rules | |
28 # | |
176
f265e7274a45
Add a 'NONBUILD' target list for non-builded targets, use it for win32 subdir creation.
Matti Hamalainen <ccr@tnsp.org>
parents:
159
diff
changeset
|
29 all: $(NONBUILD) $(TARGETS) |
0 | 30 |
383
6d3ce7f28b65
Use a Makefile setting for th-libs location.
Matti Hamalainen <ccr@tnsp.org>
parents:
381
diff
changeset
|
31 $(OBJPATH)%.o: $(THLIBS)%.c $(THLIBS)%.h |
219
477449911cb1
Makefile improvements, depend on VERSION etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
213
diff
changeset
|
32 $(CC) $(CFLAGS) -c -o $@ $< |
0 | 33 |
381
7c28f38cb6dd
Update to use new th-libs from the subrepo.
Matti Hamalainen <ccr@tnsp.org>
parents:
263
diff
changeset
|
34 $(OBJPATH)%.o: %.c %.h |
383
6d3ce7f28b65
Use a Makefile setting for th-libs location.
Matti Hamalainen <ccr@tnsp.org>
parents:
381
diff
changeset
|
35 $(CC) $(CFLAGS) -c -o $@ $< -I$(THLIBS) |
381
7c28f38cb6dd
Update to use new th-libs from the subrepo.
Matti Hamalainen <ccr@tnsp.org>
parents:
263
diff
changeset
|
36 |
465
c3b3b6d89084
Simplify buildsystem a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
413
diff
changeset
|
37 $(OBJPATH)%.o: %.c |
c3b3b6d89084
Simplify buildsystem a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
413
diff
changeset
|
38 $(CC) $(CFLAGS) -c -o $@ $< -I$(THLIBS) |
c3b3b6d89084
Simplify buildsystem a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
413
diff
changeset
|
39 |
384 | 40 $(THLIBS_A): $(addprefix $(OBJPATH),$(THLIBS_OBJ)) |
41 $(AR) cru $@ $+ | |
42 | |
413 | 43 main.c: VERSION |
384 | 44 |
465
c3b3b6d89084
Simplify buildsystem a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
413
diff
changeset
|
45 $(NNCHAT_BIN): $(addprefix $(OBJPATH),$(NNCHAT_OBJ)) $(THLIBS_A) $(EXTRAOBJS) |
c3b3b6d89084
Simplify buildsystem a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
413
diff
changeset
|
46 $(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS) |
0 | 47 |
48 # | |
49 # Special targets | |
50 # | |
51 clean: | |
177
fdc771411795
Makefile $(RM) implies -f .. don't include the option in commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
176
diff
changeset
|
52 $(RM) $(TARGETS) $(OBJPATH)*.o |
0 | 53 |
54 srcclean: clean | |
177
fdc771411795
Makefile $(RM) implies -f .. don't include the option in commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
176
diff
changeset
|
55 $(RM) *~ |
0 | 56 |