diff options
| author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-11-09 16:29:55 -0500 |
|---|---|---|
| committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2010-11-22 15:00:16 -0500 |
| commit | e9e4de6729a846c4c99754371c0d1738a0238381 (patch) | |
| tree | daf679a7eb5e997d9294599a2b0a4041d6159ef0 /inc | |
| parent | ee91e39147039693f9f4063e319b836adb8401bf (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.makefile | 22 |
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 | |||
| 4 | obj-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 | |||
| 13 | ifeq ($(MAKECMDGOALS),) | ||
| 14 | MAKECMDGOALS += all | ||
| 15 | endif | ||
| 16 | |||
| 17 | ifneq ($(filter-out clean,$(MAKECMDGOALS)),) | ||
| 18 | |||
| 19 | # Pull in dependencies. | ||
| 20 | -include ${obj-all:.o=.d} | ||
| 21 | |||
| 22 | endif | ||
