Changeset - r180:f8588315108d
[Not reviewed]
master
0 2 0
bjarni - 20 years ago 2004-09-08 09:07:18
bjarni@openttd.org
(svn r181) Makefile: enabled ability to supress output of missing strings in lng files
Makefile: added versiontag for autoupdate of outdated makefile.config files
2 files changed with 16 insertions and 10 deletions:
0 comments (0 inline, 0 general)
Makefile
Show inline comments
 
@@ -60,105 +60,108 @@
 
# RELEASE: this will be the released version number. It replaces all places
 
#          where it normally would print the revision number
 
# MIDI: if set, it will use it as custom path to midi player. 
 
#  If unset, it will use the hardcoded path in the c code
 
# NOVERBOSE: supress all warnings and errors during compilation. 
 
#  It looks nicer, but you will not know what went wrong. Use it on released (stable) sources only
 
#
 
# DATA_DIR_PREFIX: This sets the dir OpenTTD looks for the needed files. 
 
#   MUST END WITH / if defined
 
#
 
# STATIC: link statically
 
# CYGWIN: build in Cygwin environment
 
# MINGW: build with MingW compiler, link with MingW libraries
 
#
 
# Experimental (does not work properly):
 
# WITH_NETWORK: enable networking
 
# WITH_DIRECTMUSIC: enable DirectMusic MIDI support
 

	
 

	
 
##############################################################################
 
#
 
# Configuration
 
#
 

	
 
# Makefile version tag
 
# it checks if the version tag in makefile.config is the same and force update outdated config files
 
MAKEFILE_VERSION:=1
 

	
 
# CONFIG_WRITER have to be found even for manual configuration
 
CONFIG_WRITER=makefiledir/Makefile.config_writer
 

	
 
ifndef MANUAL_CONFIG
 
# Automatic configuration
 
MAKE_CONFIG:=Makefile.config
 
MAKEFILE:=Makefile
 
LIB_DETECTION=makefiledir/Makefile.libdetection
 
CONFIG_WRITER=makefiledir/Makefile.config_writer
 

	
 
# Apply automatic configuration
 
# See target section for how this is built, suppress errors
 
# since first time it isn't found but make reads this twice
 
-include $(MAKE_CONFIG)
 
else
 
CONFIG_INCLUDED:=1
 
endif
 

	
 
# tests if makefile.config contains the new needed SDL-CONFIG
 
# it updates makefile.config if needed. Flags like ENABLE_NETWORK are remembered
 
ifndef SDL-CONFIG
 
ifdef WITH_SDL
 
ifndef MANUAL_CONFIG
 
#network is enabled by default
 
ENABLE_NETWORK:=1
 
# updates makefile.config if it's outdated
 
ifneq ($(MAKEFILE_VERSION),$(CONFIG_VERSION))
 
UPDATECONFIG:=upgradeconf
 
CONFIG_INCLUDED:=
 
else
 
# this should define SDL-CONFIG for manual configuration
 
ifeq ($(shell uname),FreeBSD)
 
SDL-CONFIG:=sdl11-config
 
else
 
SDL-CONFIG:=sdl-config
 
endif
 
endif
 
endif
 
endif
 

	
 
ifndef CONFIG_INCLUDED
 
-include $(LIB_DETECTION)
 
endif
 

	
 
# Verbose filter
 

	
 
ifdef NOVERBOSE
 
VERBOSE_FILTER =  >/dev/null 2>&1 
 
else
 
VERBOSE_FILTER = 
 
endif
 

	
 
ifdef DISPLAY_WARNINGS
 
WARNING_DISPLAY:=-fstrict-aliasing
 
VERBOSE_FILTER =  
 
else
 
WARNING_DISPLAY:=-fno-strict-aliasing
 
endif
 

	
 
ifdef SUPRESS_LANG_ERRORS
 
ifndef VERBOSE_FILTER
 
LANG_ERRORS =  >/dev/null 2>&1
 
endif
 
endif
 

	
 
ifdef STATIC
 
ifndef WIN32
 
ifndef OSX
 
ifndef MORPHOS
 
ifndef SKIP_STATIC_CHECK
 
$(error Static is only known to work on MorphOS and MacOSX!!! --- Check makefile.config for more info and howto bypass this check)
 
endif
 
endif
 
endif
 
endif
 
endif
 

	
 

	
 
# Force SDL on UNIX platforms
 
ifndef WITH_SDL
 
ifdef UNIX
 
