summaryrefslogtreecommitdiff
path: root/Makefile.in
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2008-09-02 16:28:31 +0000
committertruebrain <truebrain@openttd.org>2008-09-02 16:28:31 +0000
commitaaf1d7822028fe93ea81265000d1d111814c8a3c (patch)
tree3344851f20d8e7a49896801b79c7d3781fc6e36c /Makefile.in
parent4cd3f2a72e48b8e5db47d59a6475ccff6680c10c (diff)
downloadopenttd-aaf1d7822028fe93ea81265000d1d111814c8a3c.tar.xz
(svn r14227) -Fix [configure]: detect if we are in a new directory, and rerun configure in those cases. Should avoid confusion (idea by Eddi)
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in16
1 files changed, 12 insertions, 4 deletions
diff --git a/Makefile.in b/Makefile.in
index 47fb0f089..cec727b46 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -11,6 +11,7 @@ include Makefile.am
SOURCE_LIST = !!SOURCE_LIST!!
CONFIG_CACHE_SOURCE_LIST = !!CONFIG_CACHE_SOURCE_LIST!!
+CONFIG_CACHE_PWD = !!CONFIG_CACHE_PWD!!
CONFIGURE_FILES = !!CONFIGURE_FILES!!
LIPO = !!LIPO!!
BIN_DIR = !!BIN_DIR!!
@@ -37,9 +38,10 @@ REVISION = !!REVISION!!
AWK = !!AWK!!
DISTCC = !!DISTCC!!
-RES := $(shell if [ ! -f $(CONFIG_CACHE_SOURCE_LIST) ] || [ -n "`cmp $(CONFIG_CACHE_SOURCE_LIST) $(SOURCE_LIST)`" ]; then cp $(SOURCE_LIST) $(CONFIG_CACHE_SOURCE_LIST); fi )
+RES := $(shell if [ ! -f $(CONFIG_CACHE_PWD) ] || [ "`pwd`" != "`cat $(CONFIG_CACHE_PWD)`" ]; then echo "`pwd`" > $(CONFIG_CACHE_PWD); fi )
+RES := $(shell if [ ! -f $(CONFIG_CACHE_SOURCE_LIST) ] || [ -n "`cmp $(CONFIG_CACHE_SOURCE_LIST) $(SOURCE_LIST) 2>/dev/null`" ]; then cp $(SOURCE_LIST) $(CONFIG_CACHE_SOURCE_LIST); fi )
-all: config.cache
+all: config.pwd config.cache
ifdef DISTCC
@if [ -z "`echo '$(MFLAGS)' | grep '\-j'`" ]; then echo; echo "WARNING: you enabled distcc support, but you don't seem to be using the -jN paramter"; echo; fi
endif
@@ -78,7 +80,13 @@ help:
@echo " bundle_lha create the lha installation bundle"
@echo " bundle_dmg create the dmg installation bundle"
+config.pwd: $(CONFIG_CACHE_PWD)
+ $(MAKE) reconfigure
+
config.cache: $(CONFIG_CACHE_SOURCE_LIST) $(CONFIGURE_FILES)
+ $(MAKE) reconfigure
+
+reconfigure:
ifeq ($(shell if test -f config.cache; then echo 1; fi), 1)
@echo "----------------"
@echo "The system detected that source.list or any configure file is altered."
@@ -87,7 +95,7 @@ ifeq ($(shell if test -f config.cache; then echo 1; fi), 1)
# Make sure we don't lock config.cache
@$(shell cat config.cache | sed 's/\\ /\\\\ /g') || exit 1
@echo "----------------"
- @echo "Reconfig done. Now compiling..."
+ @echo "Reconfig done. Please re-execute make."
@echo "----------------"
else
@echo "----------------"
@@ -115,7 +123,7 @@ mrproper:
$(Q)rm -rf objs
$(Q)rm -f Makefile Makefile.am Makefile.bundle
$(Q)rm -f media/openttd.desktop
- $(Q)rm -f $(CONFIG_CACHE_SOURCE_LIST) config.cache config.log
+ $(Q)rm -f $(CONFIG_CACHE_SOURCE_LIST) config.cache config.pwd config.log $(CONFIG_CACHE_PWD)
$(Q)rm -rf $(BUNDLE_DIR)
$(Q)rm -rf $(BUNDLES_DIR)