Mercurial > hg > nnchat
annotate Makefile.gen @ 458:6eef0dc83f0a
Cosmetics.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 26 May 2012 05:33:06 +0300 |
parents | 14b685cdbd2c |
children | c3b3b6d89084 |
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 # | |
384 | 16 THLIBS_A=$(OBJPATH)thlibs.a |
17 THLIBS_OBJ=th_util.o th_string.o th_args.o th_config.o | |
0 | 18 NNCHAT_BIN=$(BINPATH)nnchat$(EXEEXT) |
19 | |
384 | 20 TARGETS+=$(THLIBS_A) $(NNCHAT_BIN) |
0 | 21 |
22 | |
23 # | |
24 # Target rules | |
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 | 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 | 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 | 34 $(THLIBS_A): $(addprefix $(OBJPATH),$(THLIBS_OBJ)) |
35 $(AR) cru $@ $+ | |
36 | |
413 | 37 main.c: VERSION |
384 | 38 |
413 | 39 $(NNCHAT_BIN): main.c $(OBJPATH)util.o $(OBJPATH)network.o $(THLIBS_A) $(EXTRAOBJS) |
384 | 40 $(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS) -DNN_VERSION=\"$(NN_VERSION)\" -I$(THLIBS) |
0 | 41 |
42 # | |
43 # Special targets | |
44 # | |
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 | 47 |
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 | 50 |