annotate Makefile.gen @ 122:9fb96c170bbc

Make build process less noisy and also work with parallel make.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 09 Mar 2016 13:56:20 +0200
parents 4c0ecb078591
children e0880165f379
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
122
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
1 CFLAGS += -W -Wall -Wextra -std=c11 -pedantic -I./ -D_XOPEN_SOURCE=500
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
2 CFLAGS += -g
0
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 CFLAGS += -O2
122
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
4 THLIBS = th-libs/
0
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 MKDIR ?= mkdir
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 MKDIR_P ?= $(MKDIR) -p
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 #
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10 # Objects
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 #
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 THLIBS_A=$(OBJPATH)thlibs.a
85
4c0ecb078591 Rename various variables and functions and change relevant places to use the
Matti Hamalainen <ccr@tnsp.org>
parents: 84
diff changeset
13 THLIBS_OBJ=th_util.o th_string.o th_ioctx.o th_args.o th_crypto.o
0
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15
70
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents: 68
diff changeset
16 SIDINFO_OBJ=sidlib.o sidinfo.o
0
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 SIDINFO_BIN=$(BINPATH)sidinfo$(EXEEXT)
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18
68
8dda5f225083 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
19 TARGETS += $(SIDINFO_BIN)
84
04ce0ffbbbb0 Build system improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 70
diff changeset
20 NOBUILD_TARGETS += $(OBJPATH) $(BINPATH)
68
8dda5f225083 Improve build process.
Matti Hamalainen <ccr@tnsp.org>
parents: 52
diff changeset
21 NOINST_TARGETS += $(THLIBS_A)
0
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 #
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 # Target rules
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 #
84
04ce0ffbbbb0 Build system improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 70
diff changeset
27 all: $(NOBUILD_TARGETS) $(NOINST_TARGETS) $(TARGETS)
0
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28
122
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
29 $(THLIBS)th_string.c: $(addprefix $(THLIBS), th_printf1.c th_strmatch.c th_string.h)
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
30 touch $@
0
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31
122
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
32 $(OBJPATH) $(BINPATH):
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
33 @echo " MKDIR $@"
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
34 @$(MKDIR_P) $@
0
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35
122
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
36 $(OBJPATH)%.o: $(THLIBS)%.c $(THLIBS)%.h $(THLIBS_DEP)
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
37 @echo " CC $@ $+"
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
38 @$(CC) $(CFLAGS) -c -o $@ $<
0
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39
122
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
40 $(OBJPATH)%.o: %.c %.h $(THLIBS_DEP)
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
41 @echo " CC $@ $+"
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
42 @$(CC) $(CFLAGS) -c -o $@ $< -I$(THLIBS)
0
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43
122
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
44 $(OBJPATH)%.o: %.c $(THLIBS_DEP)
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
45 @echo " CC $@"
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
46 @$(CC) $(CFLAGS) -c -o $@ $< -I$(THLIBS)
0
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48
4
ea774012d049 Fix build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 1
diff changeset
49 $(THLIBS_A): $(addprefix $(OBJPATH),$(THLIBS_OBJ))
122
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
50 @echo " AR $@"
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
51 @$(AR) cru $@ $(addprefix $(OBJPATH),$(THLIBS_OBJ))
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
52 @$(RANLIB) $@
0
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
53
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54 $(SIDINFO_BIN): $(addprefix $(OBJPATH),$(SIDINFO_OBJ)) $(THLIBS_A) $(EXTRAOBJS)
122
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
55 @echo " LINK $@"
9fb96c170bbc Make build process less noisy and also work with parallel make.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
56 @$(CC) $(CFLAGS) -o $@ $+ $(LDFLAGS)
0
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
57
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
58 #
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
59 # Special targets
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
60 #
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
61 clean:
84
04ce0ffbbbb0 Build system improvements.
Matti Hamalainen <ccr@tnsp.org>
parents: 70
diff changeset
62 $(RM) $(TARGETS) $(NOINST_TARGETS) $(OBJPATH)*.o
0
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
63
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
64 srcclean: clean
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65 $(RM) *~
8e7e08bf7b9e Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
66