Mercurial > hg > nnchat
annotate Makefile.gen @ 671:dd3083a3383d
Use the makefile.inc helper from th-libs for generic targets.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 09 Mar 2016 15:09:59 +0200 |
parents | 32c13602c091 |
children | 650e7a5c74c5 |
rev | line source |
---|---|
665
23d16d9cdf96
Work on the build system, split generic UNIX things into Makefile.unix
Matti Hamalainen <ccr@tnsp.org>
parents:
647
diff
changeset
|
1 ### |
23d16d9cdf96
Work on the build system, split generic UNIX things into Makefile.unix
Matti Hamalainen <ccr@tnsp.org>
parents:
647
diff
changeset
|
2 ### Main makefile |
23d16d9cdf96
Work on the build system, split generic UNIX things into Makefile.unix
Matti Hamalainen <ccr@tnsp.org>
parents:
647
diff
changeset
|
3 ### |
23d16d9cdf96
Work on the build system, split generic UNIX things into Makefile.unix
Matti Hamalainen <ccr@tnsp.org>
parents:
647
diff
changeset
|
4 CFLAGS += -g -W -Wall -Wextra -DTH_NO_DEFAULTS -I. |
263 | 5 CFLAGS += -O2 |
665
23d16d9cdf96
Work on the build system, split generic UNIX things into Makefile.unix
Matti Hamalainen <ccr@tnsp.org>
parents:
647
diff
changeset
|
6 CFLAGS += -std=c11 -pedantic -D_XOPEN_SOURCE=500 |
383
6d3ce7f28b65
Use a Makefile setting for th-libs location.
Matti Hamalainen <ccr@tnsp.org>
parents:
381
diff
changeset
|
7 THLIBS=th-libs/ |
0 | 8 |
626 | 9 |
0 | 10 # |
213 | 11 # Version strings |
12 # | |
13 NN_VERSION := $(shell cat VERSION) | |
14 comma:= , | |
15 NN_VERSION_COM := $(subst .,$(comma),$(NN_VERSION)) | |
465
c3b3b6d89084
Simplify buildsystem a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
413
diff
changeset
|
16 CFLAGS += -DNN_VERSION=\"$(NN_VERSION)\" |
213 | 17 |
18 # | |
0 | 19 # Objects |
20 # | |
384 | 21 THLIBS_A=$(OBJPATH)thlibs.a |
669
32c13602c091
Some functions used were factored into new th_datastruct module in th-libs,
Matti Hamalainen <ccr@tnsp.org>
parents:
665
diff
changeset
|
22 THLIBS_OBJ=th_util.o th_string.o th_args.o th_ioctx.o th_file.o th_config.o th_network.o th_datastruct.o |
465
c3b3b6d89084
Simplify buildsystem a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
413
diff
changeset
|
23 |
623
118276b60667
More work towards using th-libs th_network module.
Matti Hamalainen <ccr@tnsp.org>
parents:
622
diff
changeset
|
24 NNCHAT_OBJ=main.o util.o ui.o |
0 | 25 NNCHAT_BIN=$(BINPATH)nnchat$(EXEEXT) |
26 | |
665
23d16d9cdf96
Work on the build system, split generic UNIX things into Makefile.unix
Matti Hamalainen <ccr@tnsp.org>
parents:
647
diff
changeset
|
27 TARGETS += $(NNCHAT_BIN) |
0 | 28 |
671
dd3083a3383d
Use the makefile.inc helper from th-libs for generic targets.
Matti Hamalainen <ccr@tnsp.org>
parents:
669
diff
changeset
|
29 include $(THLIBS)/Makefile.inc |
0 | 30 |
31 # | |
32 # Target rules | |
33 # | |
413 | 34 main.c: VERSION |
384 | 35 |
465
c3b3b6d89084
Simplify buildsystem a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
413
diff
changeset
|
36 $(NNCHAT_BIN): $(addprefix $(OBJPATH),$(NNCHAT_OBJ)) $(THLIBS_A) $(EXTRAOBJS) |
671
dd3083a3383d
Use the makefile.inc helper from th-libs for generic targets.
Matti Hamalainen <ccr@tnsp.org>
parents:
669
diff
changeset
|
37 @echo " LINK $@" |
dd3083a3383d
Use the makefile.inc helper from th-libs for generic targets.
Matti Hamalainen <ccr@tnsp.org>
parents:
669
diff
changeset
|
38 @$(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS) |
0 | 39 |
40 # | |
647 | 41 # Documentation |
42 # | |
43 $(DOC): | |
44 @wget -qO- http://www.tnsp.org/~ccr/nnchat/ | tr '\n' '§' | \ | |
45 sed "s/<.-- BEGIN -->.*<.-- END -->//g;s/<script.*<\/script>//g" | tr '§' '\n' > "$@.tmp" | |
46 @links -dump "$@.tmp" > $@ | |
47 | |
48 |