Mercurial > hg > nnchat
annotate Makefile.gen @ 219:477449911cb1
Makefile improvements, depend on VERSION etc.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sat, 27 Nov 2010 17:42:14 +0200 |
parents | 78f47ae47c2a |
children | 8c983c3b93eb |
rev | line source |
---|---|
195
829457be9eea
Build system changes to support (in a big kludgy manner) icon and version information resource generation for Win32 binaries.
Matti Hamalainen <ccr@tnsp.org>
parents:
183
diff
changeset
|
1 |
199
5ef630818bef
Get version number from external file 'VERSION'.
Matti Hamalainen <ccr@tnsp.org>
parents:
195
diff
changeset
|
2 CFLAGS+=-g -W -Wall -O2 -DTH_NO_DEFAULTS |
5ef630818bef
Get version number from external file 'VERSION'.
Matti Hamalainen <ccr@tnsp.org>
parents:
195
diff
changeset
|
3 #CFLAGS+=-g -W -Wall -DTH_NO_DEFAULTS |
0 | 4 |
5 # | |
213 | 6 # Version strings |
7 # | |
8 NN_VERSION := $(shell cat VERSION) | |
9 comma:= , | |
10 NN_VERSION_COM := $(subst .,$(comma),$(NN_VERSION)) | |
11 | |
12 # | |
0 | 13 # Objects |
14 # | |
15 NNCHAT_BIN=$(BINPATH)nnchat$(EXEEXT) | |
16 | |
159
1b6bc8bf6ac3
Create win32/ subdirectory if needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
103
diff
changeset
|
17 TARGETS+=$(NNCHAT_BIN) |
0 | 18 |
19 | |
20 # | |
21 # Target rules | |
22 # | |
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
|
23 all: $(NONBUILD) $(TARGETS) |
0 | 24 |
83
9baefdd4179c
Use win32/ subdirectory for object files also.
Matti Hamalainen <ccr@tnsp.org>
parents:
68
diff
changeset
|
25 $(OBJPATH)%.o: %.c %.h |
219
477449911cb1
Makefile improvements, depend on VERSION etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
213
diff
changeset
|
26 $(CC) $(CFLAGS) -c -o $@ $< |
0 | 27 |
219
477449911cb1
Makefile improvements, depend on VERSION etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
213
diff
changeset
|
28 $(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 |
477449911cb1
Makefile improvements, depend on VERSION etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
213
diff
changeset
|
29 $(CC) $(CFLAGS) -o $@ $(filter %.c %.o,$+) $(LDFLAGS) -DNN_VERSION=\"$(NN_VERSION)\" |
0 | 30 |
31 # | |
32 # Special targets | |
33 # | |
34 clean: | |
177
fdc771411795
Makefile $(RM) implies -f .. don't include the option in commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
176
diff
changeset
|
35 $(RM) $(TARGETS) $(OBJPATH)*.o |
0 | 36 |
37 srcclean: clean | |
177
fdc771411795
Makefile $(RM) implies -f .. don't include the option in commands.
Matti Hamalainen <ccr@tnsp.org>
parents:
176
diff
changeset
|
38 $(RM) *~ |
0 | 39 |