Mercurial > hg > nnchat
annotate Makefile.gen @ 627:493c08d452d9
API changes in th_network.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 21 Jun 2014 05:11:14 +0300 |
parents | 904c359b1ced |
children | 46fcab5ff44e |
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 |
626 | 6 MKDIR ?= mkdir |
7 MKDIR_P ?= $(MKDIR) -p | |
8 | |
0 | 9 # |
213 | 10 # Version strings |
11 # | |
12 NN_VERSION := $(shell cat VERSION) | |
13 comma:= , | |
14 NN_VERSION_COM := $(subst .,$(comma),$(NN_VERSION)) | |
465
c3b3b6d89084
Simplify buildsystem a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
413
diff
changeset
|
15 CFLAGS += -DNN_VERSION=\"$(NN_VERSION)\" |
213 | 16 |
17 # | |
0 | 18 # Objects |
19 # | |
384 | 20 THLIBS_A=$(OBJPATH)thlibs.a |
622
bb6b07b44800
Network code is being generalized into a th-libs module.
Matti Hamalainen <ccr@tnsp.org>
parents:
567
diff
changeset
|
21 THLIBS_OBJ=th_util.o th_string.o th_args.o th_ioctx.o th_config.o th_network.o |
465
c3b3b6d89084
Simplify buildsystem a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
413
diff
changeset
|
22 |
623
118276b60667
More work towards using th-libs th_network module.
Matti Hamalainen <ccr@tnsp.org>
parents:
622
diff
changeset
|
23 NNCHAT_OBJ=main.o util.o ui.o |
0 | 24 NNCHAT_BIN=$(BINPATH)nnchat$(EXEEXT) |
25 | |
384 | 26 TARGETS+=$(THLIBS_A) $(NNCHAT_BIN) |
0 | 27 |
626 | 28 NONBUILD+=$(OBJPATH) $(BINPATH) |
0 | 29 |
30 # | |
31 # Target rules | |
32 # | |
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
|
33 all: $(NONBUILD) $(TARGETS) |
0 | 34 |
626 | 35 $(OBJPATH): |
36 $(MKDIR_P) $@ | |
37 | |
38 $(BINPATH): | |
39 $(MKDIR_P) $@ | |
40 | |
383
6d3ce7f28b65
Use a Makefile setting for th-libs location.
Matti Hamalainen <ccr@tnsp.org>
parents:
381
diff
changeset
|
41 $(OBJPATH)%.o: $(THLIBS)%.c $(THLIBS)%.h |
219
477449911cb1
Makefile improvements, depend on VERSION etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
213
diff
changeset
|
42 $(CC) $(CFLAGS) -c -o $@ $< |
0 | 43 |
381
7c28f38cb6dd
Update to use new th-libs from the subrepo.
Matti Hamalainen <ccr@tnsp.org>
parents:
263
diff
changeset
|
44 $(OBJPATH)%.o: %.c %.h |
383
6d3ce7f28b65
Use a Makefile setting for th-libs location.
Matti Hamalainen <ccr@tnsp.org>
parents:
381
diff
changeset
|
45 $(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
|
46 |
465
c3b3b6d89084
Simplify buildsystem a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
413
diff
changeset
|
47 $(OBJPATH)%.o: %.c |
c3b3b6d89084
Simplify buildsystem a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
413
diff
changeset
|
48 $(CC) $(CFLAGS) -c -o $@ $< -I$(THLIBS) |
c3b3b6d89084
Simplify buildsystem a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
413
diff
changeset
|
49 |
384 | 50 $(THLIBS_A): $(addprefix $(OBJPATH),$(THLIBS_OBJ)) |
567
6261511ecc96
Object files were added to the thlibs.a archive twice. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
561
diff
changeset
|
51 $(AR) cru $@ $(addprefix $(OBJPATH),$(THLIBS_OBJ)) |
533
52c56ada3816
Fix Win32/MinGW cross-compilation target to work with Debian's gcc-mingw-w64
Matti Hamalainen <ccr@tnsp.org>
parents:
466
diff
changeset
|
52 $(RANLIB) $@ |
384 | 53 |
413 | 54 main.c: VERSION |
384 | 55 |
465
c3b3b6d89084
Simplify buildsystem a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
413
diff
changeset
|
56 $(NNCHAT_BIN): $(addprefix $(OBJPATH),$(NNCHAT_OBJ)) $(THLIBS_A) $(EXTRAOBJS) |
c3b3b6d89084
Simplify buildsystem a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
413
diff
changeset
|
57 $(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS) |
0 | 58 |
59 # | |
60 # Special targets | |
61 # | |
62 clean: | |
177
fdc771411795
Makefile $(RM) implies -f .. don't include the option in commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
176
diff
changeset
|
63 $(RM) $(TARGETS) $(OBJPATH)*.o |
0 | 64 |
65 srcclean: clean | |
177
fdc771411795
Makefile $(RM) implies -f .. don't include the option in commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
176
diff
changeset
|
66 $(RM) *~ |
0 | 67 |