annotate Makefile.gen @ 418:3c1bd6c55e00

Make build process less noisy.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 09 Mar 2016 13:55:48 +0200
parents 137a3cca9a9c
children ec109cbaddfb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
406
30432a52026a Adjust build flags.
Matti Hamalainen <ccr@tnsp.org>
parents: 382
diff changeset
1 CFLAGS += -W -Wall -Wextra -std=c11 -pedantic -I./ -D_XOPEN_SOURCE=500 -DTH_USE_INTERNAL_SPRINTF=1
30432a52026a Adjust build flags.
Matti Hamalainen <ccr@tnsp.org>
parents: 382
diff changeset
2 CFLAGS += -g
254
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 CFLAGS += -O2
406
30432a52026a Adjust build flags.
Matti Hamalainen <ccr@tnsp.org>
parents: 382
diff changeset
4 CFLAGS += -DTH_PRINTF_DEBUG=1
30432a52026a Adjust build flags.
Matti Hamalainen <ccr@tnsp.org>
parents: 382
diff changeset
5 THLIBS = ./
254
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 MKDIR ?= mkdir
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 MKDIR_P ?= $(MKDIR) -p
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 #
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 # Objects
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 #
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 THLIBS_A=$(OBJPATH)thlibs.a
273
7bea1d5ab944 Build all modules.
Matti Hamalainen <ccr@tnsp.org>
parents: 254
diff changeset
14 THLIBS_OBJ=th_util.o th_config.o th_string.o th_ioctx.o \
7bea1d5ab944 Build all modules.
Matti Hamalainen <ccr@tnsp.org>
parents: 254
diff changeset
15 th_args.o th_crypto.o th_datastruct.o th_network.o
7bea1d5ab944 Build all modules.
Matti Hamalainen <ccr@tnsp.org>
parents: 254
diff changeset
16
254
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19 TESTS_OBJ=tests.o
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 TESTS_BIN=$(BINPATH)tests$(EXEEXT)
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 TARGETS += $(TESTS_BIN)
294
3835423074c0 Fix 'make check'. :S
Matti Hamalainen <ccr@tnsp.org>
parents: 292
diff changeset
23 NOBUILD_TARGETS += $(OBJPATH) $(BINPATH)
254
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 NOINST_TARGETS += $(THLIBS_A)
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 #
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 # Target rules
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 #
316
d4a069014899 Don't run 'check' target through 'all'.
Matti Hamalainen <ccr@tnsp.org>
parents: 310
diff changeset
30 all: $(NOBUILD_TARGETS) $(NOINST_TARGETS) $(TARGETS)
254
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31
416
2503cd600c8f Improve build rule for th_string.c depencies.
Matti Hamalainen <ccr@tnsp.org>
parents: 413
diff changeset
32 $(THLIBS)th_string.c: $(addprefix $(THLIBS), th_printf1.c th_strmatch.c th_string.h)
413
bb7120c11f8e Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 406
diff changeset
33 touch $@
310
11cba47777ec Split some things to a template file th_printf1.c
Matti Hamalainen <ccr@tnsp.org>
parents: 302
diff changeset
34
418
3c1bd6c55e00 Make build process less noisy.
Matti Hamalainen <ccr@tnsp.org>
parents: 417
diff changeset
35 $(OBJPATH) $(BINPATH):
3c1bd6c55e00 Make build process less noisy.
Matti Hamalainen <ccr@tnsp.org>
parents: 417
diff changeset
36 @echo " MKDIR $@"
3c1bd6c55e00 Make build process less noisy.
Matti Hamalainen <ccr@tnsp.org>
parents: 417
diff changeset
37 @$(MKDIR_P) $@
254
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38
417
137a3cca9a9c Fix build process for parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 416
diff changeset
39 $(OBJPATH)%.o: %.c %.h $(THLIBS_DEP)
418
3c1bd6c55e00 Make build process less noisy.
Matti Hamalainen <ccr@tnsp.org>
parents: 417
diff changeset
40 @echo " CC $@"
3c1bd6c55e00 Make build process less noisy.
Matti Hamalainen <ccr@tnsp.org>
parents: 417
diff changeset
41 @$(CC) $(CFLAGS) -c -o $@ $< -I$(THLIBS)
254
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42
417
137a3cca9a9c Fix build process for parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 416
diff changeset
43 $(OBJPATH)%.o: %.c $(THLIBS_DEP)
418
3c1bd6c55e00 Make build process less noisy.
Matti Hamalainen <ccr@tnsp.org>
parents: 417
diff changeset
44 @echo " CC $@"
3c1bd6c55e00 Make build process less noisy.
Matti Hamalainen <ccr@tnsp.org>
parents: 417
diff changeset
45 @$(CC) $(CFLAGS) -c -o $@ $< -I$(THLIBS)
254
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47
417
137a3cca9a9c Fix build process for parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 416
diff changeset
48 $(THLIBS_A): $(addprefix $(OBJPATH),$(THLIBS_OBJ))
418
3c1bd6c55e00 Make build process less noisy.
Matti Hamalainen <ccr@tnsp.org>
parents: 417
diff changeset
49 @echo " AR $@"
3c1bd6c55e00 Make build process less noisy.
Matti Hamalainen <ccr@tnsp.org>
parents: 417
diff changeset
50 @$(AR) cru $@ $(addprefix $(OBJPATH),$(THLIBS_OBJ))
3c1bd6c55e00 Make build process less noisy.
Matti Hamalainen <ccr@tnsp.org>
parents: 417
diff changeset
51 @$(RANLIB) $@
254
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52
302
3f05f6fb5dfd Fix build.
Matti Hamalainen <ccr@tnsp.org>
parents: 294
diff changeset
53 $(TESTS_BIN): $(addprefix $(OBJPATH),$(TESTS_OBJ)) $(THLIBS_A)
418
3c1bd6c55e00 Make build process less noisy.
Matti Hamalainen <ccr@tnsp.org>
parents: 417
diff changeset
54 @echo " LINK $@"
3c1bd6c55e00 Make build process less noisy.
Matti Hamalainen <ccr@tnsp.org>
parents: 417
diff changeset
55 @$(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS)
254
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
56
292
54032f17c7e5 Add 'make check' target.
Matti Hamalainen <ccr@tnsp.org>
parents: 273
diff changeset
57
54032f17c7e5 Add 'make check' target.
Matti Hamalainen <ccr@tnsp.org>
parents: 273
diff changeset
58 check: $(TESTS_BIN)
54032f17c7e5 Add 'make check' target.
Matti Hamalainen <ccr@tnsp.org>
parents: 273
diff changeset
59 $(TESTS_BIN) -v
54032f17c7e5 Add 'make check' target.
Matti Hamalainen <ccr@tnsp.org>
parents: 273
diff changeset
60
254
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
61 #
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
62 # Special targets
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
63 #
413
bb7120c11f8e Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 406
diff changeset
64 .PHONY: clean srcclean all
bb7120c11f8e Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 406
diff changeset
65
254
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
66 clean:
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
67 $(RM) $(TARGETS) $(NOINST_TARGETS) $(OBJPATH)*.o
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
68
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
69 srcclean: clean
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70 $(RM) *~
3d1e2af4e4e6 Start of a very simplistic unit test suite. Initially handling just printf()
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71