Changeset - r10220:396be673708a
[Not reviewed]
master
0 6 0
skidd13 - 16 years ago 2008-10-06 17:05:44
skidd13@openttd.org
(svn r14443) -Change: Unify the delimiters used in config* and make*
6 files changed with 20 insertions and 20 deletions:
0 comments (0 inline, 0 general)
Makefile.bundle.in
Show inline comments
 
@@ -24,38 +24,38 @@ endif
 
ifdef OSXAPP
 
DATA_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/data
 
LANG_DIR = $(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/lang
 
TTD_DIR  = $(BUNDLE_DIR)/$(OSXAPP)/Contents/MacOS
 
else
 
DATA_DIR = $(BUNDLE_DIR)/data
 
LANG_DIR = $(BUNDLE_DIR)/lang
 
TTD_DIR  = $(BUNDLE_DIR)
 
endif
 

	
 
bundle: all
 
	@echo '[BUNDLE] Constructing bundle'
 
	$(Q)rm -rf   "${BUNDLE_DIR}"
 
	$(Q)mkdir -p "${BUNDLE_DIR}"
 
	$(Q)rm -rf   "$(BUNDLE_DIR)"
 
	$(Q)mkdir -p "$(BUNDLE_DIR)"
 
	$(Q)mkdir -p "$(BUNDLE_DIR)/docs"
 
	$(Q)mkdir -p "$(BUNDLE_DIR)/scenario"
 
	$(Q)mkdir -p "$(BUNDLE_DIR)/scenario/heightmap"
 
	$(Q)mkdir -p "$(BUNDLE_DIR)/media"
 
	$(Q)mkdir -p "$(TTD_DIR)"
 
	$(Q)mkdir -p "$(DATA_DIR)"
 
	$(Q)mkdir -p "$(LANG_DIR)"
 
ifdef OSXAPP
 
	$(Q)mkdir -p "$(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources"
 
	$(Q)echo "APPL????" >                                          "$(BUNDLE_DIR)/$(OSXAPP)/Contents/PkgInfo"
 
	$(Q)cp    "$(ROOT_DIR)/os/macosx/openttd.icns"                 "$(BUNDLE_DIR)/$(OSXAPP)/Contents/Resources/openttd.icns"
 
	$(Q)$(ROOT_DIR)/os/macosx/plistgen.sh                          "${BUNDLE_DIR}/$(OSXAPP)" "$(REV)"
 
	$(Q)$(ROOT_DIR)/os/macosx/plistgen.sh                          "$(BUNDLE_DIR)/$(OSXAPP)" "$(REV)"
 
	$(Q)cp    "$(ROOT_DIR)/docs/OSX_install_instructions.txt"      "$(BUNDLE_DIR)/docs/"
 
	$(Q)cp    "$(ROOT_DIR)/os/macosx/splash.png"                   "$(DATA_DIR)"
 
endif
 
	$(Q)cp "$(BIN_DIR)/$(TTD)"                "$(TTD_DIR)/"
 
	$(Q)cp "$(BIN_DIR)/data/"*.grf            "$(DATA_DIR)/"
 
	$(Q)cp "$(BIN_DIR)/data/"*.obg            "$(DATA_DIR)/"
 
	$(Q)cp "$(BIN_DIR)/data/opntitle.dat"     "$(DATA_DIR)/"
 
	$(Q)cp "$(BIN_DIR)/lang/"*.lng            "$(LANG_DIR)/"
 
	$(Q)cp "$(ROOT_DIR)/readme.txt"           "$(BUNDLE_DIR)/"
 
	$(Q)cp "$(ROOT_DIR)/COPYING"              "$(BUNDLE_DIR)/"
 
	$(Q)cp "$(ROOT_DIR)/known-bugs.txt"       "$(BUNDLE_DIR)/"
 
	$(Q)cp "$(ROOT_DIR)/docs/multiplayer.txt" "$(BUNDLE_DIR)/docs/"
Makefile.in
Show inline comments
 
@@ -82,25 +82,25 @@ 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
 
	@$(shell cat config.cache | sed 's#\\ #\\\\ #g') || exit 1
 
	@echo "----------------"
 
	@echo "Reconfig done. Please re-execute make."
 
	@echo "----------------"
 
else
 
	@echo "----------------"
 
	@echo "Have not found a configuration, please run configure first."
 
	@echo "----------------"
 
	@exit 1
 
endif
 

	
 
clean:
 
	@for dir in $(DIRS); do \
Makefile.src.in
Show inline comments
 
@@ -87,25 +87,25 @@ all: $(BIN_DIR)/$(TTD)
 

	
 
$(LANG_OBJS_DIR)/table/strings.h: $(LANG_DIR)/english.txt $(LANG_OBJS_DIR)/$(STRGEN)
 
	$(MAKE) -C $(LANG_OBJS_DIR) table/strings.h
 

	
 
# Always run version detection, so we always have an accurate modified
 
# flag
 
VERSIONS := $(shell AWK="$(AWK)" "$(ROOT_DIR)/findversion.sh")
 
MODIFIED := $(shell echo "$(VERSIONS)" | cut -f 3 -d'	')
 

	
 
ifdef REVISION
 
# Use specified revision (which should be of the form "r000").
 
REV := $(REVISION)
 
REV_NR := $(shell echo $(REVISION) | sed "s/[^0-9]//g")
 
REV_NR := $(shell echo $(REVISION) | sed "s#[^0-9]##g")
 
else
 
# Use autodetected revisions
 
REV      := $(shell echo "$(VERSIONS)" | cut -f 1 -d'	')
 
REV_NR   := $(shell echo "$(VERSIONS)" | cut -f 2 -d'	')
 
endif
 

	
 
# Make sure we have something in REV and REV_NR
 
ifeq ($(REV),)
 
REV := norev000
 
endif
 
ifeq ($(REV_NR),)
 
REV_NR := 0
 
@@ -171,25 +171,25 @@ Makefile.dep: $(FILE_DEP) $(SRCS:%=$(SRC
 
else
 
Makefile.dep: FORCE
 
endif
 
	$(E) '$(STAGE) DEP CHECK (all files)'
 
	$(Q)rm -f Makefile.dep.tmp
 
	$(Q)touch Makefile.dep.tmp
 

	
 
# Calculate the deps via makedepend
 
	$(Q)$(MAKEDEPEND) -f$(SRC_OBJS_DIR)/Makefile.dep.tmp -o.o -Y -v -- $(CFLAGS_MAKEDEP) -- $(SRCS:%=$(SRC_DIR)/%) 2>/dev/null
 

	
 
# Convert x:/... paths to /x/... for mingw
 
ifeq ($(OS), MINGW)
 
	@cat Makefile.dep.tmp | sed 's@\([a-zA-Z]\):\/@\/\1\/@g' > Makefile.dep.tmp.mingw
 
	@cat Makefile.dep.tmp | sed 's#\([a-zA-Z]\):\/#\/\1\/#g' > Makefile.dep.tmp.mingw
 
	@cp Makefile.dep.tmp.mingw Makefile.dep.tmp
 
	@rm -f Makefile.dep.tmp.mingw
 
endif
 

	
 
# Remove all comments and includes that don't start with $(SRC_DIR)
 
# Remove $(SRC_DIR) from object-file-name
 
	@$(AWK) '                           \
 
	/^# DO NOT/ { print $$0 ; next}     \
 
	/^#/ {next}                         \
 
	/:/ {                               \
 
		left = NF - 1;                    \
 
		for (n = 2; n <= NF; n++) {       \
 
@@ -200,25 +200,25 @@ endif
 
		}                                 \
 
		gsub("$(SRC_DIR)/", "", $$1);     \
 
		if (left > 0) {                   \
 
			print $$0;                      \
 
			$$1 = "Makefile.dep:";          \
 
			print $$0;                      \
 
		}                                 \
 
		next                              \
 
	}                                   \
 
	{                                   \
 
		print $$0                         \
 
	}                                   \
 
	' < Makefile.dep.tmp | sed 's/  */ /g;s/ $$//' | $(SORT) > Makefile.dep
 
	' < Makefile.dep.tmp | sed 's#  *# #g;s# $$##' | $(SORT) > Makefile.dep
 

	
 
	$(Q)rm -f Makefile.dep.tmp Makefile.dep.tmp.bak
 

	
 
endif
 

	
 
# Avoid problems with deps if a .h/.hpp file is deleted without the deps
 
#  being updated. Now the Makefile continues, the deps are recreated
 
#  and all will be fine.
 
%.h %.hpp:
 
	@true
 

	
 

	
config.lib
Show inline comments
 
@@ -381,25 +381,25 @@ detect_params() {
 
}
 

	
 
save_params() {
 
	# Here we save all params, so we can later on do an exact redo of this
 
	#  configuration, without having the user to re-input stuff
 

	
 
	echo "Running configure with following options:" >> $config_log
 
	echo "" >> $config_log
 

	
 
	configure="$CONFIGURE_EXECUTABLE --ignore-extra-parameters"
 
	for p in $save_params_array; do
 
		eval "v=\"\$$p\""
 
		p=`echo "$p" | sed 's/_/-/g;s/\n//g;s/ /\\ /g'`
 
		p=`echo "$p" | sed 's#_#-#g;s#\n##g;s# #\\ #g'`
 
		# Only save those params that aren't empty
 
		configure="$configure --$p=\"$v\""
 
	done
 

	
 
	echo "$configure" >> $config_log
 
	echo "$configure" > config.cache
 
	echo "" >> $config_log
 
}
 

	
 
check_params() {
 
	# Some params want to be in full uppercase, else they might not work as
 
	# expected.. fix that here
 
@@ -837,80 +837,80 @@ check_params() {
 

	
 
			sleep 5
 
		fi
 
	fi
 

	
 
	if [ "$doc_dir" = "1" ]; then
 
		if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then
 
			doc_dir="share/doc/openttd"
 
		else
 
			doc_dir="$data_dir/docs"
 
		fi
 
	else
 
		doc_dir="`echo $doc_dir | sed 's/\([^\]\)\\\\ /\1\\\\\\\\ /g;s/\([^\]\) /\1\\\\\\\\ /g'`"
 
		doc_dir="`echo $doc_dir | sed 's#\([^\]\)\\\\ #\1\\\\\\\\ #g;s#\([^\]\) #\1\\\\\\\\ #g'`"
 
	fi
 

	
 
	if [ "$icon_theme_dir" = "1" ]; then
 
		if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then
 
			icon_theme_dir="share/icons/hicolor"
 
		else
 
			icon_theme_dir=""
 
		fi
 
	else
 
		icon_theme_dir="`echo $icon_theme_dir | sed 's/\([^\]\)\\\\ /\1\\\\\\\\ /g;s/\([^\]\) /\1\\\\\\\\ /g'`"
 
		icon_theme_dir="`echo $icon_theme_dir | sed 's#\([^\]\)\\\\ #\1\\\\\\\\ #g;s#\([^\]\) #\1\\\\\\\\ #g'`"
 
	fi
 

	
 
	if [ "$personal_dir" = "1" ]; then
 
		if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ]; then
 
			personal_dir="OpenTTD"
 
		elif [ "$os" = "OSX" ]; then
 
			personal_dir="Documents/OpenTTD"
 
		else
 
			personal_dir=".openttd"
 
		fi
 
	else
 
		personal_dir="`echo $personal_dir | sed 's/\([^\]\)\\\\ /\1\\\\\\\\ /g;s/\([^\]\) /\1\\\\\\\\ /g'`"
 
		personal_dir="`echo $personal_dir | sed 's#\([^\]\)\\\\ #\1\\\\\\\\ #g;s#\([^\]\) #\1\\\\\\\\ #g'`"
 
	fi
 

	
 
	if [ "$shared_dir" = "1" ]; then
 
		# we are using default values
 
		if [ "$os" = "OSX" ]; then
 
			shared_dir="/Library/Application\\\\ Support/OpenTTD"
 
		else
 
			shared_dir=""
 
		fi
 
	else
 
		shared_dir="`echo $shared_dir | sed 's/\([^\]\)\\\\ /\1\\\\\\\\ /g;s/\([^\]\) /\1\\\\\\\\ /g'`"
 
		shared_dir="`echo $shared_dir | sed 's#\([^\]\)\\\\ #\1\\\\\\\\ #g;s#\([^\]\) #\1\\\\\\\\ #g'`"
 
	fi
 

	
 
	if [ "$man_dir" = "1" ]; then
 
		# add manpage on UNIX systems
 
		if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ] || [ "$os" = "OSX" ]; then
 
			man_dir="share/man/man6"
 
		else
 
			man_dir=""
 
		fi
 
	else
 
		man_dir="`echo $man_dir | sed 's/\([^\]\)\\\\ /\1\\\\\\\\ /g;s/\([^\]\) /\1\\\\\\\\ /g'`"
 
		man_dir="`echo $man_dir | sed 's#\([^\]\)\\\\ #\1\\\\\\\\ #g;s#\([^\]\) #\1\\\\\\\\ #g'`"
 
	fi
 

	
 
	if [ "$menu_dir" = "1" ]; then
 
		# add a freedesktop menu item only for some UNIX systems
 
		if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then
 
			menu_dir="share/applications"
 
		else
 
			menu_dir=""
 
		fi
 
	else
 
		menu_dir="`echo $menu_dir | sed 's/\([^\]\)\\\\ /\1\\\\\\\\ /g;s/\([^\]\) /\1\\\\\\\\ /g'`"
 
		menu_dir="`echo $menu_dir | sed 's#\([^\]\)\\\\ #\1\\\\\\\\ #g;s#\([^\]\) #\1\\\\\\\\ #g'`"
 
	fi
 

	
 
	# "set_universal_binary_flags" needs to be before "detect_iconv"
 
	set_universal_binary_flags
 
	detect_iconv
 

	
 
	if [ -n "$personal_dir" ]
 
	then
 
		log 1 "personal home directory... $personal_dir"
 
	else
 
		log 1 "personal home directory... none"
 
	fi
 
@@ -1183,25 +1183,25 @@ make_cflags_and_ldflags() {
 
			LIBS="$LIBS `$png_config --ldflags | tr '\n\r' '  '`"
 
		fi
 
	fi
 

	
 
	if [ -n "$fontconfig_config" ]; then
 
		CFLAGS="$CFLAGS -DWITH_FONTCONFIG"
 
		CFLAGS="$CFLAGS `$fontconfig_config --cflags | tr '\n\r' '  '`"
 

	
 
		if [ "$enable_static" != "0" ]; then
 
			if [ "$os" = "OSX" ]; then
 
				# fontconfig_config goes via pkg-config on all systems, which doesn't know --prefix
 
				# Also, despite the reason we link to the .a file ourself (because we can't use -static), we do need to ask pkg-config about possible other deps
 
				LIBS="$LIBS `$fontconfig_config --variable=prefix`/lib/libfontconfig.a `$fontconfig_config --libs --static | sed s/-lfontconfig//`"
 
				LIBS="$LIBS `$fontconfig_config --variable=prefix`/lib/libfontconfig.a `$fontconfig_config --libs --static | sed s#-lfontconfig##`"
 
			else
 
				LIBS="$LIBS `$fontconfig_config --libs --static | tr '\n\r' '  '`"
 
			fi
 
		else
 
			LIBS="$LIBS `$fontconfig_config --libs | tr '\n\r' '  '`"
 
		fi
 
	fi
 

	
 
	if [ -n "$freetype_config" ]; then
 
		CFLAGS="$CFLAGS -DWITH_FREETYPE"
 
		CFLAGS="$CFLAGS `$freetype_config --cflags | tr '\n\r' '  '`"
 

	
configure
Show inline comments
 
@@ -28,25 +28,25 @@ LANG_OBJS_DIR="$OBJS_DIR/lang"
 
BIN_DIR="$PREFIX"
 
SRC_DIR="$ROOT_DIR/src"
 
LANG_DIR="$SRC_DIR/lang"
 
MEDIA_DIR="$ROOT_DIR/media"
 
SOURCE_LIST="$ROOT_DIR/source.list"
 

	
 
if [ "$1" = "--reconfig" ] || [ "$1" = "--reconfigure" ]; then
 
	if [ ! -f "config.cache" ]; then
 
		echo "can't reconfigure, because never configured before"
 
		exit 1
 
	fi
 
	# Make sure we don't lock config.cache
 
	cat config.cache | sed 's/\\ /\\\\ /g' > cache.tmp
 
	cat config.cache | sed 's#\\ #\\\\ #g' > cache.tmp
 
	sh cache.tmp
 
	rm -f cache.tmp
 
	exit $?
 
fi
 

	
 
set_default
 
detect_params "$@"
 
check_params
 
save_params
 
make_cflags_and_ldflags
 

	
 
EXE=""
findversion.sh
Show inline comments
 
@@ -75,35 +75,35 @@ if [ -d "$ROOT_DIR/.svn" ]; then
 
	if [ -n "$TAG" ]; then
 
		REV=$TAG
 
	else
 
		REV="r$REV_NR"
 
	fi
 
elif [ -d "$ROOT_DIR/.git" ]; then
 
	# We are a git checkout
 
	if [ -n "`git diff-index HEAD \"$SRC_DIR\"`" ]; then
 
		MODIFIED="2"
 
	fi
 
	HASH=`LC_ALL=C git rev-parse --verify HEAD 2>/dev/null | cut -c1-8`
 
	REV="g$HASH"
 
	BRANCH=`git branch|grep '[*]' | sed 's/\* //;s/^master$//'`
 
	REV_NR=`LC_ALL=C git log --pretty=format:%s "$SRC_DIR" | grep "^(svn r[0-9]*)" | head -n 1 | sed "s/.*(svn r\([0-9]*\)).*/\1/"`
 
	BRANCH=`git branch|grep '[*]' | sed 's#\* ##;s#^master$##'`
 
	REV_NR=`LC_ALL=C git log --pretty=format:%s "$SRC_DIR" | grep "^(svn r[0-9]*)" | head -n 1 | sed "s#.*(svn r\([0-9]*\)).*#\1#"`
 
elif [ -d "$ROOT_DIR/.hg" ]; then
 
	# We are a hg checkout
 
	if [ -n "`hg status \"$SRC_DIR\" | grep -v '^?'`" ]; then
 
		MODIFIED="2"
 
	fi
 
	HASH=`LC_ALL=C hg parents 2>/dev/null | head -n 1 | cut -d: -f3 | cut -c1-8`
 
	REV="h$HASH"
 
	BRANCH=`hg branch | sed 's/^default$//'`
 
	REV_NR=`LC_ALL=C hg log -r $HASH:0 -k "svn" -l 1 --template "{desc}\n" "$SRC_DIR" | grep "^(svn r[0-9]*)" | head -n 1 | sed "s/.*(svn r\([0-9]*\)).*/\1/"`
 
	BRANCH=`hg branch | sed 's#^default$##'`
 
	REV_NR=`LC_ALL=C hg log -r $HASH:0 -k "svn" -l 1 --template "{desc}\n" "$SRC_DIR" | grep "^(svn r[0-9]*)" | head -n 1 | sed "s#.*(svn r\([0-9]*\)).*#\1#"`
 
else
 
	# We don't know
 
	MODIFIED="1"
 
	BRANCH=""
 
	REV=""
 
	REV_NR=""
 
fi
 

	
 
if [ "$MODIFIED" -eq "2" ]; then
 
	REV="${REV}M"
 
fi
 

	
0 comments (0 inline, 0 general)