]> git.sesse.net Git - movit/commitdiff
Add simple dependency generation to the Makefile.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 7 Oct 2012 12:01:15 +0000 (14:01 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 7 Oct 2012 12:01:15 +0000 (14:01 +0200)
Makefile

index 51aebc541159274202b538f4d0b4c2de831b4baf..93a1166e9ec364e483938bf89b66cfb6c925a3d4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -23,8 +23,10 @@ OBJS += sandbox_effect.o
 test: $(OBJS)
        $(CXX) -o test $(OBJS) $(LDFLAGS)
 
 test: $(OBJS)
        $(CXX) -o test $(OBJS) $(LDFLAGS)
 
-.o: .cpp
-       $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
+%.o: %.cpp
+       $(CXX) -MMD $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
+
+-include $(OBJS:.o=.d)
 
 clean:
        $(RM) test $(OBJS)
 
 clean:
        $(RM) test $(OBJS)