Mercurial > hg > th-libs
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 |
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 |
472 | 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 | 22 ## |
23 ## Target rules | |
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 | 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 | 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 | 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 | 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 | 54 ## |
55 ## Generate endian check and config.h | |
56 ## | |
425 | 57 $(ENDIANCHK_BIN): $(THLIBS)endianchk.c | $(BINPATH) $(OBJPATH) |
420 | 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 | 60 |
61 config.h: $(ENDIANCHK_BIN) | |
62 $(ENDIANCHK_BIN) > $@ | |
63 | |
64 | |
65 ## | |
66 ## Special targets | |
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 | 74 .PHONY: clean srcclean all |