mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-17 21:25:40 +00:00
(svn r3340) Fix dependency calculation: dependencies didn't get recalculated if a header file changed
Also really automagically create the dependency directories by deriving the directory names from $(DEPS)
This commit is contained in:
parent
04c096ee63
commit
0e12ad7d99
23
Makefile
23
Makefile
@ -978,26 +978,31 @@ upgradeconf: $(MAKE_CONFIG)
|
|||||||
### Internal build rules
|
### Internal build rules
|
||||||
|
|
||||||
# This makes sure the .deps dir is always around.
|
# This makes sure the .deps dir is always around.
|
||||||
DEPS_MAGIC := $(shell mkdir -p .deps .deps/music .deps/sound .deps/video .deps/os .deps/os/macosx .deps/ai/default .deps/ai/trolly)
|
DEPS_MAGIC := $(shell mkdir -p $(sort $(dir $(DEPS))))
|
||||||
|
|
||||||
|
depend:
|
||||||
|
@true # The include handles this automagically
|
||||||
|
|
||||||
# Introduce the dependencies
|
# Introduce the dependencies
|
||||||
ifneq ($(MAKECMDGOALS), clean)
|
ifeq ($(findstring $(MAKECMDGOALS), clean info),)
|
||||||
-include $(DEPS)
|
-include $(DEPS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
%.o: .deps/%.d
|
# Silence stale header dependency errors
|
||||||
|
%.h:
|
||||||
|
@true
|
||||||
|
|
||||||
.deps/%.d: %.c $(MAKE_CONFIG) table/strings.h endian_target.h
|
.deps/%.d: %.c $(MAKE_CONFIG) table/strings.h endian_target.h
|
||||||
@echo '===> Determining dependencies of $<'
|
@echo '===> DEP $<'
|
||||||
$(Q)$(CC) $(CFLAGS) $(CDEFS) -MM $< > $@
|
$(Q)$(CC) $(CFLAGS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:.deps/%.d=%.o):#' > $@
|
||||||
|
|
||||||
.deps/%.d: %.cpp $(MAKE_CONFIG) table/strings.h endian_target.h
|
.deps/%.d: %.cpp $(MAKE_CONFIG) table/strings.h endian_target.h
|
||||||
@echo '===> Determining dependencies of $<'
|
@echo '===> DEP $<'
|
||||||
$(Q)$(CXX) $(CFLAGS) $(CDEFS) -MM $< > $@
|
$(Q)$(CXX) $(CXXFLAGS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:.deps/%.d=%.o):#' > $@
|
||||||
|
|
||||||
.deps/%.d: %.m $(MAKE_CONFIG) table/strings.h endian_target.h
|
.deps/%.d: %.m $(MAKE_CONFIG) table/strings.h endian_target.h
|
||||||
@echo '===> Determining dependencies of $<'
|
@echo '===> DEP $<'
|
||||||
$(Q)$(CC) $(CFLAGS) $(CDEFS) -MM $< > $@
|
$(Q)$(CC) $(OBJCFLAGS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:.deps/%.d=%.o):#' > $@
|
||||||
|
|
||||||
|
|
||||||
%.o: %.c $(MAKE_CONFIG)
|
%.o: %.c $(MAKE_CONFIG)
|
||||||
|
Loading…
Reference in New Issue
Block a user