$(error You need to have SDL installed in order to run OpenTTD on UNIX.)
 
endif
 
endif
 

	
 

	
 

	
 
##############################################################################
 
#
 
@@ -525,49 +528,49 @@ endian.h: $(ENDIAN_CHECK)
 
	@cp os/macos/track_starter $(OSXAPP)/contents/macos
 
	@ls os/macos | grep -q "\.class" || \
 
	javac os/macos/OpenTTDMidi.java
 
	@cp os/macos/OpenTTDMidi.class $(OSXAPP)/contents/macos
 
	@cp $(TTD) $(OSXAPP)/Contents/MacOS/$(TTD)
 

	
 
$(endwarnings): $(64_bit_warnings)
 

	
 
$(64_bit_warnings):
 
	$(warning 64 bit CPUs will get some 64 bit specific bugs!)
 
	$(warning If you see any bugs, include in your bug report that you use a 64 bit CPU)
 

	
 
$(STRGEN): strgen/strgen.c rev.o
 
	@echo 'Compiling and Linking $@'; \
 
		$(CC) $(BASECFLAGS) $(CDEFS) -o $@ $^ $(VERBOSE_FILTER)
 

	
 
lang/english.lng: lang/english.txt $(STRGEN)
 
	@echo 'Generating $@'; \
 
	$(STRGEN)
 
	
 
table/strings.h: lang/english.lng
 

	
 
lang/%.lng: lang/%.txt $(STRGEN)
 
	@echo 'Generating $@'; \
 
	$(STRGEN) $(STRGEN_FLAGS) $< $(VERBOSE_FILTER)
 
	$(STRGEN) $(STRGEN_FLAGS) $< $(VERBOSE_FILTER) $(LANG_ERRORS)
 

	
 
winres.o: ttd.rc
 
	windres -o $@ $<
 

	
 

	
 
rev.c: FORCE
 
	@# setting the revision number in a place, there the binary can read it
 
	@echo 'const char _openttd_revision[] = "'$(REV)'";' >>rev.c.new
 
	@echo 'const int _revision_number = $(REV_NUMBER);' >>rev.c.new
 
	@# some additions for MorphOS versions tag
 
	@echo '#ifdef __MORPHOS__'  >>rev.c.new
 
	@echo 'const char morphos_versions_tag[] = "\\0$$VER: OpenTTD '$(REV)' ('${BUILDDATE}') © OpenTTD Team [MorphOS, PowerPC]";'  >>rev.c.new
 
	@echo '#endif' >>rev.c.new
 
	@# Only update the real rev.c if it actually changed, to prevent
 
	@# useless rebuilds.
 
	@cmp -s rev.c rev.c.new 2>/dev/null || mv rev.c.new rev.c
 
	@rm -f rev.c.new
 

	
 
FORCE:
 

	
 

	
 
# ttd$(EXE) is removed just to make sure people execute the right binary (openttd$(EXE))
 
# remove this for next release!
 
clean:
makefiledir/Makefile.config_writer
Show inline comments
 
# This file generates Makefile.config
 
# Create default config from autodetected values
 
# Magic at work, note that you can't use commas in arguments for this
 
CONFIG_LINE=@$(SHELL) -c 'echo $(1)' >> $(MAKE_CONFIG) 2> /dev/null
 

	
 
