Makefile
author tron
Mon, 17 Jan 2005 13:21:10 +0000
changeset 1052 53e669371277
parent 1051 c56a3ce9b64f
child 1069 922f5c7be173
permissions -rw-r--r--
(svn r1553) Check which gcc version is present and only set availible compiler flags
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     1
# This Makefile is partially based on "a completely generic Makefile",
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     2
# originally created by Justin Husted <husted@cs>
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     3
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     4
# Rewrite and sane dependencies support by Petr Baudis <pasky@ucw.cz>
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     5
# Cygwin support and configuration by Jaen Saul <slowbyte@hot.ee>
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     6
# A lot of modifications by Bjarni Corfitzen <bjarni@openttd.com>
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     7
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     8
# Last modified by: $Author: strigeus $
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     9
# On: $Date: 2004/03/11 19:15:06 $
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    10
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    11
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    12
##############################################################################
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    13
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    14
# Usage
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    15
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    16
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    17
# Synopsis:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    18
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    19
# make WITH_ZLIB=1 UNIX=1 MANUAL_CONFIG=1
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    20
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    21
# (See below for the list of possible options.)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    22
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    23
# Alternately, you can run make without the MANUAL_CONFIG part. It then
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    24
# generates Makefile.config, where you can customize all the options.
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    25
# However beware that for all subsequent calls the option values from
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    26
# Makefile.config take precedence to the commandline options.
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    27
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    28
# (That means that you probably want to either specify the options on command
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    29
# line together with MANUAL_CONFIG=1 or you want to specify no commandline
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    30
# options at all.)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    31
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    32
# Targets:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    33
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    34
# Defaults to building binary
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    35
# clean: remove intermediate build files
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    36
# mrproper: remove intermediate files and makefile configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    37
# upgradeconf: add new options to old Makefile.config
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    38
# osx: OS X application
563
f60fe5a7d56f (svn r972) Makefile: added make release (currently only works on mac)
bjarni
parents: 561
diff changeset
    39
# release: used by OSX to make a dmg file ready to release
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    40
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    41
# Options:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    42
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    43
# Summary of OS choice defines
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    44
# WIN32: building on Windows
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    45
# UNIX: building on *nix derivate (Linux, FreeBSD)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    46
# OSX: building on Mac OS X
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    47
# MORPHOS: building on MorphOS
421
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
    48
