summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/makefile
diff options
context:
space:
mode:
authorSteven Noonan <steven@uplinklabs.net>2010-01-01 13:46:05 -0800
committerSteven Noonan <steven@uplinklabs.net>2010-01-01 13:51:03 -0800
commit9e2aae8e87ed53f3c845ff943e35e7f5b61cafac (patch)
tree941eb06d57ccf13618e55f011394767be880ce64 /crawl-ref/source/makefile
parentbccd94fcb60b16c231ec4c4ce23c42f28ee07215 (diff)
downloadcrawl-ref-9e2aae8e87ed53f3c845ff943e35e7f5b61cafac.tar.gz
crawl-ref-9e2aae8e87ed53f3c845ff943e35e7f5b61cafac.zip
makefile: greatly simplify dependency generation
I feel ashamed to have overlooked this awesome trick. Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Diffstat (limited to 'crawl-ref/source/makefile')
-rw-r--r--crawl-ref/source/makefile42
1 files changed, 4 insertions, 38 deletions
diff --git a/crawl-ref/source/makefile b/crawl-ref/source/makefile
index 5b18afe4fe..188359e245 100644
--- a/crawl-ref/source/makefile
+++ b/crawl-ref/source/makefile
@@ -456,28 +456,9 @@ endif
# Figure out the build settings for this type of build
#
-# All
-# Default target.
-ifneq (,$(findstring all,$(MAKECMDGOALS)))
- USE_DEPGEN=YesPlease
-endif
-
-# All
-# Default target.
-ifeq (,$(MAKECMDGOALS))
- USE_DEPGEN=YesPlease
-endif
-
-# $(GAME)
-# Another default target.
-ifneq (,$(findstring $(GAME),$(MAKECMDGOALS)))
- USE_DEPGEN=YesPlease
-endif
-
# Debug
# No optimization, full debugging.
ifneq (,$(findstring debug,$(MAKECMDGOALS)))
- USE_DEPGEN=YesPlease
FULLDEBUG=YesPlease
WIZARD=YesPlease
DEBUG=YesPlease
@@ -487,7 +468,6 @@ endif
# Wizard
# Optimized, with wizard mode.
ifneq (,$(findstring wizard,$(MAKECMDGOALS)))
- USE_DEPGEN=YesPlease
WIZARD=YesPlease
DEBUG=YesPlease
endif
@@ -495,7 +475,6 @@ endif
# Profile
# Optimized, with full debugging.
ifneq (,$(findstring profile,$(MAKECMDGOALS)))
- USE_DEPGEN=YesPlease
FULLDEBUG=YesPlease
WIZARD=YesPlease
DEBUG=YesPlease
@@ -767,20 +746,7 @@ TRACK_CFLAGS = $(subst ','\'',$(CC) $(CXX) $(ALL_CFLAGS)) # (stray ' f
DEPS := $(OBJECTS:.o=.d)
-ifeq ($(shell which fastdep 2> /dev/null),)
-DEPEND := $(CXX) -MM $(ALL_CFLAGS)
-else
-DEPEND := fastdep $(DEFINES) $(DEFINES_L) $(INCLUDES) $(INCLUDES_L)
-endif
-
-%.d: %.cc .cflags
- $(QUIET_DEPEND)$(DEPEND) $< > $@
-
-depend: $(DEPS)
-
-ifdef USE_DEPGEN
-include $(DEPS)
-endif
# This information is included in crash reports, and is printed with
# "crawl -version"
@@ -899,11 +865,11 @@ wizard: $(GAME)
# test.
$(UTIL)%.o: $(UTIL)%.cc .cflags
- $(QUIET_CXX)$(CXX) $(YACC_CFLAGS) -o $@ -c $<
+ $(QUIET_CXX)$(CXX) $(YACC_CFLAGS) -Wp,-MD,$(subst .o,.d,$@) -c $< -o $@
ifdef PCH
%.h.gch: %.h
- $(QUIET_PCH)$(CXX) $(ALL_CFLAGS) -c $< -o $@
+ $(QUIET_PCH)$(CXX) $(ALL_CFLAGS) -Wp,-MD,$(subst .o,.d,$@) -c $< -o $@
CC_DEP := AppHdr.h.gch
endif
@@ -911,10 +877,10 @@ endif
$(OBJECTS:%.o=%.cc): $(CC_DEP) $(TILEDEFHDRS) $(CONTRIB_LIBS)
%.o: %.m .cflags
- $(QUIET_CXX)$(CC) $(ALL_CFLAGS) -c $< -o $@
+ $(QUIET_CXX)$(CC) $(ALL_CFLAGS) -Wp,-MD,$(subst .o,.d,$@) -c $< -o $@
%.o: %.cc .cflags
- $(QUIET_CXX)$(CXX) $(ALL_CFLAGS) -c $< -o $@
+ $(QUIET_CXX)$(CXX) $(ALL_CFLAGS) -Wp,-MD,$(subst .o,.d,$@) -c $< -o $@
icon.o: util/crawl.rc util/crawl.ico
$(QUIET_WINDRES)$(WINDRES) util/crawl.rc icon.o