Mercurial > hg > th-libs
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 |
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 | 2 CC = $(BINTOOL_PREFIX)gcc |
3 CXX = $(BINTOOL_PREFIX)g++ | |
4 AR = $(BINTOOL_PREFIX)ar | |
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 | 13 INSTALL ?= install |
14 MKDIR ?= mkdir | |
15 MKDIR_P ?= $(MKDIR) -p | |
16 | |
474 | 17 |
18 THLIBS_A = $(OBJPATH)thlibs.a | |
19 THLIBS_DEP += $(THLIBS)th_types.h $(THLIBS)th_util.h | |
20 | |
21 | |
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 | 25 |
26 COMPILE_OBJ = @if test ! -d $(OBJPATH); then mkdir -p $(OBJPATH); fi && echo " CC $<" && $(CC) $(CFLAGS) -c -o $@ $< | |
27 LINK_BIN = @if test ! -d $(BINPATH); then mkdir -p $(BINPATH); fi && echo " LINK $@" && $(CC) -o $@ $(filter %.o %.a,$+) $(LDFLAGS) | |
28 | |
419
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
29 |
420 | 30 ## |
31 ## Target rules | |
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 | 37 @touch $@ |
419
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
38 |
474 | 39 |
40 $(OBJPATH)%.o: $(THLIBS)%.c $(THLIBS_DEP) | |
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 | 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 | 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 | 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 | 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 | 59 ## |
60 ## Generate endian check and config.h | |
61 ## | |
474 | 62 $(OBJPATH)endianchk.o: $(THLIBS)endianchk.c |
63 $(COMPILE_OBJ) | |
64 | |
65 $(ENDIANCHK_BIN): $(OBJPATH)endianchk.o | |
66 $(LINK_BIN) | |
420 | 67 |
68 config.h: $(ENDIANCHK_BIN) | |
69 $(ENDIANCHK_BIN) > $@ | |
70 | |
71 | |
72 ## | |
73 ## Special targets | |
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 | 81 .PHONY: clean srcclean all |