annotate Makefile.gen @ 622:bb6b07b44800

Network code is being generalized into a th-libs module.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 27 May 2014 07:31:20 +0300
parents 6261511ecc96
children 118276b60667
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
263
8c983c3b93eb CFLAGS changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
1 CFLAGS += -g -W -Wall -Wextra -DTH_NO_DEFAULTS
8c983c3b93eb CFLAGS changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
2 CFLAGS += -O2
8c983c3b93eb CFLAGS changes.
Matti Hamalainen <ccr@tnsp.org>
parents: 219
diff changeset
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
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 #
213
78f47ae47c2a Fix Windows build.
Matti Hamalainen <ccr@tnsp.org>
parents: 199
diff changeset
7 # Version strings
78f47ae47c2a Fix Windows build.
Matti Hamalainen <ccr@tnsp.org>
parents: 199
diff changeset
8 #
78f47ae47c2a Fix Windows build.
Matti Hamalainen <ccr@tnsp.org>
parents: 199
diff changeset
9 NN_VERSION := $(shell cat VERSION)
78f47ae47c2a Fix Windows build.
Matti Hamalainen <ccr@tnsp.org>
parents: 199
diff changeset
10 comma:= ,
78f47ae47c2a Fix Windows build.
Matti Hamalainen <ccr@tnsp.org>
parents: 199
diff changeset
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
78f47ae47c2a Fix Windows build.
Matti Hamalainen <ccr@tnsp.org>
parents: 199
diff changeset
13
78f47ae47c2a Fix Windows build.
Matti Hamalainen <ccr@tnsp.org>
parents: 199
diff changeset
14 #
0
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 # Objects
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 #
384
40b95d677f68 Fix build.
Matti Hamalainen <ccr@tnsp.org>
parents: 383
diff changeset
17 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
18 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
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
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 NNCHAT_BIN=$(BINPATH)nnchat$(EXEEXT)
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22
384
40b95d677f68 Fix build.
Matti Hamalainen <ccr@tnsp.org>
parents: 383
diff changeset
23 TARGETS+=$(THLIBS_A) $(NNCHAT_BIN)
0
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 #
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 # Target rules
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
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
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
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
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
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
40b95d677f68 Fix build.
Matti Hamalainen <ccr@tnsp.org>
parents: 383
diff changeset
40 $(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
41 $(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
42 $(RANLIB) $@
384
40b95d677f68 Fix build.
Matti Hamalainen <ccr@tnsp.org>
parents: 383
diff changeset
43
413
14b685cdbd2c Rename files.
Matti Hamalainen <ccr@tnsp.org>
parents: 412
diff changeset
44 main.c: VERSION
384
40b95d677f68 Fix build.
Matti Hamalainen <ccr@tnsp.org>
parents: 383
diff changeset
45
465
c3b3b6d89084 Simplify buildsystem a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 413
diff changeset
46 $(NNCHAT_BIN): $(addprefix $(OBJPATH),$(NNCHAT_OBJ)) $(THLIBS_A) $(EXTRAOBJS)
c3b3b6d89084 Simplify buildsystem a bit.
Matti Hamalainen <ccr@tnsp.org>
parents: 413
diff changeset
47 $(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS)
0
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49 #
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
50 # Special targets
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
51 #
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52 clean:
177
fdc771411795 Makefile $(RM) implies -f .. don't include the option in commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
53 $(RM) $(TARGETS) $(OBJPATH)*.o
0
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
55 srcclean: clean
177
fdc771411795 Makefile $(RM) implies -f .. don't include the option in commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
56 $(RM) *~
0
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
57