annotate Makefile.inc @ 472:8d31605c2f0f

Add some depencies.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 04 Jun 2018 03:14:14 +0300
parents 6776928afca1
children b3b8f90bbbe6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
446
e0cead622dce Possibly fix external build things and llvm static analyzer runs.
Matti Hamalainen <ccr@tnsp.org>
parents: 433
diff changeset
1 ifneq ($(BINTOOL_PREFIX),)
433
0a2f32b8a26e Improve the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 425
diff changeset
2 CC = $(BINTOOL_PREFIX)gcc
0a2f32b8a26e Improve the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 425
diff changeset
3 CXX = $(BINTOOL_PREFIX)g++
0a2f32b8a26e Improve the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 425
diff changeset
4 AR = $(BINTOOL_PREFIX)ar
0a2f32b8a26e Improve the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 425
diff changeset
5 RANLIB = $(BINTOOL_PREFIX)ranlib
446
e0cead622dce Possibly fix external build things and llvm static analyzer runs.
Matti Hamalainen <ccr@tnsp.org>
parents: 433
diff changeset
6 else
e0cead622dce Possibly fix external build things and llvm static analyzer runs.
Matti Hamalainen <ccr@tnsp.org>
parents: 433
diff changeset
7 CC ?= $(BINTOOL_PREFIX)gcc
e0cead622dce Possibly fix external build things and llvm static analyzer runs.
Matti Hamalainen <ccr@tnsp.org>
parents: 433
diff changeset
8 CXX ?= $(BINTOOL_PREFIX)g++
e0cead622dce Possibly fix external build things and llvm static analyzer runs.
Matti Hamalainen <ccr@tnsp.org>
parents: 433
diff changeset
9 AR ?= $(BINTOOL_PREFIX)ar
e0cead622dce Possibly fix external build things and llvm static analyzer runs.
Matti Hamalainen <ccr@tnsp.org>
parents: 433
diff changeset
10 RANLIB ?= $(BINTOOL_PREFIX)ranlib
e0cead622dce Possibly fix external build things and llvm static analyzer runs.
Matti Hamalainen <ccr@tnsp.org>
parents: 433
diff changeset
11 endif
e0cead622dce Possibly fix external build things and llvm static analyzer runs.
Matti Hamalainen <ccr@tnsp.org>
parents: 433
diff changeset
12
433
0a2f32b8a26e Improve the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 425
diff changeset
13 INSTALL ?= install
0a2f32b8a26e Improve the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 425
diff changeset
14 MKDIR ?= mkdir
0a2f32b8a26e Improve the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 425
diff changeset
15 MKDIR_P ?= $(MKDIR) -p
0a2f32b8a26e Improve the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 425
diff changeset
16
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17 NOBUILD_TARGETS += $(OBJPATH) $(BINPATH)
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 NOINST_TARGETS += $(THLIBS_A)
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19
472
8d31605c2f0f Add some depencies.
Matti Hamalainen <ccr@tnsp.org>
parents: 447
diff changeset
20 THLIBS_DEP += $(THLIBS)th_types.h $(THLIBS)th_util.h
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21
420
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
22 ##
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
23 ## Target rules
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
24 ##
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 all: $(NOBUILD_TARGETS) $(NOINST_TARGETS) $(TARGETS)
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 $(THLIBS)th_string.c: $(addprefix $(THLIBS), th_printf1.c th_strmatch.c th_string.h)
433
0a2f32b8a26e Improve the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 425
diff changeset
29 @touch $@
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 $(OBJPATH) $(BINPATH):
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 @echo " MKDIR $@"
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33 @$(MKDIR_P) $@
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 $(OBJPATH)%.o: $(THLIBS)%.c $(THLIBS)%.h $(THLIBS_DEP)
423
83fe3a3dcb20 Prettify build.
Matti Hamalainen <ccr@tnsp.org>
parents: 420
diff changeset
36 @echo " CC $@"
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 @$(CC) $(CFLAGS) -c -o $@ $<
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39 $(OBJPATH)%.o: %.c %.h $(THLIBS_DEP)
423
83fe3a3dcb20 Prettify build.
Matti Hamalainen <ccr@tnsp.org>
parents: 420
diff changeset
40 @echo " CC $@"
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 @$(CC) $(CFLAGS) -c -o $@ $< -I$(THLIBS)
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43 $(OBJPATH)%.o: %.c $(THLIBS_DEP)
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 @echo " CC $@"
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45 @$(CC) $(CFLAGS) -c -o $@ $< -I$(THLIBS)
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48 $(THLIBS_A): $(addprefix $(OBJPATH),$(THLIBS_OBJ))
423
83fe3a3dcb20 Prettify build.
Matti Hamalainen <ccr@tnsp.org>
parents: 420
diff changeset
49 @echo " AR $@ $(THLIBS_OBJ)"
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
50 @$(AR) cru $@ $(addprefix $(OBJPATH),$(THLIBS_OBJ))
447
6776928afca1 Add build message for ranlib.
Matti Hamalainen <ccr@tnsp.org>
parents: 446
diff changeset
51 @echo " RANLIB $@"
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52 @$(RANLIB) $@
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
53
420
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
54 ##
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
55 ## Generate endian check and config.h
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
56 ##
425
c3f474e59bc1 Fix build.
Matti Hamalainen <ccr@tnsp.org>
parents: 424
diff changeset
57 $(ENDIANCHK_BIN): $(THLIBS)endianchk.c | $(BINPATH) $(OBJPATH)
420
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
58 @echo " CC $@"
424
aacd4ad3c4ff Fix endianchk build when Makefile.inc is being included from parent project
Matti Hamalainen <ccr@tnsp.org>
parents: 423
diff changeset
59 @$(CC) $(CFLAGS) -o $@ $<
420
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
60
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
61 config.h: $(ENDIANCHK_BIN)
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
62 $(ENDIANCHK_BIN) > $@
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
63
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
64
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
65 ##
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
66 ## Special targets
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
67 ##
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
68 clean:
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
69 $(RM) $(TARGETS) $(NOINST_TARGETS) $(OBJPATH)*.o
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71 srcclean: clean
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72 $(RM) *~
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
73
433
0a2f32b8a26e Improve the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 425
diff changeset
74 .PHONY: clean srcclean all