aboutsummaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2010-11-09 16:29:55 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2010-11-22 15:00:16 -0500
commite9e4de6729a846c4c99754371c0d1738a0238381 (patch)
treedaf679a7eb5e997d9294599a2b0a4041d6159ef0 /inc
parentee91e39147039693f9f4063e319b836adb8401bf (diff)
Provide standard Makefile rules for clients of liblitmus
We avoid doing the same thing over and over in all repositories using liblitmus if we just pull in common rules & configurations from liblitmus. This gives us the ability to cross-compile for free.
Diffstat (limited to 'inc')
-rw-r--r--inc/depend.makefile22
1 files changed, 22 insertions, 0 deletions
diff --git a/inc/depend.makefile b/inc/depend.makefile
new file mode 100644
index 0000000..4d10534
--- /dev/null
+++ b/inc/depend.makefile
@@ -0,0 +1,22 @@
1# Generic dependency resolution. Part of liblitmus so that we don't have to
2# carry it around in every project using liblitmus.
3
4obj-all = ${sort ${foreach target,${all},${obj-${target}}}}
5
6# rule to generate dependency files
7%.d: %.c
8 @set -e; rm -f $@; \
9 $(CC) -MM $(CPPFLAGS) $< > $@.$$$$; \
10 sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
11 rm -f $@.$$$$
12
13ifeq ($(MAKECMDGOALS),)
14MAKECMDGOALS += all
15endif
16
17ifneq ($(filter-out clean,$(MAKECMDGOALS)),)
18
19# Pull in dependencies.
20-include ${obj-all:.o=.d}
21
22endif