]> git.notmuchmail.org Git - scherzo/commitdiff
Makefile: Fix automatic generation of dependencies.
authorCarl Worth <cworth@cworth.org>
Fri, 23 Sep 2011 06:04:07 +0000 (23:04 -0700)
committerCarl Worth <cworth@cworth.org>
Fri, 23 Sep 2011 06:04:07 +0000 (23:04 -0700)
Without this, updates to the header file were not triggering rebuilds
of the source. Things are much more convenient with this.

Makefile

index a5e8015e0bb73a569359d0b04a76217e0739d97d..a00d6bf960e42b094ebf6aa882087007656b1ae2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 all: scherzo
 
-scherzo_srcs =         \
+scherzo_srcs :=                \
        scherzo.c       \
        score.c
 
@@ -25,16 +25,16 @@ endif
 # Otherwise, print the full command line.
 quiet ?= $($(shell echo $1 | sed -e s'/ .*//'))
 
-.deps/%.d: %.cpp $(global_deps)
+.deps/%.d: %.c Makefile
        @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
-       $(CXX) -M $(CPPFLAGS) $(FINAL_CXXFLAGS) $< > $@.$$$$ 2>/dev/null ; \
+       $(CC) -M $(CPPFLAGS) $(SCHERZO_CFLAGS) $< > $@.$$$$ 2>/dev/null ; \
        sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
        rm -f $@.$$$$
 
-DEPS := $(DEPS:%.cpp=.deps/%.d)
+DEPS := $(scherzo_srcs:%.c=.deps/%.d)
 -include $(DEPS)
 
-%.o: %.c $(global_deps)
+%.o: %.c Makefile
        $(call quiet,CC $(CFLAGS)) -c $(SCHERZO_CFLAGS) $< -o $@
 
 scherzo: $(scherzo_modules)