]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
win32: Tweak Makefile to handle dependencies
authorAlain Spineux <alain@baculasystems.com>
Mon, 12 Mar 2018 16:29:02 +0000 (17:29 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:04 +0000 (09:03 +0100)
- 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

bacula/src/win32/Makefile.rules

index 13a08760814f5a53970d97d16e6f83388e1a5883..c882b56525bd23d5e70681b83fe1579388f22319 100644 (file)
@@ -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