aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2002-07-06 13:02:57 +0000
committerMax Horn2002-07-06 13:02:57 +0000
commit72dc71335e1d616f7fad8c20134a433eb49e159b (patch)
treedc5755137e3f3213d0e9c2ddca3ddb5b5937f503
parent671678a6c50d9e6c8aed01e9ff86ad77ead930cc (diff)
downloadscummvm-rg350-72dc71335e1d616f7fad8c20134a433eb49e159b.tar.gz
scummvm-rg350-72dc71335e1d616f7fad8c20134a433eb49e159b.tar.bz2
scummvm-rg350-72dc71335e1d616f7fad8c20134a433eb49e159b.zip
added intelligent dependency tracking for anybody who uses GCC
svn-id: r4467
-rw-r--r--Makefile.common18
1 files changed, 16 insertions, 2 deletions
diff --git a/Makefile.common b/Makefile.common
index 6b7fca84eb..1079bfab0a 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -21,8 +21,24 @@ DISTFILES=$(OBJS:.o=.cpp) Makefile scumm.h scummsys.h stdafx.h stdafx.cpp \
debugrl.h whatsnew.txt readme.txt copying.txt \
scummvm.dsp scummvm.dsw sound/fmopl.h gui.h sound.h
+# Default (dumb) compile & dependcy rules
.cpp.o:
$(CC) $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
+$(OBJS): $(INCS)
+
+
+# If you use GCC, disable the above and enable this for intelligent
+# dependency tracking.
+#
+#DEPDIR := .deps
+#.cpp.o:
+# mkdir -p $(DEPDIR)
+# $(CC) -Wp,-MMD,"$(DEPDIR)/$(*F).d2" $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
+# echo -n "$(*D)/" > $(DEPDIR)/$(*F).d
+# cat "$(DEPDIR)/$(*F).d2" >> "$(DEPDIR)/$(*F).d"
+# rm -f "$(DEPDIR)/$(*F).d2"
+#
+#-include $(DEPDIR)/*.d
all: scummvm$(EXEEXT)
@@ -32,6 +48,4 @@ scummvm$(EXEEXT): $(OBJS)
clean:
rm -f $(OBJS) scummvm$(EXEEXT)
-$(OBJS): $(INCS)
-
.PHONY: all clean dist