summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-25 16:10:06 +0000
committertron <tron@openttd.org>2005-01-25 16:10:06 +0000
commit6497f08ad4518bc99c55f3261dc955125faa5fc9 (patch)
treec29a2f5da2b12579c080fa7d85af3728e556e281 /Makefile
parent85248d7850fe278ddcf7eb406c3d41600bbc8ad2 (diff)
downloadopenttd-6497f08ad4518bc99c55f3261dc955125faa5fc9.tar.xz
(svn r1672) Simplify dependency tracking and actually implement it for C++ files, too.
Note: Do "make clean" to get rid of the old dependency files
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 10 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index fafee037d..3b8090542 100644
--- a/Makefile
+++ b/Makefile
@@ -667,8 +667,7 @@ ifdef WITH_DIRECTMUSIC
CXX_SOURCES += w32dm2.cpp
endif
-DEPS1 = $(foreach obj,$(OBJS),.deps/$(obj))
-DEPS = $(DEPS1:%.o=%.P)
+DEPS = $(OBJS:%.o=.deps/%.d)
LANG_TXT = $(filter-out %.unfinished.txt,$(wildcard lang/*.txt))
LANGS = $(LANG_TXT:%.txt=%.lng)
@@ -912,20 +911,19 @@ DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
# first compilation round as we just build everything at that time anyway,
# therefore we do not need to watch deps.
-
%.o: %.c $(MAKE_CONFIG) endian.h table/strings.h
@echo '===> Compiling $<'
- @$(CC) $(CFLAGS) $(CDEFS) -Wp,-MD,.deps/$(*F).pp -c $< -o $@
- @-cp .deps/$(*F).pp .deps/$(*F).P; \
- tr ' ' '\012' < .deps/$(*F).pp \
- | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
- >> .deps/$(*F).P; \
- rm .deps/$(*F).pp
-
-# For DirectMusic build and BeOS specific parts
+ @$(CC) $(CFLAGS) $(CDEFS) -MD -c $< -o $@
+ @mv $(<:%.c=%.d) $(<:%.c=.deps/%.d)
+
%.o: %.cpp $(MAKE_CONFIG) endian.h table/strings.h
@echo '===> Compiling $<'
- @$(CXX) $(CFLAGS) $(CDEFS) -c $< -o $@
+ @$(CXX) $(CFLAGS) $(CDEFS) -MD -c $< -o $@
+ @mv $(<:%.c=%.d) $(<:%.c=.deps/%.d)
+
+# Silence stale header dependencies
+%.h:
+ @true
info: