X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=Makefile;fp=Makefile;h=2ebb0debe99bacd4087a765a62322f415ac85b24;hb=ed956579bd31083ac13e9176b6362c64bdadaceb;hp=fb8a01d3282a6fddf3a7b4866a0af198ab0dd2f6;hpb=9af930dc855cadc975af58e4e6d338c0baca565d;p=osl.git diff --git a/Makefile b/Makefile index fb8a01d..2ebb0de 100644 --- a/Makefile +++ b/Makefile @@ -83,12 +83,20 @@ ifeq ($(findstring clean, $(MAKECMDGOALS)),) -include $(deps) endif -# List osl.h in the prerequisites to make sure we generate it before attempting -# to run the compiler. This matters only when the .d file does not exist. -%.o: %.c osl.h Makefile errtab.h +# The files to generate before attempting to run the compiler. These +# are the order-only prerequisites in the rule below. +pre_deps := osl.h errtab.h oslfsck.lsg.h + +# The .d and .o files are both created from a single cc invocation. +define CC_CMD $(CC) $(OSL_CPPFLAGS) $(CPPFLAGS) \ - -c -MMD -MF $(*F).d -MT $@ \ + -c -MMD -MF $(*F).d -MT $(*F).o \ $(OSL_CFLAGS) $(CFLAGS) $< +endef +%.o: %.c Makefile | $(pre_deps) + $(CC_CMD) +%.d: %.c Makefile | $(pre_deps) + $(CC_CMD) fsck.o: oslfsck.lsg.h oslfsck: $(fsck_objects)