Changeset - r10060:e7724ac712b0
[Not reviewed]
master
0 2 0
truebrain - 16 years ago 2008-09-02 16:28:31
truebrain@openttd.org
(svn r14227) -Fix [configure]: detect if we are in a new directory, and rerun configure in those cases. Should avoid confusion (idea by Eddi)
2 files changed with 16 insertions and 4 deletions:
0 comments (0 inline, 0 general)
Makefile.in
Show inline comments
 
@@ -8,12 +8,13 @@ else
 
endif
 

	
 
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!!
 
ICON_THEME_DIR = !!ICON_THEME_DIR!!
 
MAN_DIR = !!MAN_DIR!!
 
MENU_DIR = !!MENU_DIR!!
 
@@ -34,15 +35,16 @@ TTDS = $(SRC_DIRS:%=%/$(TTD))
 
OS = !!OS!!
 
OSXAPP = !!OSXAPP!!
 
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
 
	@for dir in $(DIRS); do \
 
		$(MAKE) -C $$dir all; \
 
	done
 
@@ -75,22 +77,28 @@ help:
 
	@echo "  bundle_zip    create the zip installation bundle"
 
	@echo "  bundle_gzip   create the gzip installation bundle"
 
	@echo "  bundle_bzip2  create the bzip2 installation bundle"
 
	@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."
 
	@echo " Going to reconfigure with last known settings..."
 
	@echo "----------------"
 
# 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 "----------------"
 
	@echo "Have not found a configuration, please run configure first."
 
	@echo "----------------"
 
	@exit 1
 
@@ -112,13 +120,13 @@ mrproper:
 
		$(MAKE) -C $$dir mrproper; \
 
		rm -f $$dir/Makefile; \
 
	done
 
	$(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)
 

	
 
depend:
 
	@for dir in $(SRC_DIRS); do \
 
		$(MAKE) -C $$dir depend; \
config.lib
Show inline comments
 
@@ -2309,12 +2309,13 @@ make_sed() {
 
		s#!!CONFIG_CACHE_COMPILER!!#config.cache.compiler#g;
 
		s#!!CONFIG_CACHE_LINKER!!#config.cache.linker#g;
 
		s#!!CONFIG_CACHE_ENDIAN!!#config.cache.endian#g;
 
		s#!!CONFIG_CACHE_SOURCE!!#config.cache.source#g;
 
		s#!!CONFIG_CACHE_VERSION!!#config.cache.version#g;
 
		s#!!CONFIG_CACHE_SOURCE_LIST!!#config.cache.source.list#g;
 
		s#!!CONFIG_CACHE_PWD!!#config.cache.pwd#g;
 
		s#!!LANG_SUPPRESS!!#$lang_suppress#g;
 
		s#!!OBJS_C!!#$OBJS_C#g;
 
		s#!!OBJS_CPP!!#$OBJS_CPP#g;
 
		s#!!OBJS_MM!!#$OBJS_MM#g;
 
		s#!!OBJS_RC!!#$OBJS_RC#g;
 
		s#!!SRCS!!#$SRCS#g;
 
@@ -2377,14 +2378,17 @@ generate_main() {
 
	< $ROOT_DIR/Makefile.in sed "$SRC_REPLACE" > Makefile
 
	cp $ROOT_DIR/Makefile.bundle.in Makefile.bundle
 
	echo "# Auto-generated file -- DO NOT EDIT" > Makefile.am
 
	echo >> Makefile.am
 
	# Make the copy of the source-list, so we don't trigger an unwanted recompile
 
	cp $SOURCE_LIST config.cache.source.list
 
	# Add the current directory, so we don't trigger an unwanted recompile
 
	echo "`pwd`" > config.cache.pwd
 
	# Make sure config.cache is OLDER then config.cache.source.list
 
	touch config.cache
 
	touch config.pwd
 

	
 
	if [ "$menu_dir" != "" ]; then
 
		generate_menu_item
 
	fi
 
}
 

	
0 comments (0 inline, 0 general)