annotate Makefile.inc @ 481:e4ce60239d16

Bump copyright years.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 10 Jan 2019 20:01:38 +0200
parents b3b8f90bbbe6
children 1013ddd2759b
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
474
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
17
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
18 THLIBS_A = $(OBJPATH)thlibs.a
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
19 THLIBS_DEP += $(THLIBS)th_types.h $(THLIBS)th_util.h
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
20
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
21
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
22 NOBUILD_TARGETS +=
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23 NOINST_TARGETS += $(THLIBS_A)
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24
474
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
25
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
26 COMPILE_OBJ = @if test ! -d $(OBJPATH); then mkdir -p $(OBJPATH); fi && echo " CC $<" && $(CC) $(CFLAGS) -c -o $@ $<
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
27 LINK_BIN = @if test ! -d $(BINPATH); then mkdir -p $(BINPATH); fi && echo " LINK $@" && $(CC) -o $@ $(filter %.o %.a,$+) $(LDFLAGS)
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
28
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29
420
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
30 ##
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
31 ## Target rules
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
32 ##
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33 all: $(NOBUILD_TARGETS) $(NOINST_TARGETS) $(TARGETS)
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
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 $(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
37 @touch $@
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38
474
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
39
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
40 $(OBJPATH)%.o: $(THLIBS)%.c $(THLIBS_DEP)
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
41 $(COMPILE_OBJ)
419
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: $(THLIBS)%.c $(THLIBS)%.h $(THLIBS_DEP)
474
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
44 $(COMPILE_OBJ) -I$(THLIBS)
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46 $(OBJPATH)%.o: %.c %.h $(THLIBS_DEP)
474
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
47 $(COMPILE_OBJ) -I$(THLIBS)
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49 $(OBJPATH)%.o: %.c $(THLIBS_DEP)
474
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
50 $(COMPILE_OBJ) -I$(THLIBS)
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
51
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
53 $(THLIBS_A): $(addprefix $(OBJPATH),$(THLIBS_OBJ))
423
83fe3a3dcb20 Prettify build.
Matti Hamalainen <ccr@tnsp.org>
parents: 420
diff changeset
54 @echo " AR $@ $(THLIBS_OBJ)"
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
55 @$(AR) cru $@ $(addprefix $(OBJPATH),$(THLIBS_OBJ))
447
6776928afca1 Add build message for ranlib.
Matti Hamalainen <ccr@tnsp.org>
parents: 446
diff changeset
56 @echo " RANLIB $@"
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
57 @$(RANLIB) $@
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
58
420
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
59 ##
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
60 ## Generate endian check and config.h
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
61 ##
474
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
62 $(OBJPATH)endianchk.o: $(THLIBS)endianchk.c
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
63 $(COMPILE_OBJ)
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
64
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
65 $(ENDIANCHK_BIN): $(OBJPATH)endianchk.o
b3b8f90bbbe6 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 472
diff changeset
66 $(LINK_BIN)
420
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
67
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
68 config.h: $(ENDIANCHK_BIN)
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
69 $(ENDIANCHK_BIN) > $@
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
70
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
71
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
72 ##
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
73 ## Special targets
070fcb008e63 Improve build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 419
diff changeset
74 ##
419
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75 clean:
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76 $(RM) $(TARGETS) $(NOINST_TARGETS) $(OBJPATH)*.o
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
78 srcclean: clean
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79 $(RM) *~
ec109cbaddfb Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80
433
0a2f32b8a26e Improve the build system.
Matti Hamalainen <ccr@tnsp.org>
parents: 425
diff changeset
81 .PHONY: clean srcclean all