@@ -88,13 +88,13 @@ 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..."
# 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 "Reconfig done. Please re-execute make."
else
@echo "Have not found a configuration, please run configure first."
@@ -17,12 +17,12 @@ AWK = "awk"
ROOT_DIR := $(shell pwd)
BIN_DIR = "$(ROOT_DIR)/bin"
SRC_DIR = "$(ROOT_DIR)/src"
BUNDLE_DIR = "$(ROOT_DIR)/bundle"
BUNDLES_DIR = "$(ROOT_DIR)/bundles"
TTD = "openttd.exe"
TARGET := $(shell echo $(PLATFORM) | sed "s/win64/x64/;s/win32/Win32/")
TARGET := $(shell echo $(PLATFORM) | sed "s~win64~x64~;s~win32~Win32~")
all:
$(Q)cp objs/$(TARGET)/Release/$(TTD) $(BIN_DIR)/$(TTD)
include Makefile.bundle.in
@@ -52,21 +52,21 @@ CFLAGS += -I $(SRC_OBJS_DIR) -I $(LANG_O
ENDIAN_TARGETS := endian_target.h $(ENDIAN_CHECK)
# This 'sed' basicly just removes 'const' from the line if it is a 2+D array
# For more information, please check:
# http://maillist.openttd.org/pipermail/devs/2007-April/000284.html
# http://maillist.openttd.org/pipermail/devs/2007-February/000248.html
GCC295_FIX=sed -r 's/^(\t*)(.*)( const )([A-Za-z0-9_ ]+(\[.*\]){2,})(( = \{)|(;))(.*)$$/\1\2 \4\6\8\9/g'
GCC295_FIX=sed -r 's~^(\t*)(.*)( const )([A-Za-z0-9_ ]+(\[.*\]){2,})(( = \{)|(;))(.*)$$~\1\2 \4\6\8\9~g'
# This 'sed' removes the 3rd '4' in the # lines of the -E output of
# gcc 2.95.3 and lower, as it should indicate that it is a C-linkage, but the
# compiler can't handle that information (just don't ask). So we remove it
# and then it compiles happily and without bitching :)
# Furthermore gcc 2.95 has some trouble with protected and private when
# accessing the protected/private stuff of the enclosing class (or the
# super class of the enclosing class).
GCC295_FIX_2=sed -e 's|\(^\# [0-9][0-9]* "[^"]*"[ 0-9]*\) 4$$|\1|g;s|private:|public:|g;s|protected:|public:|g'
GCC295_FIX_2=sed -e 's~\(^\# [0-9][0-9]* "[^"]*"[ 0-9]*\) 4$$~\1~g;s~private:~public:~g;s~protected:~public:~g'
# Check if we want to show what we are doing
ifdef VERBOSE
Q =
E = @true
@@ -93,13 +93,13 @@ all: $(BIN_DIR)/$(TTD)
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")
# Use autodetected revisions
REV := $(shell echo "$(VERSIONS)" | cut -f 1 -d' ')
REV_NR := $(shell echo "$(VERSIONS)" | cut -f 2 -d' ')
endif
@@ -138,21 +138,21 @@ endif
# Find the deps via GCC. Rarely wrong, but a bit slow
$(OBJS_C:%.o=%.d): %.d: $(SRC_DIR)/%.c $(FILE_DEP)
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.c=%.c)'
$(Q)$(CC_HOST) $(CC_CFLAGS) $(CFLAGS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:%.d=%.o):#' > $@
$(Q)$(CC_HOST) $(CC_CFLAGS) $(CFLAGS) -MM $< | sed 's~^$(@F:%.d=%.o):~$@ $(@:%.d=%.o):~' > $@
$(OBJS_CPP:%.o=%.d): %.d: $(SRC_DIR)/%.cpp $(FILE_DEP)
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.cpp=%.cpp)'
$(Q)$(CXX_HOST) $(CFLAGS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:%.d=%.o):#' > $@
$(Q)$(CXX_HOST) $(CFLAGS) -MM $< | sed 's~^$(@F:%.d=%.o):~$@ $(@:%.d=%.o):~' > $@
$(OBJS_MM:%.o=%.d): %.d: $(SRC_DIR)/%.mm $(FILE_DEP)
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.mm=%.mm)'
$(Q)$(CC_HOST) $(CFLAGS) -MM $< | sed 's#^$(@F:%.d=%.o):#$@ $(@:%.d=%.o):#' > $@
$(Q)$(CC_HOST) $(CFLAGS) -MM $< | sed 's~^$(@F:%.d=%.o):~$@ $(@:%.d=%.o):~' > $@
$(OBJS_RC:%.o=%.d): %.d: $(SRC_DIR)/%.rc $(FILE_DEP)
$(Q)touch $@
@@ -177,13 +177,13 @@ endif
# 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
# Remove all comments and includes that don't start with $(SRC_DIR)
# Remove $(SRC_DIR) from object-file-name
@@ -206,13 +206,13 @@ endif
} \
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
# Avoid problems with deps if a .h/.hpp file is deleted without the deps
@@ -271,16 +271,16 @@ endian_target.h: $(ENDIAN_CHECK) $(CONFI
$(E) '$(STAGE) Compiling and Linking $@'
$(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $< -o $@
# Revision files
$(SRC_DIR)/rev.cpp: $(CONFIG_CACHE_VERSION) $(SRC_DIR)/rev.cpp.in
$(Q)cat $(SRC_DIR)/rev.cpp.in | sed "s#@@REVISION@@#$(REV_NR)#g;s#@@VERSION@@#$(REV)#g;s#@@MODIFIED@@#$(MODIFIED)#g;s#@@DATE@@#`date +%d.%m.%y`#g" > $(SRC_DIR)/rev.cpp
$(Q)cat $(SRC_DIR)/rev.cpp.in | sed "s~@@REVISION@@~$(REV_NR)~g;s~@@VERSION@@~$(REV)~g;s~@@MODIFIED@@~$(MODIFIED)~g;s~@@DATE@@~`date +%d.%m.%y`~g" > $(SRC_DIR)/rev.cpp
$(SRC_DIR)/ottdres.rc: $(CONFIG_CACHE_VERSION) $(SRC_DIR)/ottdres.rc.in
$(Q)cat $(SRC_DIR)/ottdres.rc.in | sed "s#@@REVISION@@#$(REV_NR)#g;s#@@VERSION@@#$(REV)#g;s#@@DATE@@#`date +%d.%m.%y`#g" > $(SRC_DIR)/ottdres.rc
$(Q)cat $(SRC_DIR)/ottdres.rc.in | sed "s~@@REVISION@@~$(REV_NR)~g;s~@@VERSION@@~$(REV)~g;s~@@DATE@@~`date +%d.%m.%y`~g" > $(SRC_DIR)/ottdres.rc
FORCE:
depend: $(DEPS)
clean:
@@ -387,13 +387,13 @@ save_params() {
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
@@ -843,68 +843,68 @@ check_params() {
if [ "$os" = "UNIX" ] || [ "$os" = "FREEBSD" ] || [ "$os" = "OPENBSD" ] || [ "$os" = "NETBSD" ] || [ "$os" = "HPUX" ] || [ "$os" = "SUNOS" ]; then
doc_dir="share/doc/openttd"
doc_dir="$data_dir/docs"
fi
doc_dir="`echo $doc_dir | sed 's#\([^\]\)\\\\ #\1\\\\\\\\ #g;s#\([^\]\) #\1\\\\\\\\ #g'`"
doc_dir="`echo $doc_dir | sed 's~\([^\]\)\\\\ ~\1\\\\\\\\ ~g;s~\([^\]\) ~\1\\\\\\\\ ~g'`"
if [ "$icon_theme_dir" = "1" ]; then
icon_theme_dir="share/icons/hicolor"
icon_theme_dir=""
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'`"
if [ "$personal_dir" = "1" ]; then
if [ "$os" = "MINGW" ] || [ "$os" = "CYGWIN" ] || [ "$os" = "WINCE" ]; then
personal_dir="OpenTTD"
elif [ "$os" = "OSX" ]; then
personal_dir="Documents/OpenTTD"
personal_dir=".openttd"
personal_dir="`echo $personal_dir | sed 's#\([^\]\)\\\\ #\1\\\\\\\\ #g;s#\([^\]\) #\1\\\\\\\\ #g'`"
personal_dir="`echo $personal_dir | sed 's~\([^\]\)\\\\ ~\1\\\\\\\\ ~g;s~\([^\]\) ~\1\\\\\\\\ ~g'`"
if [ "$shared_dir" = "1" ]; then
# we are using default values
if [ "$os" = "OSX" ]; then
shared_dir="/Library/Application\\\\ Support/OpenTTD"
shared_dir=""
shared_dir="`echo $shared_dir | sed 's#\([^\]\)\\\\ #\1\\\\\\\\ #g;s#\([^\]\) #\1\\\\\\\\ #g'`"
shared_dir="`echo $shared_dir | sed 's~\([^\]\)\\\\ ~\1\\\\\\\\ ~g;s~\([^\]\) ~\1\\\\\\\\ ~g'`"
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"
man_dir=""
man_dir="`echo $man_dir | sed 's#\([^\]\)\\\\ #\1\\\\\\\\ #g;s#\([^\]\) #\1\\\\\\\\ #g'`"
man_dir="`echo $man_dir | sed 's~\([^\]\)\\\\ ~\1\\\\\\\\ ~g;s~\([^\]\) ~\1\\\\\\\\ ~g'`"
if [ "$menu_dir" = "1" ]; then
# add a freedesktop menu item only for some UNIX systems
menu_dir="share/applications"
menu_dir=""
menu_dir="`echo $menu_dir | sed 's#\([^\]\)\\\\ #\1\\\\\\\\ #g;s#\([^\]\) #\1\\\\\\\\ #g'`"
menu_dir="`echo $menu_dir | sed 's~\([^\]\)\\\\ ~\1\\\\\\\\ ~g;s~\([^\]\) ~\1\\\\\\\\ ~g'`"
# "set_universal_binary_flags" needs to be before "detect_iconv"
set_universal_binary_flags
detect_iconv
@@ -1189,13 +1189,13 @@ make_cflags_and_ldflags() {
CFLAGS="$CFLAGS `$fontconfig_config --cflags | tr '\n\r' ' '`"
if [ "$enable_static" != "0" ]; 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~~`"
LIBS="$LIBS `$fontconfig_config --libs --static | tr '\n\r' ' '`"
LIBS="$LIBS `$fontconfig_config --libs | tr '\n\r' ' '`"
@@ -1315,13 +1315,13 @@ make_cflags_and_ldflags() {
# so convert it to: -isysroot -OSX/blabla. makedepend just ignores
# any - command it doesn't know, so we are pretty save.
# Lovely hackish, not?
# Btw, this almost always comes from outside the configure, so it is
# not something we can control.
if [ "$with_makedepend" != "0" ]; then
cflags_makedep="` echo "$CFLAGS" | sed 's# /# -#g'`"
cflags_makedep="` echo "$CFLAGS" | sed 's~ /~ -~g'`"
makedepend=""
if [ "$with_distcc" != "0" ]; then
cc_host="$distcc $cc_host"
@@ -2276,70 +2276,70 @@ make_sed() {
# All the data needed to compile a single target
# Make sure if you compile multiple targets to
# use multiple OBJS_DIR, because all in-between
# binaries are stored in there, and nowhere else.
SRC_REPLACE="
s#!!CC_HOST!!#$cc_host#g;
s#!!CXX_HOST!!#$cxx_host#g;
s#!!CC_BUILD!!#$cc_build#g;
s#!!CXX_BUILD!!#$cxx_build#g;
s#!!WINDRES!!#$windres#g;
s#!!STRIP!!#$strip $strip_arg#g;
s#!!LIPO!!#$lipo#g;
s#!!CC_CFLAGS!!#$CC_CFLAGS#g;
s#!!CFLAGS!!#$T_CFLAGS#g;
s#!!CFLAGS_BUILD!!#$CFLAGS_BUILD#g;
s#!!STRGEN_FLAGS!!#$strgen_flags#g;
s#!!LIBS!!#$LIBS#g;
s#!!LDFLAGS!!#$T_LDFLAGS#g;
s#!!BIN_DIR!!#$BIN_DIR#g;
s#!!ROOT_DIR!!#$ROOT_DIR#g;
s#!!MEDIA_DIR!!#$MEDIA_DIR#g;
s#!!SOURCE_LIST!!#$SOURCE_LIST#g;
s#!!SRC_OBJS_DIR!!#$SRC_OBJS_DIR#g;
s#!!LANG_OBJS_DIR!!#$LANG_OBJS_DIR#g;
s#!!SRC_DIR!!#$SRC_DIR#g;
s#!!OSXAPP!!#$OSXAPP#g;
s#!!LANG_DIR!!#$LANG_DIR#g;
s#!!TTD!!#$TTD#g;
s#!!BINARY_DIR!!#$prefix_dir/$binary_dir#g;
s#!!DATA_DIR!!#$prefix_dir/$data_dir#g;
s#!!DOC_DIR!!#$prefix_dir/$doc_dir#g;
s#!!MAN_DIR!!#$prefix_dir/$man_dir#g;
s#!!ICON_DIR!!#$prefix_dir/$icon_dir#g;
s#!!ICON_THEME_DIR!!#$prefix_dir/$icon_theme_dir#g;
s#!!PERSONAL_DIR!!#$personal_dir#g;
s#!!SHARED_DIR!!#$shared_dir#g;
s#!!INSTALL_DIR!!#$install_dir#g;
s#!!STRGEN!!#$STRGEN#g;
s#!!ENDIAN_CHECK!!#$ENDIAN_CHECK#g;
s#!!ENDIAN_FORCE!!#$endian#g;
s#!!STAGE!!#$STAGE#g;
s#!!MAKEDEPEND!!#$makedepend#g;
s#!!CFLAGS_MAKEDEP!!#$cflags_makedep#g;
s#!!SORT!!#$sort#g;
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;
s#!!OS!!#$os#g;
s#!!CONFIGURE_FILES!!#$CONFIGURE_FILES#g;
s#!!REVISION!!#$revision#g;
s#!!AWK!!#$awk#g;
s#!!GCC295!!#$gcc295#g;
s#!!DISTCC!!#$distcc#g;
s~!!CC_HOST!!~$cc_host~g;
s~!!CXX_HOST!!~$cxx_host~g;
s~!!CC_BUILD!!~$cc_build~g;
s~!!CXX_BUILD!!~$cxx_build~g;
s~!!WINDRES!!~$windres~g;
s~!!STRIP!!~$strip $strip_arg~g;
s~!!LIPO!!~$lipo~g;
s~!!CC_CFLAGS!!~$CC_CFLAGS~g;
s~!!CFLAGS!!~$T_CFLAGS~g;
s~!!CFLAGS_BUILD!!~$CFLAGS_BUILD~g;
s~!!STRGEN_FLAGS!!~$strgen_flags~g;
s~!!LIBS!!~$LIBS~g;
s~!!LDFLAGS!!~$T_LDFLAGS~g;
s~!!BIN_DIR!!~$BIN_DIR~g;
s~!!ROOT_DIR!!~$ROOT_DIR~g;
s~!!MEDIA_DIR!!~$MEDIA_DIR~g;
s~!!SOURCE_LIST!!~$SOURCE_LIST~g;
s~!!SRC_OBJS_DIR!!~$SRC_OBJS_DIR~g;
s~!!LANG_OBJS_DIR!!~$LANG_OBJS_DIR~g;
s~!!SRC_DIR!!~$SRC_DIR~g;
s~!!OSXAPP!!~$OSXAPP~g;
s~!!LANG_DIR!!~$LANG_DIR~g;
s~!!TTD!!~$TTD~g;
s~!!BINARY_DIR!!~$prefix_dir/$binary_dir~g;
s~!!DATA_DIR!!~$prefix_dir/$data_dir~g;
s~!!DOC_DIR!!~$prefix_dir/$doc_dir~g;
s~!!MAN_DIR!!~$prefix_dir/$man_dir~g;
s~!!ICON_DIR!!~$prefix_dir/$icon_dir~g;
s~!!ICON_THEME_DIR!!~$prefix_dir/$icon_theme_dir~g;
s~!!PERSONAL_DIR!!~$personal_dir~g;
s~!!SHARED_DIR!!~$shared_dir~g;
s~!!INSTALL_DIR!!~$install_dir~g;
s~!!STRGEN!!~$STRGEN~g;
s~!!ENDIAN_CHECK!!~$ENDIAN_CHECK~g;
s~!!ENDIAN_FORCE!!~$endian~g;
s~!!STAGE!!~$STAGE~g;
s~!!MAKEDEPEND!!~$makedepend~g;
s~!!CFLAGS_MAKEDEP!!~$cflags_makedep~g;
s~!!SORT!!~$sort~g;
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;
s~!!OS!!~$os~g;
s~!!CONFIGURE_FILES!!~$CONFIGURE_FILES~g;
s~!!REVISION!!~$revision~g;
s~!!AWK!!~$awk~g;
s~!!GCC295!!~$gcc295~g;
s~!!DISTCC!!~$distcc~g;
"
if [ "$icon_theme_dir" != "" ]; then
SRC_REPLACE="$SRC_REPLACE
@@ -2369,14 +2369,14 @@ make_sed() {
}
generate_menu_item() {
MENU_REPLACE="
s#!!MENU_GROUP!!#$menu_group#g
s~!!MENU_GROUP!!~$menu_group~g
echo "Generating menu item..."
mkdir -p media
< $ROOT_DIR/media/openttd.desktop.in sed "$MENU_REPLACE" > media/openttd.desktop
@@ -34,13 +34,13 @@ 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
cat config.cache | sed 's#\\ #\\\\ #g' > cache.tmp
cat config.cache | sed 's~\\ ~\\\\ ~g' > cache.tmp
sh cache.tmp
rm -f cache.tmp
exit $?
set_default
@@ -56,13 +56,13 @@ fi
TTD="openttd$EXE"
STRGEN="strgen$EXE"
ENDIAN_CHECK="endian_check$EXE"
if [ -z "$sort" ]; then
PIPE_SORT="sed s/a/a/"
PIPE_SORT="sed s~a~a~"
PIPE_SORT="$sort"
if [ ! -f "$LANG_DIR/english.txt" ]; then
echo "Languages not found in $LANG_DIR. Can't continue without it."
@@ -120,13 +120,13 @@ OBJS_CPP="`echo \"$SRCS\" | $awk ' { ORS
OBJS_MM="` echo \"$SRCS\" | $awk ' { ORS = " " } /\.mm$/ { gsub(".mm$", ".o", $0); print $0; }'`"
OBJS_RC="` echo \"$SRCS\" | $awk ' { ORS = " " } /\.rc$/ { gsub(".rc$", ".o", $0); print $0; }'`"
SRCS="` echo \"$SRCS\" | $awk ' { ORS = " " } { print $0; }'`"
# In makefiles, we always use -u for sort
sort="sed s/a/a/"
sort="sed s~a~a~"
sort="$sort -u"
CONFIGURE_FILES="$ROOT_DIR/configure $ROOT_DIR/config.lib $ROOT_DIR/Makefile.in $ROOT_DIR/Makefile.lang.in $ROOT_DIR/Makefile.src.in"
@@ -81,23 +81,23 @@ elif [ -d "$ROOT_DIR/.git" ]; then
# We are a git checkout
if [ -n "`git diff-index HEAD \"$SRC_DIR\"`" ]; then
MODIFIED="2"
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
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~"`
# We don't know
MODIFIED="1"
BRANCH=""
REV=""
REV_NR=""
@@ -53,13 +53,13 @@ safety_check() {
li="$i"
grep '\.h' "$ROOT_DIR/source.list" | grep -v '../objs/langs/table/strings.h' | sort > tmp.headers.source.list
find "$ROOT_DIR/src" \( -iname "*.h" -or -iname "*.hpp" \) -and -not -ipath "*/.svn/*" | sed "s@$ROOT_DIR/src/@@" | sort > tmp.headers.src
find "$ROOT_DIR/src" \( -iname "*.h" -or -iname "*.hpp" \) -and -not -ipath "*/.svn/*" | sed "s~$ROOT_DIR/src/~~" | sort > tmp.headers.src
if [ -n "`diff tmp.headers.source.list tmp.headers.src`" ]; then
echo "The following headers are missing in source.list and not in /src/ or vice versa."
diff tmp.headers.source.list tmp.headers.src | grep '[<>]' | sort
echo ""
rm tmp.headers.*
@@ -135,13 +135,13 @@ load_main_data() {
load_lang_data() {
RES=""
for i in `ls $1`
do
i=`basename $i | sed s/.txt$//g`
i=`basename $i | sed s~.txt$~~g`
RES="$RES
<File
RelativePath=\"..\\src\\lang\\"$i".txt\"
>
<FileConfiguration
Name=\"Debug|Win32\"
Status change: