Mercurial > hg > nnchat
annotate Makefile.gen @ 383:6d3ce7f28b65
Use a Makefile setting for th-libs location.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 03 Oct 2011 18:21:10 +0300 |
parents | 7c28f38cb6dd |
children | 40b95d677f68 |
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)) | |
12 | |
13 # | |
0 | 14 # Objects |
15 # | |
16 NNCHAT_BIN=$(BINPATH)nnchat$(EXEEXT) | |
17 | |
159
1b6bc8bf6ac3
Create win32/ subdirectory if needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
103
diff
changeset
|
18 TARGETS+=$(NNCHAT_BIN) |
0 | 19 |
20 | |
21 # | |
22 # Target rules | |
23 # | |
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
|
24 all: $(NONBUILD) $(TARGETS) |
0 | 25 |
383
6d3ce7f28b65
Use a Makefile setting for th-libs location.
Matti Hamalainen <ccr@tnsp.org>
parents:
381
diff
changeset
|
26 $(OBJPATH)%.o: $(THLIBS)%.c $(THLIBS)%.h |
219
477449911cb1
Makefile improvements, depend on VERSION etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
213
diff
changeset
|
27 $(CC) $(CFLAGS) -c -o $@ $< |
0 | 28 |
381
7c28f38cb6dd
Update to use new th-libs from the subrepo.
Matti Hamalainen <ccr@tnsp.org>
parents:
263
diff
changeset
|
29 $(OBJPATH)%.o: %.c %.h |
383
6d3ce7f28b65
Use a Makefile setting for th-libs location.
Matti Hamalainen <ccr@tnsp.org>
parents:
381
diff
changeset
|
30 $(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
|
31 |
219
477449911cb1
Makefile improvements, depend on VERSION etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
213
diff
changeset
|
32 $(NNCHAT_BIN): nnchat.c $(OBJPATH)libnnchat.o $(OBJPATH)th_util.o $(OBJPATH)th_string.o $(OBJPATH)th_args.o $(OBJPATH)th_config.o $(EXTRAOBJS) VERSION |
383
6d3ce7f28b65
Use a Makefile setting for th-libs location.
Matti Hamalainen <ccr@tnsp.org>
parents:
381
diff
changeset
|
33 $(CC) $(CFLAGS) -o $@ $(filter %.c %.o,$+) $(LDFLAGS) -DNN_VERSION=\"$(NN_VERSION)\" -I$(THLIBS) |
0 | 34 |
35 # | |
36 # Special targets | |
37 # | |
38 clean: | |
177
fdc771411795
Makefile $(RM) implies -f .. don't include the option in commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
176
diff
changeset
|
39 $(RM) $(TARGETS) $(OBJPATH)*.o |
0 | 40 |
41 srcclean: clean | |
177
fdc771411795
Makefile $(RM) implies -f .. don't include the option in commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
176
diff
changeset
|
42 $(RM) *~ |
0 | 43 |