annotate Makefile.inc @ 423:83fe3a3dcb20

Prettify build.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 09 Mar 2016 21:23:42 +0200
parents 070fcb008e63
children aacd4ad3c4ff
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 NOBUILD_TARGETS += $(OBJPATH) $(BINPATH)
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 NOINST_TARGETS += $(THLIBS_A)
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 MKDIR ?= mkdir
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 MKDIR_P ?= $(MKDIR) -p
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 .PHONY: clean srcclean all
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8
420
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
9 ##
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
10 ## Target rules
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
11 ##
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 all: $(NOBUILD_TARGETS) $(NOINST_TARGETS) $(TARGETS)
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15 $(THLIBS)th_string.c: $(addprefix $(THLIBS), th_printf1.c th_strmatch.c th_string.h)
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 touch $@
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 $(OBJPATH) $(BINPATH):
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19 @echo " MKDIR $@"
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 @$(MKDIR_P) $@
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 $(OBJPATH)%.o: $(THLIBS)%.c $(THLIBS)%.h $(THLIBS_DEP)
423
83fe3a3dcb20 Prettify build.
Matti Hamalainen <ccr@tnsp.org>
parents: 420
diff changeset
23 @echo " CC $@"
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 @$(CC) $(CFLAGS) -c -o $@ $<
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26 $(OBJPATH)%.o: %.c %.h $(THLIBS_DEP)
423
83fe3a3dcb20 Prettify build.
Matti Hamalainen <ccr@tnsp.org>
parents: 420
diff changeset
27 @echo " CC $@"
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 @$(CC) $(CFLAGS) -c -o $@ $< -I$(THLIBS)
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 $(OBJPATH)%.o: %.c $(THLIBS_DEP)
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 @echo " CC $@"
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 @$(CC) $(CFLAGS) -c -o $@ $< -I$(THLIBS)
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 $(THLIBS_A): $(addprefix $(OBJPATH),$(THLIBS_OBJ))
423
83fe3a3dcb20 Prettify build.
Matti Hamalainen <ccr@tnsp.org>
parents: 420
diff changeset
36 @echo " AR $@ $(THLIBS_OBJ)"
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 @$(AR) cru $@ $(addprefix $(OBJPATH),$(THLIBS_OBJ))
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38 @$(RANLIB) $@
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39
420
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
40 ##
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
41 ## Generate endian check and config.h
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
42 ##
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
43 $(ENDIANCHK_BIN): $(THLIBS)endianchk.c
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
44 @echo " CC $@"
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
45 @$(CC) $(CFLAGS) -o $@ $+
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
46
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
47 config.h: $(ENDIANCHK_BIN)
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
48 $(ENDIANCHK_BIN) > $@
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
49
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
50
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
51 ##
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
52 ## Special targets
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
53 ##
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54 clean:
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
55 $(RM) $(TARGETS) $(NOINST_TARGETS) $(OBJPATH)*.o
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
56
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
57 srcclean: clean
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
58 $(RM) *~
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
59