annotate Makefile.gen @ 412:3e64acb433e8

Split libnnchat into libnnet and libnnutil
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 24 May 2012 06:38:26 +0300
parents 40b95d677f68
children 14b685cdbd2c
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))
78f47ae47c2a Fix Windows build.
Matti Hamalainen <ccr@tnsp.org>
parents: 199
diff changeset
12
78f47ae47c2a Fix Windows build.
Matti Hamalainen <ccr@tnsp.org>
parents: 199
diff changeset
13 #
0
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 # Objects
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 #
384
40b95d677f68 Fix build.
Matti Hamalainen <ccr@tnsp.org>
parents: 383
diff changeset
16 THLIBS_A=$(OBJPATH)thlibs.a
40b95d677f68 Fix build.
Matti Hamalainen <ccr@tnsp.org>
parents: 383
diff changeset
17 THLIBS_OBJ=th_util.o th_string.o th_args.o th_config.o
0
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 NNCHAT_BIN=$(BINPATH)nnchat$(EXEEXT)
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19
384
40b95d677f68 Fix build.
Matti Hamalainen <ccr@tnsp.org>
parents: 383
diff changeset
20 TARGETS+=$(THLIBS_A) $(NNCHAT_BIN)
0
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 #
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 # Target rules
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 #
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
26 all: $(NONBUILD) $(TARGETS)
0
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27
383
6d3ce7f28b65 Use a Makefile setting for th-libs location.
Matti Hamalainen <ccr@tnsp.org>
parents: 381
diff changeset
28 $(OBJPATH)%.o: $(THLIBS)%.c $(THLIBS)%.h
219
477449911cb1 Makefile improvements, depend on VERSION etc.
Matti Hamalainen <ccr@tnsp.org>
parents: 213
diff changeset
29 $(CC) $(CFLAGS) -c -o $@ $<
0
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30
381
7c28f38cb6dd Update to use new th-libs from the subrepo.
Matti Hamalainen <ccr@tnsp.org>
parents: 263
diff changeset
31 $(OBJPATH)%.o: %.c %.h
383
6d3ce7f28b65 Use a Makefile setting for th-libs location.
Matti Hamalainen <ccr@tnsp.org>
parents: 381
diff changeset
32 $(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
33
384
40b95d677f68 Fix build.
Matti Hamalainen <ccr@tnsp.org>
parents: 383
diff changeset
34 $(THLIBS_A): $(addprefix $(OBJPATH),$(THLIBS_OBJ))
40b95d677f68 Fix build.
Matti Hamalainen <ccr@tnsp.org>
parents: 383
diff changeset
35 $(AR) cru $@ $+
40b95d677f68 Fix build.
Matti Hamalainen <ccr@tnsp.org>
parents: 383
diff changeset
36
40b95d677f68 Fix build.
Matti Hamalainen <ccr@tnsp.org>
parents: 383
diff changeset
37 nnchat.c: VERSION
40b95d677f68 Fix build.
Matti Hamalainen <ccr@tnsp.org>
parents: 383
diff changeset
38
412
3e64acb433e8 Split libnnchat into libnnet and libnnutil
Matti Hamalainen <ccr@tnsp.org>
parents: 384
diff changeset
39 $(NNCHAT_BIN): nnchat.c $(OBJPATH)libnnutil.o $(OBJPATH)libnnnet.o $(THLIBS_A) $(EXTRAOBJS)
384
40b95d677f68 Fix build.
Matti Hamalainen <ccr@tnsp.org>
parents: 383
diff changeset
40 $(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS) -DNN_VERSION=\"$(NN_VERSION)\" -I$(THLIBS)
0
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 #
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43 # Special targets
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 #
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45 clean:
177
fdc771411795 Makefile $(RM) implies -f .. don't include the option in commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
46 $(RM) $(TARGETS) $(OBJPATH)*.o
0
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48 srcclean: clean
177
fdc771411795 Makefile $(RM) implies -f .. don't include the option in commands.
Matti Hamalainen <ccr@tnsp.org>
parents: 176
diff changeset
49 $(RM) *~
0
728243125263 Import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
50