# BEOS: building on BeOS
446
20304ea8e94e (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
    49
# SUNOS: building on SunOS (Solaris)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    50
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    51
# Summary of library choice defines
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    52
# WITH_ZLIB: savegames using zlib
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    53
# WITH_PNG: screenshots using PNG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    54
# WITH_SDL: SDL video driver support
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    55
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    56
# Summary of other defines:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    57
# MANUAL_CONFIG: do not use Makefile.config, config options set manually
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    58
# DEBUG: build in debug mode
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    59
# PROFILE: build in profile mode, disables -s and -fomit-frame-pointer
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    60
# DISPLAY_WARNINGS: when off, some errors are not displayed while compiling
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    61
# TRANSLATOR: build in translator mode (untranslated strings are prepended by
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    62
#             a <TODO> mark)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    63
# RELEASE: this will be the released version number. It replaces all places
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    64
#          where it normally would print the revision number
222
b88456001397 (svn r223) -Fix: Const correctness and miscellaneous fixes. Thank you Tron for your diligent fixing of warnings (and some possibly bugs) (Tron)
darkvater
parents: 221
diff changeset
    65
# MIDI: if set, it will use it as custom path to midi player.
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    66
#  If unset, it will use the hardcoded path in the c code
222
b88456001397 (svn r223) -Fix: Const correctness and miscellaneous fixes. Thank you Tron for your diligent fixing of warnings (and some possibly bugs) (Tron)
darkvater
parents: 221
diff changeset
    67
# NOVERBOSE: supress all warnings and errors during compilation.
162
565551f829e9 (svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents: 157
diff changeset
    68
#  It looks nicer, but you will not know what went wrong. Use it on released (stable) sources only
462
b995527cb51c (svn r681) Support for VERBOSE configuration variable which shows the commands actually used for compilation.
pasky
parents: 452
diff changeset
    69
# VERBOSE: actually show the commands used for compilation.
804
06aaddf6742b (svn r1274) Makefile: networking is not longer experimental
bjarni
parents: 798
diff changeset
    70
# WITH_NETWORK: enable networking
06aaddf6742b (svn r1274) Makefile: networking is not longer experimental
bjarni
parents: 798
diff changeset
    71
# DEDICATED: allows compilation on UNIX without SDL. Useful for dedicated servers
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    72
#
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    73
# Paths:
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    74
# INSTALL: If not set, the game uses the directory of the binary to
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
    75
# store everything (lang, data, gm, save and openttd.cfg), this is the `old' behaviour.
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    76
# In this case, none of the following paths are used, you also should _not_
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    77
# use `make install', but copy the required stuff yourself (or just play out
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    78
# of you source directory, which should work fine).
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    79
# If you want to use `make install' to install the game globally, you should
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    80
# define it _before_ you build the game. If you only define INSTALL when you
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    81
# do `make install', the game won't be able to find it's files (so you should
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    82
# also define all the following paths before building).
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    83
#
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    84
# So, the following paths should be defined if INSTALL is defined.
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    85
# None of these paths have to end with /
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    86
# PREFIX:	Normally /usr/local
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    87
# BINARY_DIR:	The location of the binary, normally games. (Will be prefixed
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    88
#		with $PREFIX)
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
    89
# DATA_DIR: 	The location of the data (lang, data and gm), normally
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    90
#		share/games/openttd. (Will be prefixed with $PREFIX)
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    91
# PERSONAL_DIR:	The directory where openttd.cfg and the save folder will be
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    92
#		stored. You cannot use ~ here, define USE_HOMEDIR for that.
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    93
# USE_HOMEDIR:	If this variable is set, PERSONAL_DIR will be prefixed with
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    94
#		~/ at runtime (the user's homedir)
561
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
    95
# SECOND_DATA_PATH  Use this data dir if a file is not found in the data dir in the data path
944
c97b49017d13 (svn r1432) -Fix: I seem to be unable to revert a simple file :s
truelight
parents: 943
diff changeset
    96
# CUSTOM_LANG_PATH  If this is set, it will use the path given to search for lng files 
561
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
    97
#		instead of the lang dir in the data path
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
    98
#   NOTE: both SECOND_DATA_PATH and CUSTOM_LANG_PATH uses paths relative to where OTTD is opened
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    99
#
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   100
# DEST_DIR:	make install will use this directory instead of the filesystem
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   101
# 		root to install its files. This should normally not be used by
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   102
# 		ordinary users, currently it is only used for the debian
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   103
# 		packaging. This value should only be set when calling `make
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   104
# 		install' and is not saved in Makefile.config
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   105
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   106
# STATIC: link statically
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   107
# CYGWIN: build in Cygwin environment
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   108
# MINGW: build with MingW compiler, link with MingW libraries
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   109
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   110
# Experimental (does not work properly):
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   111
# WITH_DIRECTMUSIC: enable DirectMusic MIDI support
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   112
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   113
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   114
##############################################################################
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   115
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   116
# Configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   117
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   118
180
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   119
# Makefile version tag
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   120
# it checks if the version tag in makefile.config is the same and force update outdated config files
804
06aaddf6742b (svn r1274) Makefile: networking is not longer experimental
bjarni
parents: 798
diff changeset
   121
MAKEFILE_VERSION:=6
180
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   122
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   123
# CONFIG_WRITER have to be found even for manual configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   124
CONFIG_WRITER=makefiledir/Makefile.config_writer
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   125
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   126
ifndef MANUAL_CONFIG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   127
# Automatic configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   128
MAKE_CONFIG:=Makefile.config
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   129
MAKEFILE:=Makefile
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   130
LIB_DETECTION=makefiledir/Makefile.libdetection
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   131
CONFIG_WRITER=makefiledir/Makefile.config_writer
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   132
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   133
# Apply automatic configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   134
# See target section for how this is built, suppress errors
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   135
# since first time it isn't found but make reads this twice
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   136
-include $(MAKE_CONFIG)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   137
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   138
CONFIG_INCLUDED:=1
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   139
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   140
180
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   141
# updates makefile.config if it's outdated
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   142
ifneq ($(MAKEFILE_VERSION),$(CONFIG_VERSION))
189
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   143
	ifndef MANUAL_CONFIG	# manual config should not check this
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   144
		UPDATECONFIG:=upgradeconf
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   145
		CONFIG_INCLUDED:=
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   146
	else
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   147
		# this should define SDL-CONFIG for manual configuration
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   148
		ifeq ($(shell uname),FreeBSD)
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   149
			SDL-CONFIG:=sdl11-config
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   150
		else
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   151
			SDL-CONFIG:=sdl-config
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   152
		endif
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   153
	endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   154
else
189
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   155
	# this should define SDL-CONFIG for manual configuration
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   156
	ifeq ($(shell uname),FreeBSD)
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   157
		SDL-CONFIG:=sdl11-config
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   158
	else
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   159
		SDL-CONFIG:=sdl-config
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   160
	endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   161
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   162
219
adfdf7fad721 (svn r220) Makefile: enables ENABLE_NETWORK by default if no config file is present
bjarni
parents: 189
diff changeset
   163
# this is used if there aren't any makefile.config
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   164
ifndef CONFIG_INCLUDED
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   165
# sets network on by default if there aren't any config file
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   166
ENABLE_NETWORK:=1
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   167
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   168
# paths for make install
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   169
# disabled as they would break it for some (many?) people if they were default
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   170
#PREFIX:=/usr/local
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   171
#DATA_DIR:=share/games/openttd
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   172
#BINARY_DIR:=games
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   173
#PERSONAL_DIR:=.openttd
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   174
#USE_HOMEDIR:=1
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   175
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   176
-include $(LIB_DETECTION)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   177
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   178
162
565551f829e9 (svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents: 157
diff changeset
   179
# Verbose filter
565551f829e9 (svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents: 157
diff changeset
   180
565551f829e9 (svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents: 157
diff changeset
   181
ifdef NOVERBOSE
222
b88456001397 (svn r223) -Fix: Const correctness and miscellaneous fixes. Thank you Tron for your diligent fixing of warnings (and some possibly bugs) (Tron)
darkvater
parents: 221
diff changeset
   182
VERBOSE_FILTER =  >/dev/null 2>&1
162
565551f829e9 (svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents: 157
diff changeset
   183
else
222
b88456001397 (svn r223) -Fix: Const correctness and miscellaneous fixes. Thank you Tron for your diligent fixing of warnings (and some possibly bugs) (Tron)
darkvater
parents: 221
diff changeset
   184
VERBOSE_FILTER =
162
565551f829e9 (svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents: 157
diff changeset
   185
endif
565551f829e9 (svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents: 157
diff changeset
   186
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   187
ifdef DISPLAY_WARNINGS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   188
WARNING_DISPLAY:=-fstrict-aliasing
222
b88456001397 (svn r223) -Fix: Const correctness and miscellaneous fixes. Thank you Tron for your diligent fixing of warnings (and some possibly bugs) (Tron)
darkvater
parents: 221
diff changeset
   189
VERBOSE_FILTER =
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   190
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   191
WARNING_DISPLAY:=-fno-strict-aliasing
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   192
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   193
180
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   194
ifdef SUPRESS_LANG_ERRORS
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   195
ifndef VERBOSE_FILTER
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   196
LANG_ERRORS =  >/dev/null 2>&1
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   197
endif
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   198
endif
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   199
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   200
ifdef STATIC
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   201
ifndef WIN32
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   202
ifndef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   203
ifndef MORPHOS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   204
ifndef SKIP_STATIC_CHECK
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   205
$(error Static is only known to work on MorphOS and MacOSX!!! --- Check makefile.config for more info and howto bypass this check)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   206
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   207
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   208
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   209
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   210
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   211
580
be080525ea08 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   212
ifdef RELEASE
be080525ea08 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   213
ifdef OSX
be080525ea08 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   214
ifndef STATIC
be080525ea08 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   215
$(error do not make dynamically linked releases. Most users can't use those)
be080525ea08 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   216
endif
be080525ea08 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   217
endif
be080525ea08 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   218
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   219
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   220
# Force SDL on UNIX platforms
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   221
ifndef WITH_SDL
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   222
ifdef UNIX
549
004bcc2b1033 (svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
bjarni
parents: 543
diff changeset
   223
ifndef DEDICATED
004bcc2b1033 (svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
bjarni
parents: 543
diff changeset
   224
$(error You need to have SDL installed in order to run OpenTTD on UNIX. Use DEDICATED if you want to compile a CLI based server)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   225
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   226
endif
549
004bcc2b1033 (svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
bjarni
parents: 543
diff changeset
   227
endif
004bcc2b1033 (svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
bjarni
parents: 543
diff changeset
   228
1029
c6bbfed6fc26 (svn r1530) Makefilefix: now the binary never links to SDL if DEDICATED is set. Thanks to igor2code for making me aware of this issue even through I fixed it in a different way than his patch did. (I made dedicated never link to sdl, nomatter what makefile.config says)
bjarni
parents: 988
diff changeset
   229
# remove the dependancy for sdl if DEDICALTED is used
c6bbfed6fc26 (svn r1530) Makefilefix: now the binary never links to SDL if DEDICATED is set. Thanks to igor2code for making me aware of this issue even through I fixed it in a different way than his patch did. (I made dedicated never link to sdl, nomatter what makefile.config says)
bjarni
parents: 988
diff changeset
   230
ifdef DEDICATED
c6bbfed6fc26 (svn r1530) Makefilefix: now the binary never links to SDL if DEDICATED is set. Thanks to igor2code for making me aware of this issue even through I fixed it in a different way than his patch did. (I made dedicated never link to sdl, nomatter what makefile.config says)
bjarni
parents: 988
diff changeset
   231
WITH_SDL:=
c6bbfed6fc26 (svn r1530) Makefilefix: now the binary never links to SDL if DEDICATED is set. Thanks to igor2code for making me aware of this issue even through I fixed it in a different way than his patch did. (I made dedicated never link to sdl, nomatter what makefile.config says)
bjarni
parents: 988
diff changeset
   232
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   233
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   234
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   235
##############################################################################
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   236
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   237
# Compiler configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   238
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   239
CC=gcc
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   240
CXX=g++
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   241
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   242
ifdef MORPHOS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   243
CC += -noixemul -pipe
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   244
CXX += -noixemul -pipe
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   245
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   246
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   247
# Executable file extension
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   248
ifdef WIN32
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   249
EXE=.exe
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   250
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   251
EXE=
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   252
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   253
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   254
# Set output executable names
32
bc861ea6d23b (svn r33) -Executeable is now openttd(.exe) always
darkvater
parents: 0
diff changeset
   255
TTD=openttd$(EXE)
157
dd017fa3bad8 (svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents: 126
diff changeset
   256
ENDIAN_CHECK=endian_check$(EXE)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   257
STRGEN=strgen/strgen$(EXE)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   258
OSXAPP="OpenTTD.app"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   259
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   260
# What revision are we compiling, if we have an idea?
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   261
REV_NUMBER := $(shell if test -d .svn; then svnversion . | tr -dc 0-9; fi)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   262
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   263
ifdef RELEASE
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   264
REV:=$(RELEASE)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   265
else
450
c5102d6f280e (svn r660) Fix typo introduced in r655
tron
parents: 446
diff changeset
   266
REV := $(shell if test -d .svn; then svnversion . | awk '{ print "r"$$0 }'; fi)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   267
tmp_test:=$(shell echo "$(REV)" | grep "M" )
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   268
ifdef tmp_test
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   269
REV_NUMBER:=1
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   270
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   271
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   272
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   273
ifndef REV_NUMBER
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   274
REV_NUMBER:=0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   275
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   276
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   277
# MorphOS needs builddate
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   278
BUILDDATE=`date +%d.%m.%y`
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   279
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   280
# AMD64 needs a little more settings to work
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   281
ifeq ($(shell uname -m), x86_64)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   282
endwarnings:=endwarnings
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   283
64_bit_warnings:=64_bit_warnings
157
dd017fa3bad8 (svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents: 126
diff changeset
   284
BASECFLAGS += -m64
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   285
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   286
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   287
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   288
# When calling the compiler, use these flags
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   289
# -g	debugging symbols
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   290
# -Wall	all warnings
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   291
# -s    automatic strip
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   292
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   293
# You may also want:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   294
# -O	optimize or -O2 fully optimize (O's above 2 are not recommended)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   295
# -pg	profile - generate profiling data.  See "man gprof" to use this.
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   296
1052
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   297
CC_VERSION = $(shell $(CC) -dumpversion | cut -c 1-3)
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   298
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   299
# GNU make can only test for (in)equality
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   300
# this is a workaround to test for >=
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   301
ifeq ($(shell if test ! $(CC_VERSION) \< 2.9; then echo true; fi), true)
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   302
  CFLAGS += -O -Wall -Wno-multichar -Wsign-compare
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   303
endif
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   304
ifeq ($(shell if test ! $(CC_VERSION) \< 3.0; then echo true; fi), true)
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   305
  CFLAGS += -W -Wno-unused-parameter
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   306
endif
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   307
ifeq ($(shell if test ! $(CC_VERSION) \< 3.4; then echo true; fi), true)
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   308
  CFLAGS += -Wdeclaration-after-statement
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   309
endif
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   310
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   311
CDEFS=-DWITH_REV
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   312
LDFLAGS=
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   313
LIBS=
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   314
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   315
ifdef DEBUG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   316
# Debug mode
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   317
CDEFS += -D_DEBUG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   318
BASECFLAGS += -g
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   319
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   320
ifdef PROFILE
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   321
BASECFLAGS += -pg
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   322
LDFLAGS += -pg
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   323
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   324
# Release mode
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   325
ifndef MORPHOS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   326
# automatical strip breaks under morphos
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   327
BASECFLAGS += -s
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   328
LDFLAGS += -s
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   329
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   330
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   331
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   332
ifdef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   333
# these compilerflags makes the app run as fast as possible without making the app unstable. It works on G3 or newer
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   334
BASECFLAGS += -O3 -funroll-loops -fsched-interblock -falign-loops=16 -falign-jumps=16 -falign-functions=16 -falign-jumps-max-skip=15 -falign-loops-max-skip=15 -mdynamic-no-pic -mpowerpc-gpopt -force_cpusubtype_ALL $(WARNING_DISPLAY)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   335
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   336
ifdef MORPHOS
569
2e86ae517874 (svn r980) Fixed issues where MorphOS would get problems if AmigaOS would get a port, since MorphOS also have the flag __AMIGA__ defined (Tokai)
bjarni
parents: 565
diff changeset
   337
BASECFLAGS += -O3 -funroll-loops -fexpensive-optimizations -mstring -mmultiple $(WARNING_DISPLAY)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   338
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   339
BASECFLAGS += -O2 $(WARNING_DISPLAY)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   340
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   341
ifndef PROFILE
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   342
BASECFLAGS += -fomit-frame-pointer
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   343
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   344
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   345
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   346
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   347
ifdef STATIC
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   348
ifndef OSX	# OSX can't build static if -static flag is used
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   349
LDFLAGS += -static
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   350
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   351
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   352
798
6b5518bf858f (svn r1268) -Fix: some warnings in gfx.c fixed
darkvater
parents: 770
diff changeset
   353
# If building on MingW don't link with Cygwin libs
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   354
ifdef WIN32
798
6b5518bf858f (svn r1268) -Fix: some warnings in gfx.c fixed
darkvater
parents: 770
diff changeset
   355
ifdef CYGWIN
6b5518bf858f (svn r1268) -Fix: some warnings in gfx.c fixed
darkvater
parents: 770
diff changeset
   356
BASECFLAGS += -mwin32
6b5518bf858f (svn r1268) -Fix: some warnings in gfx.c fixed
darkvater
parents: 770
diff changeset
   357
LDFLAGS += -mwin32
6b5518bf858f (svn r1268) -Fix: some warnings in gfx.c fixed
darkvater
parents: 770
diff changeset
   358
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   359
ifdef MINGW
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   360
BASECFLAGS += -mno-cygwin
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   361
LDFLAGS += -mno-cygwin
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   362
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   363
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   364
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   365
CFLAGS += $(BASECFLAGS)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   366
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   367
ifdef UNIX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   368
CDEFS += -DUNIX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   369
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   370
421
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   371
ifdef BEOS
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   372
CDEFS += -DBEOS
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   373
LDFLAGS += -lmidi -lbe
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   374
ifdef WITH_NETWORK
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   375
	ifdef BEOS_NET_SERVER
1051
c56a3ce9b64f (svn r1552) Make ottd compile on Zeta
tron
parents: 1029
diff changeset
   376
		CDEFS += -DBEOS_NET_SERVER
c56a3ce9b64f (svn r1552) Make ottd compile on Zeta
tron
parents: 1029
diff changeset
   377
	else
c56a3ce9b64f (svn r1552) Make ottd compile on Zeta
tron
parents: 1029
diff changeset
   378
		# Zeta needs a few more libraries than R5
c56a3ce9b64f (svn r1552) Make ottd compile on Zeta
tron
parents: 1029
diff changeset
   379
		LDFLAGS += -lbind -lsocket
421
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   380
	endif
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   381
endif
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   382
endif
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   383
446
20304ea8e94e (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   384
ifdef SUNOS
20304ea8e94e (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   385
CDEFS += -DSUNOS
20304ea8e94e (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   386
ifdef WITH_NETWORK
20304ea8e94e (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   387
LDFLAGS += -lnsl -lsocket
20304ea8e94e (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   388
endif
20304ea8e94e (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   389
endif
20304ea8e94e (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   390
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   391
# SDL config
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   392
ifdef WITH_SDL
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   393
CDEFS += -DWITH_SDL
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   394
CFLAGS += `$(SDL-CONFIG) --cflags`
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   395
ifdef STATIC
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   396
LIBS += `$(SDL-CONFIG) --static-libs`
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   397
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   398
LIBS += `$(SDL-CONFIG) --libs`
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   399
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   400
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   401
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   402
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   403
# zlib config
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   404
ifdef WITH_ZLIB
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   405
	CDEFS +=  -DWITH_ZLIB
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   406
	ifdef STATIC
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   407
		ifdef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   408
# zlib is default on OSX, so everybody have it. No need for static linking
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   409
			LIBS += -lz
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   410
		else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   411
			ifndef STATIC_ZLIB_PATH
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   412
				ifndef MANUAL_CONFIG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   413
					# updates makefile.config with the zlib path
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   414
					UPDATECONFIG:=upgradeconf
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   415
				endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   416
				TEMP:=$(shell ls /lib 2>/dev/null | grep "zlib.a")$(shell ls /lib 2>/dev/null | grep "libz.a")
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   417
				ifdef TEMP
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   418
					STATIC_ZLIB_PATH:=/lib/$(TEMP)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   419
				else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   420
					TEMP:=$(shell ls /usr/lib 2>/dev/null | grep "zlib.a")$(shell ls /usr/lib 2>/dev/null | grep "libz.a")
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   421
					ifdef TEMP
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   422
						STATIC_ZLIB_PATH:=/usr/lib/$(TEMP)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   423
					else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   424
						TEMP:=$(shell ls /usr/local/lib 2>/dev/null | grep "zlib.a")$(shell ls /usr/local/lib 2>/dev/null | grep "libz.a")
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   425
						ifdef TEMP
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   426
							STATIC_ZLIB_PATH:=/usr/local/lib/$(TEMP)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   427
						endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   428
					endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   429
				endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   430
			endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   431
			LIBS += $(STATIC_ZLIB_PATH)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   432
		endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   433
	else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   434
		LIBS += -lz
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   435
	endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   436
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   437
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   438
# libpng config
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   439
ifdef WITH_PNG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   440
CDEFS += -DWITH_PNG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   441
# FreeBSD doesn't use libpng-config
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   442
ifdef FREEBSD
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   443
LIBS += -lpng
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   444
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   445
CFLAGS += `libpng-config --cflags`
551
48dc69ef0e94 (svn r951) Makefile: fixed missing flag for libpng, which prevented lib detection if SDL was not used
bjarni
parents: 549
diff changeset
   446
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   447
# seems like older libpng versions are broken and need this
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   448
PNGCONFIG_FLAGS = --ldflags --libs
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   449
ifdef STATIC
583
3bcdf7a0c2f7 (svn r1003) Mac: reintroduced the static libpng hack in makefile since it appears to be needed in the nightly builds
bjarni
parents: 580
diff changeset
   450
ifdef OSX
3bcdf7a0c2f7 (svn r1003) Mac: reintroduced the static libpng hack in makefile since it appears to be needed in the nightly builds
bjarni
parents: 580
diff changeset
   451
# Seems like we need a tiny hack for OSX static to work
3bcdf7a0c2f7 (svn r1003) Mac: reintroduced the static libpng hack in makefile since it appears to be needed in the nightly builds
bjarni
parents: 580
diff changeset
   452
LIBS += `libpng-config --prefix`/lib/libpng.a
3bcdf7a0c2f7 (svn r1003) Mac: reintroduced the static libpng hack in makefile since it appears to be needed in the nightly builds
bjarni
parents: 580
diff changeset
   453
else
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   454
LIBS += `libpng-config --static $(PNGCONFIG_FLAGS)`
583
3bcdf7a0c2f7 (svn r1003) Mac: reintroduced the static libpng hack in makefile since it appears to be needed in the nightly builds
bjarni
parents: 580
diff changeset
   455
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   456
else
551
48dc69ef0e94 (svn r951) Makefile: fixed missing flag for libpng, which prevented lib detection if SDL was not used
bjarni
parents: 549
diff changeset
   457
LIBS += `libpng-config  --L_opts $(PNGCONFIG_FLAGS)`
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   458
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   459
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   460
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   461
347
892935295937 (svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents: 285
diff changeset
   462
# enables/disables assert()
348
959f425dc282 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   463
ifdef DISABLE_ASSERTS
959f425dc282 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   464
CFLAGS += -DNDEBUG
959f425dc282 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   465
endif
959f425dc282 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   466
959f425dc282 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   467
# automatically disables asserts for release
959f425dc282 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   468
ifdef RELEASE
347
892935295937 (svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents: 285
diff changeset
   469
ifndef ENABLE_ASSERTS
892935295937 (svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents: 285
diff changeset
   470
CFLAGS += -DNDEBUG
892935295937 (svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents: 285
diff changeset
   471
endif
348
959f425dc282 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   472
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   473
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   474
ifdef TRANSLATOR
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   475
STRGEN_FLAGS=-t
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   476
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   477
STRGEN_FLAGS=
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   478
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   479
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   480
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   481
# MIDI setup
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   482
ifdef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   483
ifndef MIDI
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   484
MIDI:=$(OSXAPP)/contents/macos/track_starter
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   485
endif
561
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   486
ifndef SECOND_DATA_PATH
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   487
SECOND_DATA_PATH:="$(OSXAPP)/contents/data/"
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   488
endif
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   489
ifndef CUSTOM_LANG_DIR
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   490
CUSTOM_LANG_DIR:="$(OSXAPP)/contents/lang/"
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   491
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   492
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   493
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   494
ifdef MIDI
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   495
CDEFS += -DEXTERNAL_PLAYER=\"$(MIDI)\"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   496
ifdef MIDI_ARG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   497
CDEFS += -DMIDI_ARG=\"$(MIDI_ARG)\"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   498
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   499
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   500
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   501
ifdef WITH_NETWORK
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   502
CDEFS += -DENABLE_NETWORK
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   503
ifdef QNX
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   504
LIBS += -lsocket
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   505
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   506
ifdef UNIX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   507
ifndef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   508
ifndef MORPHOS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   509
# this have caused problems on many platforms and disabling it didn't break anything
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   510
# now we test if disabling it as a general breaks it for anybody
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   511
#LIBS += -lresolv
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   512
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   513
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   514
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   515
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   516
561
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   517
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   518
ifdef SECOND_DATA_PATH
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   519
CDEFS += -DSECOND_DATA_DIR=\"$(SECOND_DATA_PATH)/\"
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   520
endif
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   521
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   522
ifdef CUSTOM_LANG_DIR
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   523
CDEFS += -DCUSTOM_LANG_DIR=\"$(CUSTOM_LANG_DIR)/\"
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   524
endif
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   525
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   526
ifdef WITH_DIRECTMUSIC
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   527
CDEFS += -DWIN32_ENABLE_DIRECTMUSIC_SUPPORT
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   528
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   529
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   530
ifdef WIN32
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   531
LIBS += -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32 -lstdc++
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   532
TTDLDFLAGS += -Wl,--subsystem,windows
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   533
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   534
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   535
# sets up the paths for use for make install
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   536
ifdef INSTALL
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   537
# We use _PREFIXED vars here, so the paths are recalculated every time, and
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   538
# the prefix is not prepended in the makefile config
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   539
BINARY_DIR_PREFIXED:=$(PREFIX)/$(BINARY_DIR)
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   540
DATA_DIR_PREFIXED:=$(PREFIX)/$(DATA_DIR)
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   541
# We use _INSTALL vars here, these vars are the locations where the files will
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   542
# be installed
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   543
DATA_DIR_INSTALL=$(DEST_DIR)/$(DATA_DIR_PREFIXED)
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   544
BINARY_DIR_INSTALL=$(DEST_DIR)/$(BINARY_DIR_PREFIXED)
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   545
# Let the code know where to find stuff
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   546
ifdef DATA_DIR_PREFIXED
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   547
CDEFS += -DGAME_DATA_DIR=\"$(DATA_DIR_PREFIXED)/\"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   548
endif
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   549
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   550
ifdef PERSONAL_DIR
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   551
CDEFS += -DPERSONAL_DIR=\"$(PERSONAL_DIR)/\"
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   552
endif
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   553
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   554
ifdef USE_HOMEDIR
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   555
CDEFS += -DUSE_HOMEDIR
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   556
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   557
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   558
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   559
##############################################################################
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   560
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   561
# What to compile
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   562
# (users do not want to modify anything below)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   563
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   564
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   565
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   566
### Sources
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   567
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   568
C_SOURCES += ai.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   569
C_SOURCES += ai_build.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   570
C_SOURCES += ai_new.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   571
C_SOURCES += ai_pathfinder.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   572
C_SOURCES += ai_shared.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   573
C_SOURCES += aircraft_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   574
C_SOURCES += aircraft_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   575
C_SOURCES += airport.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   576
C_SOURCES += airport_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   577
C_SOURCES += aystar.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   578
C_SOURCES += bridge_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   579
C_SOURCES += callback_table.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   580
C_SOURCES += clear_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   581
C_SOURCES += command.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   582
C_SOURCES += console.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   583
C_SOURCES += console_cmds.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   584
C_SOURCES += dedicated.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   585
C_SOURCES += disaster_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   586
C_SOURCES += dock_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   587
C_SOURCES += dummy_land.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   588
C_SOURCES += economy.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   589
C_SOURCES += engine.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   590
C_SOURCES += engine_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   591
C_SOURCES += fileio.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   592
C_SOURCES += gfx.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   593
C_SOURCES += graph_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   594
C_SOURCES += newgrf.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   595
C_SOURCES += industry_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   596
C_SOURCES += industry_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   597
C_SOURCES += intro_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   598
C_SOURCES += landscape.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   599
C_SOURCES += main_gui.c
679
e959706a3e4d (svn r1117) Move map arrays and some related macros into their own files map.c and map.h
tron
parents: 677
diff changeset
   600
C_SOURCES += map.c
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   601
C_SOURCES += md5.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   602
C_SOURCES += minilzo.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   603
C_SOURCES += misc.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   604
C_SOURCES += misc_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   605
C_SOURCES += misc_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   606
C_SOURCES += music_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   607
C_SOURCES += namegen.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   608
C_SOURCES += network.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   609
C_SOURCES += network_client.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   610
C_SOURCES += network_data.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   611
C_SOURCES += network_gamelist.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   612
C_SOURCES += network_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   613
C_SOURCES += network_server.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   614
C_SOURCES += network_udp.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   615
C_SOURCES += news_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   616
C_SOURCES += oldloader.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   617
C_SOURCES += order_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   618
C_SOURCES += order_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   619
C_SOURCES += pathfind.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   620
C_SOURCES += player_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   621
C_SOURCES += players.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   622
C_SOURCES += queue.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   623
C_SOURCES += rail_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   624
C_SOURCES += rail_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   625
C_SOURCES += rev.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   626
C_SOURCES += road_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   627
C_SOURCES += road_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   628
C_SOURCES += roadveh_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   629
C_SOURCES += roadveh_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   630
C_SOURCES += saveload.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   631
C_SOURCES += screenshot.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   632
C_SOURCES += settings.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   633
C_SOURCES += settings_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   634
C_SOURCES += ship_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   635
C_SOURCES += ship_gui.c
988
2482369a61ff (svn r1486) -Codechange: moved all 'signs' stuff to signs.c/h and prepared it for
truelight
parents: 978
diff changeset
   636
C_SOURCES += signs.c
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   637
C_SOURCES += smallmap_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   638
C_SOURCES += sound.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   639
C_SOURCES += sprite.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   640
C_SOURCES += spritecache.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   641
C_SOURCES += station_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   642
C_SOURCES += station_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   643
C_SOURCES += strings.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   644
C_SOURCES += subsidy_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   645
C_SOURCES += terraform_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   646
C_SOURCES += texteff.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   647
C_SOURCES += town_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   648
C_SOURCES += town_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   649
C_SOURCES += train_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   650
C_SOURCES += train_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   651
C_SOURCES += tree_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   652
C_SOURCES += ttd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   653
C_SOURCES += tunnelbridge_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   654
C_SOURCES += unmovable_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   655
C_SOURCES += vehicle.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   656
C_SOURCES += vehicle_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   657
C_SOURCES += viewport.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   658
C_SOURCES += water_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   659
C_SOURCES += widget.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   660
C_SOURCES += window.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   661
421
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   662
CXX_SOURCES =
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   663
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   664
ifdef WITH_SDL
421
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   665
C_SOURCES += sdl.c
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   666
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   667
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   668
ifdef WIN32
421
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   669
C_SOURCES += win32.c w32dm.c
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   670
else
421
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   671
C_SOURCES += extmidi.c unix.c
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   672
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   673
421
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   674
ttd_OBJS = $(C_SOURCES:%.c=%.o) $(CXX_SOURCES:%.cpp=%.o)
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   675
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   676
ifdef BEOS
532
84e504f4f6d1 (svn r877) Moved bemidi.cpp correctly this time
bjarni
parents: 531
diff changeset
   677
CXX_SOURCES += os/beos/bemidi.cpp
84e504f4f6d1 (svn r877) Moved bemidi.cpp correctly this time
bjarni
parents: 531
diff changeset
   678
CFLAGS += -I.
421
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   679
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   680
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   681
ifdef WIN32
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   682
# Resource file
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   683
ttd_OBJS += winres.o
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   684
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   685
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   686
ifdef WITH_DIRECTMUSIC
421
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   687
CXX_SOURCES += w32dm2.cpp
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   688
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   689
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   690
ttd_DEPS1 = $(foreach obj,$(ttd_OBJS),.deps/$(obj))
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   691
ttd_DEPS = $(ttd_DEPS1:%.o=%.P)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   692
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   693
LANG_TXT = $(filter-out %.unfinished.txt,$(wildcard lang/*.txt))
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   694
LANGS = $(LANG_TXT:%.txt=%.lng)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   695
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   696
C_COMPILE = $(CC) $(CFLAGS) $(CDEFS)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   697
CXX_COMPILE = $(CXX) $(CFLAGS) $(CDEFS)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   698
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   699
C_BUILD = $(C_COMPILE) -c
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   700
CXX_BUILD = $(CXX_COMPILE) -c
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   701
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   702
C_LINK = $(CC) $(LDFLAGS) -o
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   703
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   704
162
565551f829e9 (svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents: 157
diff changeset
   705
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   706
##############################################################################
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   707
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   708
# Targets
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   709
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   710
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   711
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   712
### Normal build rules
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   713
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   714
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   715
ifdef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   716
OSX:=OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   717
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   718
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   719
475
d9b87f0ffdb4 (svn r726) The OpenTTD binary doesn't depend on the language files, so move this dependency to the all target
tron
parents: 474
diff changeset
   720
all: endian.h $(UPDATECONFIG) $(LANGS) $(TTD) $(OSX) $(endwarnings)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   721
157
dd017fa3bad8 (svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents: 126
diff changeset
   722
endian.h: $(ENDIAN_CHECK)
222
b88456001397 (svn r223) -Fix: Const correctness and miscellaneous fixes. Thank you Tron for your diligent fixing of warnings (and some possibly bugs) (Tron)
darkvater
parents: 221
diff changeset
   723
	@# Check if system is LITTLE_ENDIAN or BIG_ENDIAN
163
deb9b58db3f4 (svn r164) -Fix: Makefile did not clean up endian-files
truelight
parents: 162
diff changeset
   724
	@echo 'Running endian_check'; \
deb9b58db3f4 (svn r164) -Fix: Makefile did not clean up endian-files
truelight
parents: 162
diff changeset
   725
		./$(ENDIAN_CHECK) > $@
157
dd017fa3bad8 (svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents: 126
diff changeset
   726
dd017fa3bad8 (svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents: 126
diff changeset
   727
$(ENDIAN_CHECK): endian_check.c
163
deb9b58db3f4 (svn r164) -Fix: Makefile did not clean up endian-files
truelight
parents: 162
diff changeset
   728
	@echo 'Compiling and Linking $@'; \
deb9b58db3f4 (svn r164) -Fix: Makefile did not clean up endian-files
truelight
parents: 162
diff changeset
   729
		$(CC) $(BASECFLAGS) $(CDEFS) endian_check.c -o $@
222
b88456001397 (svn r223) -Fix: Const correctness and miscellaneous fixes. Thank you Tron for your diligent fixing of warnings (and some possibly bugs) (Tron)
darkvater
parents: 221
diff changeset
   730
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   731
475
d9b87f0ffdb4 (svn r726) The OpenTTD binary doesn't depend on the language files, so move this dependency to the all target
tron
parents: 474
diff changeset
   732
$(TTD): table/strings.h $(ttd_OBJS) $(MAKE_CONFIG)
462
b995527cb51c (svn r681) Support for VERBOSE configuration variable which shows the commands actually used for compilation.
pasky
parents: 452
diff changeset
   733
	$(if $(VERBOSE),@echo '$(C_LINK) $@ $(TTDLDFLAGS) $(ttd_OBJS) $(LIBS)';,@echo 'Compiling and Linking $@';) \
b995527cb51c (svn r681) Support for VERBOSE configuration variable which shows the commands actually used for compilation.
pasky
parents: 452
diff changeset
   734
 		$(C_LINK) $@ $(TTDLDFLAGS) $(ttd_OBJS) $(LIBS) $(VERBOSE_FILTER)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   735
728
c8728c17f505 (svn r1180) Makefile: fixed dependancies so the flag -j can be used. It makes the compilation process into more than one job which makes it able to benefit from multiple CPUs. Using -j without setting a limit of jobs (like -j2) is not a great idea (thanks to ln-- for reporting the need for this one)
bjarni
parents: 679
diff changeset
   736
$(OSX): $(TTD)
610
e70910461431 (svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents: 602
diff changeset
   737
	@rm -fr "$(OSXAPP)"
e70910461431 (svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents: 602
diff changeset
   738
	@mkdir -p "$(OSXAPP)"/Contents/MacOS
e70910461431 (svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents: 602
diff changeset
   739
	@mkdir -p "$(OSXAPP)"/Contents/Resources
e70910461431 (svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents: 602
diff changeset
   740
	@mkdir -p "$(OSXAPP)"/Contents/Data
e70910461431 (svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents: 602
diff changeset
   741
	@mkdir -p "$(OSXAPP)"/Contents/Lang
e70910461431 (svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents: 602
diff changeset
   742
	@echo "APPL????" > "$(OSXAPP)"/Contents/PkgInfo
e70910461431 (svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents: 602
diff changeset
   743
	@cp os/macos/ttd.icns "$(OSXAPP)"/Contents/Resources/openttd.icns
e70910461431 (svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents: 602
diff changeset
   744
	@os/macos/plistgen.sh "$(OSXAPP)" "$(REV)"
e70910461431 (svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents: 602
diff changeset
   745
	@cp os/macos/track_starter "$(OSXAPP)"/contents/macos
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   746
	@ls os/macos | grep -q "\.class" || \
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   747
	javac os/macos/OpenTTDMidi.java
610
e70910461431 (svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents: 602
diff changeset
   748
	@cp os/macos/OpenTTDMidi.class "$(OSXAPP)"/contents/macos
e70910461431 (svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents: 602
diff changeset
   749
	@cp data/* "$(OSXAPP)"/Contents/data/
e70910461431 (svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents: 602
diff changeset
   750
	@cp lang/*.lng "$(OSXAPP)"/Contents/lang/
e70910461431 (svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents: 602
diff changeset
   751
	@cp $(TTD) "$(OSXAPP)"/Contents/MacOS/$(TTD)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   752
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   753
$(endwarnings): $(64_bit_warnings)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   754
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   755
$(64_bit_warnings):
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   756
	$(warning 64 bit CPUs will get some 64 bit specific bugs!)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   757
	$(warning If you see any bugs, include in your bug report that you use a 64 bit CPU)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   758
728
c8728c17f505 (svn r1180) Makefile: fixed dependancies so the flag -j can be used. It makes the compilation process into more than one job which makes it able to benefit from multiple CPUs. Using -j without setting a limit of jobs (like -j2) is not a great idea (thanks to ln-- for reporting the need for this one)
bjarni
parents: 679
diff changeset
   759
$(STRGEN): strgen/strgen.c endian.h
162
565551f829e9 (svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents: 157
diff changeset
   760
	@echo 'Compiling and Linking $@'; \
730
939c4654fdea (svn r1182) -Fix: Makefile had a small glitch, making it impossible to compile the game (Oskar_)
truelight
parents: 728
diff changeset
   761
		$(CC) $(BASECFLAGS) $(CDEFS) -o $@ $< $(VERBOSE_FILTER)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   762
474
75f8c36e36ba (svn r725) Fix language file dependencies
tron
parents: 462
diff changeset
   763
table/strings.h: lang/english.txt $(STRGEN)
162
565551f829e9 (svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents: 157
diff changeset
   764
	@echo 'Generating $@'; \
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   765
	$(STRGEN)
222
b88456001397 (svn r223) -Fix: Const correctness and miscellaneous fixes. Thank you Tron for your diligent fixing of warnings (and some possibly bugs) (Tron)
darkvater
parents: 221
diff changeset
   766
476
ad012336ed61 (svn r727) The langauge files depend on english.txt, not strings.h
tron
parents: 475
diff changeset
   767
lang/%.lng: lang/%.txt $(STRGEN) lang/english.txt
162
565551f829e9 (svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents: 157
diff changeset
   768
	@echo 'Generating $@'; \
180
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   769
	$(STRGEN) $(STRGEN_FLAGS) $< $(VERBOSE_FILTER) $(LANG_ERRORS)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   770
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   771
winres.o: ttd.rc
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   772
	windres -o $@ $<
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   773
770
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   774
ifdef MORPHOS
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   775
release: all
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   776
	@rm -fr "/t/openttd-$(RELEASE)-morphos.lha"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   777
	@mkdir -p "/t/"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   778
	@mkdir -p "/t/openttd-$(RELEASE)-morphos"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   779
	@mkdir -p "/t/openttd-$(RELEASE)-morphos/docs"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   780
	@mkdir -p "/t/openttd-$(RELEASE)-morphos/data"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   781
	@mkdir -p "/t/openttd-$(RELEASE)-morphos/lang"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   782
	@cp -R $(TTD)                      "/t/openttd-$(RELEASE)-morphos/"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   783
	@cp data/*                         "/t/openttd-$(RELEASE)-morphos/data/"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   784
	@cp lang/*.lng                     "/t/openttd-$(RELEASE)-morphos/lang/"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   785
	@cp readme.txt                     "/t/openttd-$(RELEASE)-morphos/docs/ReadMe"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   786
	@cp docs/console.txt               "/t/openttd-$(RELEASE)-morphos/docs/Console"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   787
	@cp COPYING                        "/t/openttd-$(RELEASE)-morphos/docs/"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   788
	@cp changelog.txt                  "/t/openttd-$(RELEASE)-morphos/docs/ChangeLog"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   789
	@cp os/morphos/icons/openttd.info  "/t/openttd-$(RELEASE)-morphos/$(TTD).info"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   790
	@cp os/morphos/icons/docs.info     "/t/openttd-$(RELEASE)-morphos/docs.info"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   791
	@cp os/morphos/icons/drawer.info   "/t/openttd-$(RELEASE)-morphos.info"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   792
	@cp os/morphos/icons/document.info "/t/openttd-$(RELEASE)-morphos/docs/ReadMe.info"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   793
	@cp os/morphos/icons/document.info "/t/openttd-$(RELEASE)-morphos/docs/Console.info"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   794
	@cp os/morphos/icons/document.info "/t/openttd-$(RELEASE)-morphos/docs/COPYING.info"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   795
	@cp os/morphos/icons/document.info "/t/openttd-$(RELEASE)-morphos/docs/ChangeLog.info"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   796
	@strip --strip-all --strip-unneeded --remove-section .comment "/t/openttd-$(RELEASE)-morphos/$(TTD)"
944
c97b49017d13 (svn r1432) -Fix: I seem to be unable to revert a simple file :s
truelight
parents: 943
diff changeset
   797
	@lha a -r "t:openttd-$(RELEASE)-morphos.lha" "t:openttd-$(RELEASE)-morphos" 
770
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   798
	@lha a    "t:openttd-$(RELEASE)-morphos.lha" "t:openttd-$(RELEASE)-morphos.info"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   799
	@rm -fr "/t/openttd-$(RELEASE)-morphos"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   800
	@rm -fr "/t/openttd-$(RELEASE)-morphos.info"
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   801
	@echo "Release archive can be found in RAM:t/ now."
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   802
944
c97b49017d13 (svn r1432) -Fix: I seem to be unable to revert a simple file :s
truelight
parents: 943
diff changeset
   803
.PHONY: release 
770
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   804
endif
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   805
563
f60fe5a7d56f (svn r972) Makefile: added make release (currently only works on mac)
bjarni
parents: 561
diff changeset
   806
ifdef OSX
f60fe5a7d56f (svn r972) Makefile: added make release (currently only works on mac)
bjarni
parents: 561
diff changeset
   807
release: all
565
54f509007e3b (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   808
	@mkdir -p "OpenTTD $(RELEASE)"
54f509007e3b (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   809
	@mkdir -p "OpenTTD $(RELEASE)"/docs
54f509007e3b (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   810
	@cp -R $(OSXAPP) "OpenTTD $(RELEASE)"/
54f509007e3b (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   811
	@cp docs/OSX_where_did_the_package_go.txt "OpenTTD $(RELEASE)"/Where\ did\ the\ package\ go.txt
54f509007e3b (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   812
	@cp readme.txt "OpenTTD $(RELEASE)"/docs/
54f509007e3b (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   813
	@cp docs/README_if_game_crashed_on_OSX.txt "OpenTTD $(RELEASE)"/docs/readme\ if\ crashed\ on\ OSX.txt
54f509007e3b (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   814
	@cp docs/console.txt "OpenTTD $(RELEASE)"/docs/
54f509007e3b (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   815
	@cp COPYING "OpenTTD $(RELEASE)"/docs/
54f509007e3b (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   816
	@cp changelog.txt "OpenTTD $(RELEASE)"/docs/
54f509007e3b (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   817
	@cp docs/README_if_game_crashed_on_OSX.txt "OpenTTD $(RELEASE)"/docs/
54f509007e3b (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   818
	@cp os/macos/*.webloc "OpenTTD $(RELEASE)"
590
1033437d21ef (svn r1011) Makefile, mac: added absolute path to hdiutil (default location) to fix the path issues when building nightly builds with a cronjob
bjarni
parents: 589
diff changeset
   819
	@/usr/bin/hdiutil create -ov -format UDZO -srcfolder "OpenTTD $(RELEASE)" openttd-"$(RELEASE)"-osx.dmg
565
54f509007e3b (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   820
	@rm -fr "OpenTTD $(RELEASE)"
563
f60fe5a7d56f (svn r972) Makefile: added make release (currently only works on mac)
bjarni
parents: 561
diff changeset
   821
564
39e0d73fa19d (svn r973) Makefile: added make nightly_build (only on mac)
bjarni
parents: 563
diff changeset
   822
nightly_build: all
574
acaa37f42d88 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   823
	@mkdir -p "OpenTTD_nightly_$(DATE)"
acaa37f42d88 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   824
	@mkdir -p "OpenTTD_nightly_$(DATE)"/docs
acaa37f42d88 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   825
	@cp -R $(OSXAPP) "OpenTTD_nightly_$(DATE)"/
acaa37f42d88 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   826
	@cp docs/OSX_where_did_the_package_go.txt "OpenTTD_nightly_$(DATE)"/Where\ did\ the\ package\ go.txt
acaa37f42d88 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   827
	@cp readme.txt "OpenTTD_nightly_$(DATE)"/docs/
acaa37f42d88 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   828
	@cp docs/README_if_game_crashed_on_OSX.txt "OpenTTD_nightly_$(DATE)"/docs/readme\ if\ crashed\ on\ OSX.txt
acaa37f42d88 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   829
	@cp docs/console.txt "OpenTTD_nightly_$(DATE)"/docs/
acaa37f42d88 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   830
	@cp COPYING "OpenTTD_nightly_$(DATE)"/docs/
acaa37f42d88 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   831
	@cp revisionlog.txt "OpenTTD_nightly_$(DATE)"/revisionlog.txt
acaa37f42d88 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   832
	@cp docs/README_if_game_crashed_on_OSX.txt "OpenTTD_nightly_$(DATE)"/docs/
acaa37f42d88 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   833
	@cp os/macos/*.webloc "OpenTTD_nightly_$(DATE)"/
590
1033437d21ef (svn r1011) Makefile, mac: added absolute path to hdiutil (default location) to fix the path issues when building nightly builds with a cronjob
bjarni
parents: 589
diff changeset
   834
	@/usr/bin/hdiutil create -ov -format UDZO -srcfolder "OpenTTD_nightly_$(DATE)" openttd-nightly-"$(DATE)".dmg
574
acaa37f42d88 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   835
	@rm -fr "OpenTTD_nightly_$(DATE)"
564
39e0d73fa19d (svn r973) Makefile: added make nightly_build (only on mac)
bjarni
parents: 563
diff changeset
   836
39e0d73fa19d (svn r973) Makefile: added make nightly_build (only on mac)
bjarni
parents: 563
diff changeset
   837
.PHONY: release nightly_build
563
f60fe5a7d56f (svn r972) Makefile: added make release (currently only works on mac)
bjarni
parents: 561
diff changeset
   838
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   839
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   840
rev.c: FORCE
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   841
	@# setting the revision number in a place, there the binary can read it
615
3a22cf31bb29 (svn r1039) Makefile: now RELEASE flag can contain () too
bjarni
parents: 610
diff changeset
   842
	@echo 'const char _openttd_revision[] = "$(REV)";' >>rev.c.new
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   843
	@echo 'const int _revision_number = $(REV_NUMBER);' >>rev.c.new
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   844
	@# some additions for MorphOS versions tag
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   845
	@echo '#ifdef __MORPHOS__'  >>rev.c.new
615
3a22cf31bb29 (svn r1039) Makefile: now RELEASE flag can contain () too
bjarni
parents: 610
diff changeset
   846
	@echo 'const char morphos_versions_tag[] = "\\0$$VER: OpenTTD $(REV) ('${BUILDDATE}') © OpenTTD Team [MorphOS, PowerPC]";'  >>rev.c.new
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   847
	@echo '#endif' >>rev.c.new
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   848
	@# Only update the real rev.c if it actually changed, to prevent
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   849
	@# useless rebuilds.
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   850
	@cmp -s rev.c rev.c.new 2>/dev/null || mv rev.c.new rev.c
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   851
	@rm -f rev.c.new
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   852
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   853
FORCE:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   854
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   855
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   856
clean:
162
565551f829e9 (svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents: 157
diff changeset
   857
	@echo 'Cleaning up...'; \
589
f719a093cd84 (svn r1010) Makefile: removed the outdated remove of ttd binary from make clean (should only be a check for openttd binary)
bjarni
parents: 583
diff changeset
   858
	rm -rf .deps *~ $(TTD) $(STRGEN) core table/strings.h $(LANGS) $(ttd_OBJS) endian.h $(ENDIAN_CHECK)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   859
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   860
mrproper: clean
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   861
	rm -rf $(MAKE_CONFIG)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   862
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   863
ifndef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   864
ifndef MORPHOS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   865
install:
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   866
ifeq ($(INSTALL),)
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   867
	$(error make install is highly experimental at his state and not\
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   868
	tested very much - use at your own risk - to use run \"make install INSTALL:=1\" - make sure makefile.config\
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   869
	is set correctly up - run \"make upgradeconf\")
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   870
endif
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   871
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   872
ifeq ($(PREFIX), )
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   873
	$(error no prefix set - check makefile.config)
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   874
endif
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   875
#	We compare against the non prefixed version here, so we won't install
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   876
#	if only the prefix has been set
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   877
ifeq ($(DATA_DIR),)
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   878
	$(error no data path set - check makefile.config)
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   879
endif
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   880
ifeq ($(BINARY_DIR),)
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   881
	$(error no binary path set - check makefile.config)
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   882
endif
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   883
# We'll install in $DEST_DIR instead of root if it is set (we don't
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   884
# care about extra /'s
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   885
	mkdir -p $(DATA_DIR_INSTALL)/lang
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   886
	mkdir -p $(DATA_DIR_INSTALL)/data
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   887
	mkdir -p $(DATA_DIR_INSTALL)/gm
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   888
	mkdir -p $(BINARY_DIR_INSTALL)
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   889
	cp $(TTD) $(BINARY_DIR_INSTALL)
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   890
	cp lang/*.lng $(DATA_DIR_INSTALL)/lang
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   891
	cp data/*.grf $(DATA_DIR_INSTALL)/data
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   892
	cp data/opntitle.dat $(DATA_DIR_INSTALL)/data
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   893
	cp media/openttd.64.png $(DATA_DIR_INSTALL)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   894
else	#MorphOS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   895
install:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   896
	$(error make install is not supported on MorphOS)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   897
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   898
else	# OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   899
install:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   900
	$(error make install is not supported on MacOSX)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   901
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   902
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   903
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   904
love:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   905
	@echo "YES! I thought you would never ask. We will have a great time. You can keep me turned on all night"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   906
730
939c4654fdea (svn r1182) -Fix: Makefile had a small glitch, making it impossible to compile the game (Oskar_)
truelight
parents: 728
diff changeset
   907
.PHONY: clean all $(OSX) install $(64_bit_warnings) $(endwarnings) love
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   908
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   909
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   910
### Automatic configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   911
-include $(CONFIG_WRITER)
222
b88456001397 (svn r223) -Fix: Const correctness and miscellaneous fixes. Thank you Tron for your diligent fixing of warnings (and some possibly bugs) (Tron)
darkvater
parents: 221
diff changeset
   912
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   913
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   914
# Export all variables set to subprocesses (a bit dirty)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   915
.EXPORT_ALL_VARIABLES:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   916
upgradeconf: $(MAKE_CONFIG)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   917
	rm $(MAKE_CONFIG)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   918
	$(MAKE) $(MAKE_CONFIG)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   919
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   920
.PHONY: upgradeconf
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   921
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   922
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   923
### Internal build rules
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   924
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   925
# This makes sure the .deps dir is always around.
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   926
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   927
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   928
# Introduce the dependencies
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   929
-include $(ttd_DEPS)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   930
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   931
# This compiles the object file as well as silently updating its dependencies
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   932
# list at the same time. It is not an issue that they aren't around during the
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   933
# first compilation round as we just build everything at that time anyway,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   934
# therefore we do not need to watch deps.
162
565551f829e9 (svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents: 157
diff changeset
   935
565551f829e9 (svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents: 157
diff changeset
   936
#@echo '$(C_BUILD) $<'; \
565551f829e9 (svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents: 157
diff changeset
   937
565551f829e9 (svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents: 157
diff changeset
   938
728
c8728c17f505 (svn r1180) Makefile: fixed dependancies so the flag -j can be used. It makes the compilation process into more than one job which makes it able to benefit from multiple CPUs. Using -j without setting a limit of jobs (like -j2) is not a great idea (thanks to ln-- for reporting the need for this one)
bjarni
parents: 679
diff changeset
   939
%.o: %.c $(MAKE_CONFIG) endian.h table/strings.h
462
b995527cb51c (svn r681) Support for VERBOSE configuration variable which shows the commands actually used for compilation.
pasky
parents: 452
diff changeset
   940
	$(if $(VERBOSE),@echo '$(C_BUILD) $<',@echo 'Compiling $(*F).o'); \
162
565551f829e9 (svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents: 157
diff changeset
   941
		       $(C_BUILD) $< -Wp,-MD,.deps/$(*F).pp $(VERBOSE_FILTER)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   942
	@-cp .deps/$(*F).pp .deps/$(*F).P; \
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   943
		tr ' ' '\012' < .deps/$(*F).pp \
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   944
		| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   945
		>> .deps/$(*F).P; \
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   946
	rm .deps/$(*F).pp
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   947
532
84e504f4f6d1 (svn r877) Moved bemidi.cpp correctly this time
bjarni
parents: 531
diff changeset
   948
# For DirectMusic build and BeOS specific parts
728
c8728c17f505 (svn r1180) Makefile: fixed dependancies so the flag -j can be used. It makes the compilation process into more than one job which makes it able to benefit from multiple CPUs. Using -j without setting a limit of jobs (like -j2) is not a great idea (thanks to ln-- for reporting the need for this one)
bjarni
parents: 679
diff changeset
   949
%.o: %.cpp  $(MAKE_CONFIG) endian.h table/strings.h
532
84e504f4f6d1 (svn r877) Moved bemidi.cpp correctly this time
bjarni
parents: 531
diff changeset
   950
	$(CXX_BUILD) $< -o $@