From: Alain Spineux Date: Mon, 12 Mar 2018 16:29:02 +0000 (+0100) Subject: win32: Tweak Makefile to handle dependencies X-Git-Tag: Release-11.3.2~312 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c27f5ce9f7486d277940a622357d69aa15415ba;p=thirdparty%2Fbacula.git win32: Tweak Makefile to handle dependencies - the dependencies where ignored because the target was wrong before > main.o obj64/main.d: main.cpp who.h ../libwin32/main.cpp after > obj64/main.o obj64/main.d: main.cpp who.h ../libwin32/main.cpp the "obj64" "prefix allows make to find the rule when building obj64/main.o - adding "-" to "include" shut up missing .d files at first compile --- diff --git a/bacula/src/win32/Makefile.rules b/bacula/src/win32/Makefile.rules index 13a087608..c882b5652 100644 --- a/bacula/src/win32/Makefile.rules +++ b/bacula/src/win32/Makefile.rules @@ -25,10 +25,11 @@ define makedep @echo "Generating dependencies for $<" $(call checkdir,$@) $(ECHO_CMD)$(CXX) -MM $(CPPFLAGS) $< > $@.$$$$; \ - sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ + sed 's,\($*\)\.o[ :]*,$(OBJDIR)/\1.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ endef + define link_conapp @echo "Linking $@" $(call checkdir,$@) @@ -76,6 +77,6 @@ $(OBJDIR)/%.d: %.cpp ifneq ($(ALL_OBJS),) ifneq ($(MAKECMDGOALS),clean) -include $(patsubst %.o,%.d,$(filter-out %.res,$(ALL_OBJS))) +-include $(patsubst %.o,%.d,$(filter-out %.res,$(ALL_OBJS))) endif endif