diff options
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/makefile | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/crawl-ref/source/makefile b/crawl-ref/source/makefile index b879ef6005..6aa60a5627 100644 --- a/crawl-ref/source/makefile +++ b/crawl-ref/source/makefile @@ -623,34 +623,23 @@ TRACK_CFLAGS = $(subst ','\'',$(CC) $(CXX) $(ALL_CFLAGS)) ########################################################################## # Dependencies -ifeq ($(shell which fastdep 2> /dev/null),) - -%.d: %.cc .cflags - $(QUIET_DEPEND)$(CXX) -MM $(ALL_CFLAGS) $< > $@ - -depend: $(OBJECTS:.o=.d) - -ifneq ($(MAKECMDGOALS),clean) -ifneq ($(MAKECMDGOALS),distclean) --include $(OBJECTS:.o=.d) -endif -endif +DEPS := $(OBJECTS:.o=.d) +ifeq ($(shell which fastdep 2> /dev/null),) +DEPEND := $(CXX) -MM $(ALL_CFLAGS) else +DEPEND := fastdep $(DEFINES) $(INCLUDES) +endif -DEPENDENCY_MKF := makefile.dep - -depend: $(DEPENDENCY_MKF) +%.d: %.cc .cflags + $(QUIET_DEPEND)$(DEPEND) $< > $@ -%.dep: $(OBJECTS:.o=.cc) - $(QUIET_DEPEND)fastdep $(DEFINES) $(INCLUDES) $(OBJECTS:.o=.cc) > $@ +depend: $(DEPS) ifneq ($(MAKECMDGOALS),clean) ifneq ($(MAKECMDGOALS),distclean) --include $(DEPENDENCY_MKF) -endif +-include $(DEPS) endif - endif |