build: Let .d files depend only on .c.
[paraslash.git] / Makefile.real
index cb3bcaa3f16463e0b0f4a9167d225f669483683f..3192bf1e35e73fbc7bd3df66743bf3192886d242 100644 (file)
@@ -248,14 +248,15 @@ $(object_dir)/compress_filter.o: CFLAGS += -O3
 
 $(object_dir)/%.o: %.c | $(object_dir)
        @[ -z "$(Q)" ] || echo 'CC $<'
-       $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(STRICT_CFLAGS) $<
+       $(Q) $(CC) -c -o $@ -MMD -MF $(dep_dir)/$(*F).d -MT $@ $(CPPFLAGS) \
+               $(STRICT_CFLAGS) $<
 
 # The compiler outputs dependencies either as foo.h or as some_directory/foo.h,
 # depending on whether the latter file exists. Since make needs the directory
 # part we prefix the dependency as appropriate.
 $(dep_dir)/%.d: %.c | $(dep_dir)
        @[ -z "$(Q)" ] || echo 'DEP $<'
-       $(Q) $(CC) $(CPPFLAGS) -MM -MG -MT $@ -MT $(object_dir)/$(*F).o $< \
+       $(Q) $(CC) $(CPPFLAGS) -MM -MG -MT $(object_dir)/$(*F).o $< \
                | sed -e "s@ \([a-zA-Z0-9_]\{1,\}.lsg.h\)@ $(lls_suite_dir)/\1@g" > $@
 
 para_recv para_afh para_play para_server: LDFLAGS += $(id3tag_ldflags)