Mercurial > hg > th-libs
annotate Makefile.inc @ 425:c3f474e59bc1
Fix build.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 10 Mar 2016 01:55:22 +0200 |
parents | aacd4ad3c4ff |
children | 0a2f32b8a26e |
rev | line source |
---|---|
419
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1 NOBUILD_TARGETS += $(OBJPATH) $(BINPATH) |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2 NOINST_TARGETS += $(THLIBS_A) |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3 |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
4 MKDIR ?= mkdir |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
5 MKDIR_P ?= $(MKDIR) -p |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
6 |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
7 .PHONY: clean srcclean all |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
8 |
420 | 9 ## |
10 ## Target rules | |
11 ## | |
419
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
12 all: $(NOBUILD_TARGETS) $(NOINST_TARGETS) $(TARGETS) |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
13 |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
14 |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
15 $(THLIBS)th_string.c: $(addprefix $(THLIBS), th_printf1.c th_strmatch.c th_string.h) |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
16 touch $@ |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
17 |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
18 $(OBJPATH) $(BINPATH): |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
19 @echo " MKDIR $@" |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
20 @$(MKDIR_P) $@ |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
21 |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
22 $(OBJPATH)%.o: $(THLIBS)%.c $(THLIBS)%.h $(THLIBS_DEP) |
423 | 23 @echo " CC $@" |
419
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
24 @$(CC) $(CFLAGS) -c -o $@ $< |
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 $(OBJPATH)%.o: %.c %.h $(THLIBS_DEP) |
423 | 27 @echo " CC $@" |
419
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
28 @$(CC) $(CFLAGS) -c -o $@ $< -I$(THLIBS) |
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)%.o: %.c $(THLIBS_DEP) |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
31 @echo " CC $@" |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
32 @$(CC) $(CFLAGS) -c -o $@ $< -I$(THLIBS) |
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 |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
35 $(THLIBS_A): $(addprefix $(OBJPATH),$(THLIBS_OBJ)) |
423 | 36 @echo " AR $@ $(THLIBS_OBJ)" |
419
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
37 @$(AR) cru $@ $(addprefix $(OBJPATH),$(THLIBS_OBJ)) |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
38 @$(RANLIB) $@ |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
39 |
420 | 40 ## |
41 ## Generate endian check and config.h | |
42 ## | |
425 | 43 $(ENDIANCHK_BIN): $(THLIBS)endianchk.c | $(BINPATH) $(OBJPATH) |
420 | 44 @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
|
45 @$(CC) $(CFLAGS) -o $@ $< |
420 | 46 |
47 config.h: $(ENDIANCHK_BIN) | |
48 $(ENDIANCHK_BIN) > $@ | |
49 | |
50 | |
51 ## | |
52 ## Special targets | |
53 ## | |
419
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
54 clean: |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
55 $(RM) $(TARGETS) $(NOINST_TARGETS) $(OBJPATH)*.o |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
56 |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
57 srcclean: clean |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
58 $(RM) *~ |
ec109cbaddfb
Split some build stuff into Makefile.inc
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
59 |