$(MAKE_CONFIG):	
 
	
 
	touch $(MAKE_CONFIG)
 
	
 
	$(call CONFIG_LINE,\# OpenTTD config file for makefile)	
 
	$(call CONFIG_LINE,\# Set your options here - 1 for use and empty for disable)
 
	$(call CONFIG_LINE,)
 
	
 
	$(call CONFIG_LINE,\# User setup flags)
 
	$(call CONFIG_LINE,\# Translator: adds TODO to any untranslated strings)
 
	$(call CONFIG_LINE,\# Display_Warnings: when off it hides some warnings while compiling)
 
	$(call CONFIG_LINE,\# MIDI: sets path to midi player)
 
	$(call CONFIG_LINE,\# MIDI_ARG: sets an argument which is used when calling the midi player. Default off)
 
	$(call CONFIG_LINE,\# SUPRESS_LANG_ERRORS: supresses output about missing and mismatched strings)
 
	$(call CONFIG_LINE,STATIC:=$(STATIC))
 
	$(call CONFIG_LINE,TRANSLATOR:=$(TRANSLATOR))
 
	$(call CONFIG_LINE,DISPLAY_WARNINGS:=$(DISPLAY_WARNINGS))
 
	$(call CONFIG_LINE,DEBUG:=$(DEBUG))
 
	$(call CONFIG_LINE,PROFILE:=$(PROFILE))
 
	$(call CONFIG_LINE,MIDI:=$(MIDI))
 
	$(call CONFIG_LINE,MIDI_ARG:=$(MIDI_ARG))
 
	$(call CONFIG_LINE,SUPRESS_LANG_ERRORS:=$(SUPRESS_LANG_ERRORS))
 
	$(call CONFIG_LINE,)
 
	
 
	$(call CONFIG_LINE,\# DATA_DIR_PREFIX is the path to OpenTTD. It can be absolute or relative)
 
	$(call CONFIG_LINE,\# USE_HOMEDIR sets \~/ in front of DATA_DIR_PREFIX so it uses the homedir)
 
	$(call CONFIG_LINE,\# do not type \~/ yourself because that will not work)
 
	$(call CONFIG_LINE,\# Folders should end with /)
 
	$(call CONFIG_LINE,BINARY_DIR:=$(BINARY_DIR))
 
	$(call CONFIG_LINE,INSTALL_DIR:=$(INSTALL_DIR))
 
	$(call CONFIG_LINE,USE_HOMEDIR:=$(USE_HOMEDIR))
 
	$(call CONFIG_LINE,GAME_DATA_DIR:=$(GAME_DATA_DIR))
 
	$(call CONFIG_LINE,PERSONAL_DIR:=$(PERSONAL_DIR))
 
	$(call CONFIG_LINE,)
 
	
 
	$(call CONFIG_LINE,\# Experimental)
 
	$(call CONFIG_LINE,WITH_NETWORK:=$(WITH_NETWORK))
 
	$(call CONFIG_LINE,WITH_DIRECTMUSIC:=$(WITH_DIRECTMUSIC))
 
	$(call CONFIG_LINE,)
 
	$(call CONFIG_LINE,)
 

	
 
	$(call CONFIG_LINE,\# Flag to skip test for OS when building static)
 
	$(call CONFIG_LINE,\# OpenTTD have only been succesfully tested with static builds on MorphOS and MacOSX)
 
	$(call CONFIG_LINE,\# If you want to try anyway on other OSes, set this flag)
 
	$(call CONFIG_LINE,\# Inform us if you have success)
 
	$(call CONFIG_LINE,SKIP_STATIC_CHECK:=$(SKIP_STATIC_CHECK))
 
@@ -58,24 +60,25 @@ CONFIG_LINE=@$(SHELL) -c 'echo $(1)' >> 
 
	$(call CONFIG_LINE,\# That info could be where the missing lib is placed)
 
	$(call CONFIG_LINE,)	
 
	
 
	$(call CONFIG_LINE,\# Libs)
 
	$(call CONFIG_LINE,WITH_ZLIB:=$(WITH_ZLIB))
 
	$(call CONFIG_LINE,WITH_SDL:=$(WITH_SDL))
 
	$(call CONFIG_LINE,WITH_PNG:=$(WITH_PNG))
 
	$(call CONFIG_LINE,STATIC_ZLIB_PATH:=$(STATIC_ZLIB_PATH))
 
	$(call CONFIG_LINE,)
 
	
 
	$(call CONFIG_LINE,\# OS flags)
 
	$(call CONFIG_LINE,WIN32:=$(WIN32))
 
	$(call CONFIG_LINE,UNIX:=$(UNIX))
 
	$(call CONFIG_LINE,OSX:=$(OSX))
 
	$(call CONFIG_LINE,FREEBSD:=$(FREEBSD))
 
	$(call CONFIG_LINE,MORPHOS:=$(MORPHOS))
 
	$(call CONFIG_LINE,CYGWIN:=$(CYGWIN))
 
	$(call CONFIG_LINE,MINGW:=$(MINGW))
 
	$(call CONFIG_LINE,)	
 
	
 
	$(call CONFIG_LINE,\# misc)
 
	$(call CONFIG_LINE,SDL-CONFIG:=$(SDL-CONFIG))
 
	$(call CONFIG_LINE,CONFIG_INCLUDED:=yes)
 
	$(call CONFIG_LINE,PATH_SET:=$(PATH_SET))
 
	$(call CONFIG_LINE,CONFIG_VERSION:=$(MAKEFILE_VERSION))
0 comments (0 inline, 0 general)