Mercurial > hg > th-libs
annotate Makefile.inc @ 447:6776928afca1
Add build message for ranlib.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 25 Oct 2017 18:25:21 +0300 |
parents | e0cead622dce |
children | 8d31605c2f0f |
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 | |
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 |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
20 |
420 | 21 ## |
22 ## Target rules | |
23 ## | |
419
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
24 all: $(NOBUILD_TARGETS) $(NOINST_TARGETS) $(TARGETS) |
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 |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
27 $(THLIBS)th_string.c: $(addprefix $(THLIBS), th_printf1.c th_strmatch.c th_string.h) |
433 | 28 @touch $@ |
419
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) $(BINPATH): |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
31 @echo " MKDIR $@" |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
32 @$(MKDIR_P) $@ |
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 $(OBJPATH)%.o: $(THLIBS)%.c $(THLIBS)%.h $(THLIBS_DEP) |
423 | 35 @echo " CC $@" |
419
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
36 @$(CC) $(CFLAGS) -c -o $@ $< |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
37 |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
38 $(OBJPATH)%.o: %.c %.h $(THLIBS_DEP) |
423 | 39 @echo " CC $@" |
419
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
40 @$(CC) $(CFLAGS) -c -o $@ $< -I$(THLIBS) |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
41 |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
42 $(OBJPATH)%.o: %.c $(THLIBS_DEP) |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
43 @echo " CC $@" |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
44 @$(CC) $(CFLAGS) -c -o $@ $< -I$(THLIBS) |
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 |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
47 $(THLIBS_A): $(addprefix $(OBJPATH),$(THLIBS_OBJ)) |
423 | 48 @echo " AR $@ $(THLIBS_OBJ)" |
419
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
49 @$(AR) cru $@ $(addprefix $(OBJPATH),$(THLIBS_OBJ)) |
447
6776928afca1
Add build message for ranlib.
Matti Hamalainen <ccr@tnsp.org>
parents:
446
diff
changeset
|
50 @echo " RANLIB $@" |
419
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
51 @$(RANLIB) $@ |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
52 |
420 | 53 ## |
54 ## Generate endian check and config.h | |
55 ## | |
425 | 56 $(ENDIANCHK_BIN): $(THLIBS)endianchk.c | $(BINPATH) $(OBJPATH) |
420 | 57 @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
|
58 @$(CC) $(CFLAGS) -o $@ $< |
420 | 59 |
60 config.h: $(ENDIANCHK_BIN) | |
61 $(ENDIANCHK_BIN) > $@ | |
62 | |
63 | |
64 ## | |
65 ## Special targets | |
66 ## | |
419
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
67 clean: |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
68 $(RM) $(TARGETS) $(NOINST_TARGETS) $(OBJPATH)*.o |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
69 |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
70 srcclean: clean |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
71 $(RM) *~ |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
72 |
433 | 73 .PHONY: clean srcclean all |