summaryrefslogtreecommitdiff
path: root/Makefile.src.in
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2009-05-14 21:59:24 +0000
committerglx <glx@openttd.org>2009-05-14 21:59:24 +0000
commitb3a539b0168c4058ffe19930a455f987778a5fbf (patch)
treefcecf03292e29df6fde60c7292f0e4c761bae755 /Makefile.src.in
parent203cd6c2ddf4fe6853d0a72d280640e10579918c (diff)
downloadopenttd-b3a539b0168c4058ffe19930a455f987778a5fbf.tar.xz
(svn r16307) -Fix: makedepend can't handle the amount of files we have and it also miss some dependencies. That's why we introduce our custom implementation of makedepend.
Diffstat (limited to 'Makefile.src.in')
-rw-r--r--Makefile.src.in14
1 files changed, 11 insertions, 3 deletions
diff --git a/Makefile.src.in b/Makefile.src.in
index 2aa45744a..de84a7d3d 100644
--- a/Makefile.src.in
+++ b/Makefile.src.in
@@ -20,6 +20,7 @@ MEDIA_DIR = !!MEDIA_DIR!!
TTD = !!TTD!!
STRGEN = !!STRGEN!!
ENDIAN_CHECK = !!ENDIAN_CHECK!!
+DEPEND = !!DEPEND!!
ENDIAN_FORCE = !!ENDIAN_FORCE!!
OS = !!OS!!
STAGE = !!STAGE!!
@@ -167,11 +168,18 @@ ifeq ($(filter $(ENDIAN_TARGETS) depend clean mrproper, $(MAKECMDGOALS)),)
-include Makefile.dep
endif
+ifeq ("$(SRC_OBJS_DIR)/$(DEPEND)","$(MAKEDEPEND)")
+DEP := $(MAKEDEPEND)
+$(SRC_OBJS_DIR)/$(DEPEND): $(SRC_DIR)/depend/depend.cpp
+ $(E) '$(STAGE) Compiling and linking $(DEPEND)'
+ $(Q)$(CXX_HOST) -o $@ $<
+endif
+
# Make sure that only 'make depend' ALWAYS triggers a recheck
ifeq ($(filter depend, $(MAKECMDGOALS)),)
-Makefile.dep: $(FILE_DEP) $(SRCS:%=$(SRC_DIR)/%) $(CONFIG_CACHE_SOURCE)
+Makefile.dep: $(FILE_DEP) $(SRCS:%=$(SRC_DIR)/%) $(CONFIG_CACHE_SOURCE) $(DEP)
else
-Makefile.dep: FORCE
+Makefile.dep: $(DEP) FORCE
endif
$(E) '$(STAGE) DEP CHECK (all files)'
$(Q)rm -f Makefile.dep.tmp
@@ -291,7 +299,7 @@ depend: $(DEPS)
clean:
$(E) '$(STAGE) Cleaning up object files'
- $(Q)rm -f $(DEPS) $(OBJS) $(TTD) $(TTD:%=$(BIN_DIR)/%) $(CONFIG_CACHE_COMPILER) $(CONFIG_CACHE_LINKER) $(CONFIG_CACHE_ENDIAN) $(CONFIG_CACHE_SOURCE) $(ENDIAN_TARGETS)
+ $(Q)rm -f $(DEPS) $(OBJS) $(TTD) $(DEPEND) $(TTD:%=$(BIN_DIR)/%) $(CONFIG_CACHE_COMPILER) $(CONFIG_CACHE_LINKER) $(CONFIG_CACHE_ENDIAN) $(CONFIG_CACHE_SOURCE) $(ENDIAN_TARGETS)
mrproper: clean
$(Q)rm -f $(SRC_DIR)/rev.cpp $(SRC_DIR)/ottdres.rc