Makefile
author bjarni
Mon, 24 Jan 2005 21:39:16 +0000
changeset 1148 c7ffa9f5adc1
parent 1146 9561b9668dc6
child 1158 bcca61b472ea
permissions -rw-r--r--
(svn r1649) Makefile: added known-bugs.txt to mac and MorphOS release scripts and made a really dirty hack to force 0.3.6 on binary files compiled with this makefile
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
a6ef8e441cd6 (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
3dd9b5a439af (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
7a92ca9738e2 (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
462
e7c3c47de2c4 (svn r681) Support for VERBOSE configuration variable which shows the commands actually used for compilation.
pasky
parents: 452
diff changeset
    67
# VERBOSE: actually show the commands used for compilation.
804
3288a1c6d133 (svn r1274) Makefile: networking is not longer experimental
bjarni
parents: 798
diff changeset
    68
# WITH_NETWORK: enable networking
3288a1c6d133 (svn r1274) Makefile: networking is not longer experimental
bjarni
parents: 798
diff changeset
    69
# 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
    70
#
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    71
# Paths:
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    72
# INSTALL: If not set, the game uses the directory of the binary to
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
    73
# store everything (lang, data, gm, save and openttd.cfg), this is the `old' behaviour.
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    74
# In this case, none of the following paths are used, you also should _not_
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    75
# use `make install', but copy the required stuff yourself (or just play out
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    76
# of you source directory, which should work fine).
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    77
# If you want to use `make install' to install the game globally, you should
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    78
# define it _before_ you build the game. If you only define INSTALL when you
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    79
# do `make install', the game won't be able to find it's files (so you should
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    80
# also define all the following paths before building).
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    81
#
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    82
# So, the following paths should be defined if INSTALL is defined.
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    83
# None of these paths have to end with /
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    84
# PREFIX:	Normally /usr/local
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    85
# BINARY_DIR:	The location of the binary, normally games. (Will be prefixed
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    86
#		with $PREFIX)
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
    87
# DATA_DIR: 	The location of the data (lang, data and gm), normally
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    88
#		share/games/openttd. (Will be prefixed with $PREFIX)
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    89
# PERSONAL_DIR:	The directory where openttd.cfg and the save folder will be
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    90
#		stored. You cannot use ~ here, define USE_HOMEDIR for that.
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    91
# USE_HOMEDIR:	If this variable is set, PERSONAL_DIR will be prefixed with
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    92
#		~/ at runtime (the user's homedir)
561
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
    93
# SECOND_DATA_PATH  Use this data dir if a file is not found in the data dir in the data path
944
d046a9f508df (svn r1432) -Fix: I seem to be unable to revert a simple file :s
truelight
parents: 943
diff changeset
    94
# CUSTOM_LANG_PATH  If this is set, it will use the path given to search for lng files 
561
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
    95
#		instead of the lang dir in the data path
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
    96
#   NOTE: both SECOND_DATA_PATH and CUSTOM_LANG_PATH uses paths relative to where OTTD is opened
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    97
#
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    98
# DEST_DIR:	make install will use this directory instead of the filesystem
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    99
# 		root to install its files. This should normally not be used by
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   100
# 		ordinary users, currently it is only used for the debian
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   101
# 		packaging. This value should only be set when calling `make
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   102
# 		install' and is not saved in Makefile.config
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   103
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   104
# STATIC: link statically
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   105
# CYGWIN: build in Cygwin environment
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   106
# MINGW: build with MingW compiler, link with MingW libraries
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   107
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   108
# Experimental (does not work properly):
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   109
# WITH_DIRECTMUSIC: enable DirectMusic MIDI support
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   110
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   111
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
# Configuration
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
1148
c7ffa9f5adc1 (svn r1649) Makefile: added known-bugs.txt to mac and MorphOS release scripts and made a really dirty hack to force 0.3.6 on binary files compiled with this makefile
bjarni
parents: 1146
diff changeset
   117
ifndef RELEASE
c7ffa9f5adc1 (svn r1649) Makefile: added known-bugs.txt to mac and MorphOS release scripts and made a really dirty hack to force 0.3.6 on binary files compiled with this makefile
bjarni
parents: 1146
diff changeset
   118
RELEASE:=0.3.6
c7ffa9f5adc1 (svn r1649) Makefile: added known-bugs.txt to mac and MorphOS release scripts and made a really dirty hack to force 0.3.6 on binary files compiled with this makefile
bjarni
parents: 1146
diff changeset
   119
endif
c7ffa9f5adc1 (svn r1649) Makefile: added known-bugs.txt to mac and MorphOS release scripts and made a really dirty hack to force 0.3.6 on binary files compiled with this makefile
bjarni
parents: 1146
diff changeset
   120
180
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   121
# Makefile version tag
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   122
# it checks if the version tag in makefile.config is the same and force update outdated config files
804
3288a1c6d133 (svn r1274) Makefile: networking is not longer experimental
bjarni
parents: 798
diff changeset
   123
MAKEFILE_VERSION:=6
180
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   124
1146
9561b9668dc6 (svn r1647) Remove stale comment and fix typo
tron
parents: 1119
diff changeset
   125
# CONFIG_WRITER has to be found even for manual configuration
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   126
CONFIG_WRITER=makefiledir/Makefile.config_writer
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   127
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   128
ifndef MANUAL_CONFIG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   129
# Automatic configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   130
MAKE_CONFIG:=Makefile.config
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   131
MAKEFILE:=Makefile
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   132
LIB_DETECTION=makefiledir/Makefile.libdetection
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   133
CONFIG_WRITER=makefiledir/Makefile.config_writer
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   134
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   135
# Apply automatic configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   136
# 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
   137
# 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
   138
-include $(MAKE_CONFIG)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   139
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   140
CONFIG_INCLUDED:=1
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   141
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   142
180
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   143
# 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
   144
ifneq ($(MAKEFILE_VERSION),$(CONFIG_VERSION))
189
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   145
	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
   146
		UPDATECONFIG:=upgradeconf
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   147
		CONFIG_INCLUDED:=
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   148
	else
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   149
		# 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
   150
		ifeq ($(shell uname),FreeBSD)
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   151
			SDL-CONFIG:=sdl11-config
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   152
		else
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   153
			SDL-CONFIG:=sdl-config
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   154
		endif
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   155
	endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   156
else
189
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   157
	# 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
   158
	ifeq ($(shell uname),FreeBSD)
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   159
		SDL-CONFIG:=sdl11-config
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   160
	else
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   161
		SDL-CONFIG:=sdl-config
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   162
	endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   163
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   164
219
adfdf7fad721 (svn r220) Makefile: enables ENABLE_NETWORK by default if no config file is present
bjarni
parents: 189
diff changeset
   165
# 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
   166
ifndef CONFIG_INCLUDED
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   167
# sets network on by default if there aren't any config file
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   168
ENABLE_NETWORK:=1
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   169
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   170
# paths for make install
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   171
# disabled as they would break it for some (many?) people if they were default
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   172
#PREFIX:=/usr/local
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   173
#DATA_DIR:=share/games/openttd
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   174
#BINARY_DIR:=games
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   175
#PERSONAL_DIR:=.openttd
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   176
#USE_HOMEDIR:=1
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   177
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   178
-include $(LIB_DETECTION)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   179
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   180
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   181
ifdef DISPLAY_WARNINGS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   182
WARNING_DISPLAY:=-fstrict-aliasing
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   183
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   184
WARNING_DISPLAY:=-fno-strict-aliasing
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   185
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   186
180
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   187
ifdef SUPRESS_LANG_ERRORS
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   188
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
   189
endif
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   190
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   191
ifdef STATIC
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   192
ifndef WIN32
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   193
ifndef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   194
ifndef MORPHOS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   195
ifndef SKIP_STATIC_CHECK
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   196
$(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
   197
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   198
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   199
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   200
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   201
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   202
580
d3f72568d160 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   203
ifdef RELEASE
d3f72568d160 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   204
ifdef OSX
d3f72568d160 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   205
ifndef STATIC
d3f72568d160 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   206
$(error do not make dynamically linked releases. Most users can't use those)
d3f72568d160 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   207
endif
d3f72568d160 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   208
endif
d3f72568d160 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   209
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   210
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   211
# Force SDL on UNIX platforms
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   212
ifndef WITH_SDL
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   213
ifdef UNIX
549
e48b65755929 (svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
bjarni
parents: 543
diff changeset
   214
ifndef DEDICATED
e48b65755929 (svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
bjarni
parents: 543
diff changeset
   215
$(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
   216
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   217
endif
549
e48b65755929 (svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
bjarni
parents: 543
diff changeset
   218
endif
e48b65755929 (svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
bjarni
parents: 543
diff changeset
   219
1029
985407cedbbd (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
   220
# remove the dependancy for sdl if DEDICALTED is used
985407cedbbd (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
   221
ifdef DEDICATED
985407cedbbd (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
   222
WITH_SDL:=
985407cedbbd (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
   223
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   224
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   225
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   226
##############################################################################
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   227
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   228
# Compiler configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   229
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   230
CC=gcc
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   231
CXX=g++
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   232
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   233
ifdef MORPHOS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   234
CC += -noixemul -pipe
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   235
CXX += -noixemul -pipe
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   236
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   237
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   238
# Executable file extension
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   239
ifdef WIN32
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   240
EXE=.exe
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   241
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   242
EXE=
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   243
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   244
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   245
# Set output executable names
32
bc861ea6d23b (svn r33) -Executeable is now openttd(.exe) always
darkvater
parents: 0
diff changeset
   246
TTD=openttd$(EXE)
157
dd017fa3bad8 (svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents: 126
diff changeset
   247
ENDIAN_CHECK=endian_check$(EXE)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   248
STRGEN=strgen/strgen$(EXE)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   249
OSXAPP="OpenTTD.app"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   250
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   251
# 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
   252
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
   253
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   254
ifdef RELEASE
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   255
REV:=$(RELEASE)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   256
else
450
a74d2f607217 (svn r660) Fix typo introduced in r655
tron
parents: 446
diff changeset
   257
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
   258
tmp_test:=$(shell echo "$(REV)" | grep "M" )
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   259
ifdef tmp_test
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   260
REV_NUMBER:=1
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   261
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   262
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   263
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   264
ifndef REV_NUMBER
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   265
REV_NUMBER:=0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   266
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   267
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   268
# MorphOS needs builddate
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   269
BUILDDATE=`date +%d.%m.%y`
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   270
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   271
# AMD64 needs a little more settings to work
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   272
ifeq ($(shell uname -m), x86_64)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   273
endwarnings:=endwarnings
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   274
64_bit_warnings:=64_bit_warnings
157
dd017fa3bad8 (svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents: 126
diff changeset
   275
BASECFLAGS += -m64
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   276
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   277
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   278
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   279
# When calling the compiler, use these flags
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   280
# -g	debugging symbols
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   281
# -Wall	all warnings
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   282
# -s    automatic strip
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   283
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   284
# You may also want:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   285
# -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
   286
# -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
   287
1069
f6b7607231e5 (svn r1570) Make the gcc version test work with old versions of test (i.e. don't use the < operator)
tron
parents: 1052
diff changeset
   288
CC_VERSION = $(shell $(CC) -dumpversion | cut -c 1,3)
1052
f996874f0f16 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   289
f996874f0f16 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   290
# GNU make can only test for (in)equality
f996874f0f16 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   291
# this is a workaround to test for >=
1069
f6b7607231e5 (svn r1570) Make the gcc version test work with old versions of test (i.e. don't use the < operator)
tron
parents: 1052
diff changeset
   292
ifeq ($(shell if test $(CC_VERSION) -ge 29; then echo true; fi), true)
1093
4fdc46eaf423 (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents: 1069
diff changeset
   293
  CFLAGS += -O -Wall -Wno-multichar -Wsign-compare -Wstrict-prototypes
1115
55b99683ce51 (svn r1616) Introduce ttd_strlcat() and use it to de-uglify some piece of code in misc_cmd.
tron
parents: 1099
diff changeset
   294
  CFLAGS += -Wwrite-strings
1052
f996874f0f16 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   295
endif
1069
f6b7607231e5 (svn r1570) Make the gcc version test work with old versions of test (i.e. don't use the < operator)
tron
parents: 1052
diff changeset
   296
ifeq ($(shell if test $(CC_VERSION) -ge 30; then echo true; fi), true)
1052
f996874f0f16 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   297
  CFLAGS += -W -Wno-unused-parameter
f996874f0f16 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   298
endif
1069
f6b7607231e5 (svn r1570) Make the gcc version test work with old versions of test (i.e. don't use the < operator)
tron
parents: 1052
diff changeset
   299
ifeq ($(shell if test $(CC_VERSION) -ge 34; then echo true; fi), true)
1093
4fdc46eaf423 (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents: 1069
diff changeset
   300
  CFLAGS += -Wdeclaration-after-statement -Wold-style-definition
1052
f996874f0f16 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   301
endif
f996874f0f16 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   302
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   303
CDEFS=-DWITH_REV
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   304
LDFLAGS=
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   305
LIBS=
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   306
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   307
ifdef DEBUG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   308
# Debug mode
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   309
CDEFS += -D_DEBUG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   310
BASECFLAGS += -g
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   311
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   312
ifdef PROFILE
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   313
BASECFLAGS += -pg
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   314
LDFLAGS += -pg
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   315
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   316
# Release mode
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   317
ifndef MORPHOS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   318
# automatical strip breaks under morphos
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   319
BASECFLAGS += -s
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   320
LDFLAGS += -s
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   321
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   322
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   323
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   324
ifdef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   325
# 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
   326
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
   327
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   328
ifdef MORPHOS
569
1e1755ba1572 (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
   329
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
   330
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   331
BASECFLAGS += -O2 $(WARNING_DISPLAY)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   332
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   333
ifndef PROFILE
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   334
BASECFLAGS += -fomit-frame-pointer
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   335
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   336
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   337
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   338
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   339
ifdef STATIC
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   340
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
   341
LDFLAGS += -static
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   342
endif
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
798
8331baea2dc9 (svn r1268) -Fix: some warnings in gfx.c fixed
darkvater
parents: 770
diff changeset
   345
# 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
   346
ifdef WIN32
798
8331baea2dc9 (svn r1268) -Fix: some warnings in gfx.c fixed
darkvater
parents: 770
diff changeset
   347
ifdef CYGWIN
8331baea2dc9 (svn r1268) -Fix: some warnings in gfx.c fixed
darkvater
parents: 770
diff changeset
   348
BASECFLAGS += -mwin32
8331baea2dc9 (svn r1268) -Fix: some warnings in gfx.c fixed
darkvater
parents: 770
diff changeset
   349
LDFLAGS += -mwin32
8331baea2dc9 (svn r1268) -Fix: some warnings in gfx.c fixed
darkvater
parents: 770
diff changeset
   350
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   351
ifdef MINGW
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   352
BASECFLAGS += -mno-cygwin
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   353
LDFLAGS += -mno-cygwin
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   354
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   355
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   356
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   357
CFLAGS += $(BASECFLAGS)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   358
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   359
ifdef UNIX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   360
CDEFS += -DUNIX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   361
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   362
421
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   363
ifdef BEOS
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   364
CDEFS += -DBEOS
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   365
LDFLAGS += -lmidi -lbe
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   366
ifdef WITH_NETWORK
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   367
	ifdef BEOS_NET_SERVER
1051
be278201f830 (svn r1552) Make ottd compile on Zeta
tron
parents: 1029
diff changeset
   368
		CDEFS += -DBEOS_NET_SERVER
be278201f830 (svn r1552) Make ottd compile on Zeta
tron
parents: 1029
diff changeset
   369
	else
be278201f830 (svn r1552) Make ottd compile on Zeta
tron
parents: 1029
diff changeset
   370
		# Zeta needs a few more libraries than R5
be278201f830 (svn r1552) Make ottd compile on Zeta
tron
parents: 1029
diff changeset
   371
		LDFLAGS += -lbind -lsocket
421
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   372
	endif
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   373
endif
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   374
endif
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   375
446
7a92ca9738e2 (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   376
ifdef SUNOS
7a92ca9738e2 (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   377
CDEFS += -DSUNOS
7a92ca9738e2 (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   378
ifdef WITH_NETWORK
7a92ca9738e2 (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   379
LDFLAGS += -lnsl -lsocket
7a92ca9738e2 (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   380
endif
7a92ca9738e2 (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   381
endif
7a92ca9738e2 (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   382
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   383
# SDL config
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   384
ifdef WITH_SDL
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   385
CDEFS += -DWITH_SDL
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   386
CFLAGS += `$(SDL-CONFIG) --cflags`
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   387
ifdef STATIC
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   388
LIBS += `$(SDL-CONFIG) --static-libs`
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   389
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   390
LIBS += `$(SDL-CONFIG) --libs`
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   391
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   392
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   393
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   394
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   395
# zlib config
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   396
ifdef WITH_ZLIB
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   397
	CDEFS +=  -DWITH_ZLIB
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   398
	ifdef STATIC
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   399
		ifdef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   400
# 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
   401
			LIBS += -lz
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   402
		else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   403
			ifndef STATIC_ZLIB_PATH
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   404
				ifndef MANUAL_CONFIG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   405
					# updates makefile.config with the zlib path
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   406
					UPDATECONFIG:=upgradeconf
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   407
				endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   408
				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
   409
				ifdef TEMP
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   410
					STATIC_ZLIB_PATH:=/lib/$(TEMP)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   411
				else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   412
					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
   413
					ifdef TEMP
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   414
						STATIC_ZLIB_PATH:=/usr/lib/$(TEMP)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   415
					else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   416
						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
   417
						ifdef TEMP
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   418
							STATIC_ZLIB_PATH:=/usr/local/lib/$(TEMP)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   419
						endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   420
					endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   421
				endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   422
			endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   423
			LIBS += $(STATIC_ZLIB_PATH)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   424
		endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   425
	else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   426
		LIBS += -lz
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
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   430
# libpng config
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   431
ifdef WITH_PNG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   432
CDEFS += -DWITH_PNG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   433
# FreeBSD doesn't use libpng-config
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   434
ifdef FREEBSD
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   435
LIBS += -lpng
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   436
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   437
CFLAGS += `libpng-config --cflags`
551
f69b4fc48d19 (svn r951) Makefile: fixed missing flag for libpng, which prevented lib detection if SDL was not used
bjarni
parents: 549
diff changeset
   438
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   439
# 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
   440
PNGCONFIG_FLAGS = --ldflags --libs
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   441
ifdef STATIC
583
3762db489bb4 (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
   442
ifdef OSX
3762db489bb4 (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
   443
# Seems like we need a tiny hack for OSX static to work
3762db489bb4 (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
   444
LIBS += `libpng-config --prefix`/lib/libpng.a
3762db489bb4 (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
   445
else
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   446
LIBS += `libpng-config --static $(PNGCONFIG_FLAGS)`
583
3762db489bb4 (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
   447
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   448
else
551
f69b4fc48d19 (svn r951) Makefile: fixed missing flag for libpng, which prevented lib detection if SDL was not used
bjarni
parents: 549
diff changeset
   449
LIBS += `libpng-config  --L_opts $(PNGCONFIG_FLAGS)`
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   450
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   451
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   452
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   453
347
8b6874b7ed27 (svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents: 285
diff changeset
   454
# enables/disables assert()
348
3345a78d37e4 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   455
ifdef DISABLE_ASSERTS
3345a78d37e4 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   456
CFLAGS += -DNDEBUG
3345a78d37e4 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   457
endif
3345a78d37e4 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   458
3345a78d37e4 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   459
# automatically disables asserts for release
3345a78d37e4 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   460
ifdef RELEASE
347
8b6874b7ed27 (svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents: 285
diff changeset
   461
ifndef ENABLE_ASSERTS
8b6874b7ed27 (svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents: 285
diff changeset
   462
CFLAGS += -DNDEBUG
8b6874b7ed27 (svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents: 285
diff changeset
   463
endif
348
3345a78d37e4 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   464
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   465
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   466
ifdef TRANSLATOR
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   467
STRGEN_FLAGS=-t
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   468
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   469
STRGEN_FLAGS=
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   470
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   471
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   472
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   473
# MIDI setup
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   474
ifdef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   475
ifndef MIDI
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   476
MIDI:=$(OSXAPP)/contents/macos/track_starter
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   477
endif
561
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   478
ifndef SECOND_DATA_PATH
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   479
SECOND_DATA_PATH:="$(OSXAPP)/contents/data/"
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   480
endif
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   481
ifndef CUSTOM_LANG_DIR
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   482
CUSTOM_LANG_DIR:="$(OSXAPP)/contents/lang/"
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   483
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   484
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   485
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   486
ifdef MIDI
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   487
CDEFS += -DEXTERNAL_PLAYER=\"$(MIDI)\"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   488
ifdef MIDI_ARG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   489
CDEFS += -DMIDI_ARG=\"$(MIDI_ARG)\"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   490
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   491
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   492
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   493
ifdef WITH_NETWORK
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   494
CDEFS += -DENABLE_NETWORK
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   495
ifdef QNX
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   496
LIBS += -lsocket
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   497
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   498
ifdef UNIX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   499
ifndef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   500
ifndef MORPHOS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   501
# 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
   502
# 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
   503
#LIBS += -lresolv
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   504
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   505
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   506
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   507
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   508
561
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   509
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   510
ifdef SECOND_DATA_PATH
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   511
CDEFS += -DSECOND_DATA_DIR=\"$(SECOND_DATA_PATH)/\"
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   512
endif
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   513
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   514
ifdef CUSTOM_LANG_DIR
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   515
CDEFS += -DCUSTOM_LANG_DIR=\"$(CUSTOM_LANG_DIR)/\"
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   516
endif
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   517
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   518
ifdef WITH_DIRECTMUSIC
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   519
CDEFS += -DWIN32_ENABLE_DIRECTMUSIC_SUPPORT
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   520
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   521
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   522
ifdef WIN32
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   523
LIBS += -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32 -lstdc++
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   524
TTDLDFLAGS += -Wl,--subsystem,windows
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   525
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   526
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   527
# sets up the paths for use for make install
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   528
ifdef INSTALL
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   529
# We use _PREFIXED vars here, so the paths are recalculated every time, and
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   530
# the prefix is not prepended in the makefile config
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   531
BINARY_DIR_PREFIXED:=$(PREFIX)/$(BINARY_DIR)
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   532
DATA_DIR_PREFIXED:=$(PREFIX)/$(DATA_DIR)
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   533
# We use _INSTALL vars here, these vars are the locations where the files will
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   534
# be installed
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   535
DATA_DIR_INSTALL=$(DEST_DIR)/$(DATA_DIR_PREFIXED)
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   536
BINARY_DIR_INSTALL=$(DEST_DIR)/$(BINARY_DIR_PREFIXED)
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   537
# Let the code know where to find stuff
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   538
ifdef DATA_DIR_PREFIXED
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   539
CDEFS += -DGAME_DATA_DIR=\"$(DATA_DIR_PREFIXED)/\"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   540
endif
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   541
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   542
ifdef PERSONAL_DIR
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   543
CDEFS += -DPERSONAL_DIR=\"$(PERSONAL_DIR)/\"
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   544
endif
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   545
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   546
ifdef USE_HOMEDIR
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   547
CDEFS += -DUSE_HOMEDIR
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   548
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   549
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   550
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   551
##############################################################################
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   552
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   553
# What to compile
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   554
# (users do not want to modify anything below)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   555
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   556
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   557
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   558
### Sources
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   559
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   560
C_SOURCES += ai.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   561
C_SOURCES += ai_build.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   562
C_SOURCES += ai_new.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   563
C_SOURCES += ai_pathfinder.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   564
C_SOURCES += ai_shared.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   565
C_SOURCES += aircraft_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   566
C_SOURCES += aircraft_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   567
C_SOURCES += airport.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   568
C_SOURCES += airport_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   569
C_SOURCES += aystar.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   570
C_SOURCES += bridge_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   571
C_SOURCES += callback_table.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   572
C_SOURCES += clear_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   573
C_SOURCES += command.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   574
C_SOURCES += console.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   575
C_SOURCES += console_cmds.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   576
C_SOURCES += dedicated.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   577
C_SOURCES += disaster_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   578
C_SOURCES += dock_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   579
C_SOURCES += dummy_land.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   580
C_SOURCES += economy.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   581
C_SOURCES += engine.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   582
C_SOURCES += engine_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   583
C_SOURCES += fileio.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   584
C_SOURCES += gfx.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   585
C_SOURCES += graph_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   586
C_SOURCES += newgrf.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   587
C_SOURCES += industry_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   588
C_SOURCES += industry_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   589
C_SOURCES += intro_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   590
C_SOURCES += landscape.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   591
C_SOURCES += main_gui.c
679
04ca2cd69420 (svn r1117) Move map arrays and some related macros into their own files map.c and map.h
tron
parents: 677
diff changeset
   592
C_SOURCES += map.c
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   593
C_SOURCES += md5.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   594
C_SOURCES += minilzo.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   595
C_SOURCES += misc.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   596
C_SOURCES += misc_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   597
C_SOURCES += misc_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   598
C_SOURCES += music_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   599
C_SOURCES += namegen.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   600
C_SOURCES += network.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   601
C_SOURCES += network_client.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   602
C_SOURCES += network_data.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   603
C_SOURCES += network_gamelist.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   604
C_SOURCES += network_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   605
C_SOURCES += network_server.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   606
C_SOURCES += network_udp.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   607
C_SOURCES += news_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   608
C_SOURCES += oldloader.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   609
C_SOURCES += order_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   610
C_SOURCES += order_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   611
C_SOURCES += pathfind.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   612
C_SOURCES += player_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   613
C_SOURCES += players.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   614
C_SOURCES += queue.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   615
C_SOURCES += rail_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   616
C_SOURCES += rail_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   617
C_SOURCES += rev.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   618
C_SOURCES += road_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   619
C_SOURCES += road_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   620
C_SOURCES += roadveh_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   621
C_SOURCES += roadveh_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   622
C_SOURCES += saveload.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   623
C_SOURCES += screenshot.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   624
C_SOURCES += settings.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   625
C_SOURCES += settings_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   626
C_SOURCES += ship_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   627
C_SOURCES += ship_gui.c
988
4304525d1b8b (svn r1486) -Codechange: moved all 'signs' stuff to signs.c/h and prepared it for
truelight
parents: 978
diff changeset
   628
C_SOURCES += signs.c
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   629
C_SOURCES += smallmap_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   630
C_SOURCES += sound.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   631
C_SOURCES += sprite.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   632
C_SOURCES += spritecache.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   633
C_SOURCES += station_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   634
C_SOURCES += station_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   635
C_SOURCES += strings.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   636
C_SOURCES += subsidy_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   637
C_SOURCES += terraform_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   638
C_SOURCES += texteff.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   639
C_SOURCES += town_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   640
C_SOURCES += town_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   641
C_SOURCES += train_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   642
C_SOURCES += train_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   643
C_SOURCES += tree_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   644
C_SOURCES += ttd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   645
C_SOURCES += tunnelbridge_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   646
C_SOURCES += unmovable_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   647
C_SOURCES += vehicle.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   648
C_SOURCES += vehicle_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   649
C_SOURCES += viewport.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   650
C_SOURCES += water_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   651
C_SOURCES += widget.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   652
C_SOURCES += window.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   653
421
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   654
CXX_SOURCES =
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   655
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   656
ifdef WITH_SDL
421
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   657
C_SOURCES += sdl.c
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   658
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   659
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   660
ifdef WIN32
421
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   661
C_SOURCES += win32.c w32dm.c
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   662
else
421
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   663
C_SOURCES += extmidi.c unix.c
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   664
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   665
421
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   666
ttd_OBJS = $(C_SOURCES:%.c=%.o) $(CXX_SOURCES:%.cpp=%.o)
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   667
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   668
ifdef BEOS
532
d894d437be85 (svn r877) Moved bemidi.cpp correctly this time
bjarni
parents: 531
diff changeset
   669
CXX_SOURCES += os/beos/bemidi.cpp
d894d437be85 (svn r877) Moved bemidi.cpp correctly this time
bjarni
parents: 531
diff changeset
   670
CFLAGS += -I.
421
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   671
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   672
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   673
ifdef WIN32
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   674
# Resource file
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   675
ttd_OBJS += winres.o
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   676
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   677
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   678
ifdef WITH_DIRECTMUSIC
421
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   679
CXX_SOURCES += w32dm2.cpp
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   680
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   681
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   682
ttd_DEPS1 = $(foreach obj,$(ttd_OBJS),.deps/$(obj))
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   683
ttd_DEPS = $(ttd_DEPS1:%.o=%.P)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   684
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   685
LANG_TXT = $(filter-out %.unfinished.txt,$(wildcard lang/*.txt))
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   686
LANGS = $(LANG_TXT:%.txt=%.lng)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   687
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   688
C_COMPILE = $(CC) $(CFLAGS) $(CDEFS)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   689
CXX_COMPILE = $(CXX) $(CFLAGS) $(CDEFS)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   690
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   691
C_BUILD = $(C_COMPILE) -c
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   692
CXX_BUILD = $(CXX_COMPILE) -c
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   693
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   694
C_LINK = $(CC) $(LDFLAGS) -o
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
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
   697
0
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
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   700
# Targets
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
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
### Normal build rules
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   705
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
ifdef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   708
OSX:=OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   709
endif
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
475
2adef48675a8 (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
   712
all: endian.h $(UPDATECONFIG) $(LANGS) $(TTD) $(OSX) $(endwarnings)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   713
157
dd017fa3bad8 (svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents: 126
diff changeset
   714
endian.h: $(ENDIAN_CHECK)
1118
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   715
	@echo '===> Testing endianness'
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   716
	@./$(ENDIAN_CHECK) > $@
157
dd017fa3bad8 (svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents: 126
diff changeset
   717
dd017fa3bad8 (svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents: 126
diff changeset
   718
$(ENDIAN_CHECK): endian_check.c
1118
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   719
	@echo '===> Compiling and Linking $@'
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   720
	@$(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
   721
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   722
475
2adef48675a8 (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
   723
$(TTD): table/strings.h $(ttd_OBJS) $(MAKE_CONFIG)
1118
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   724
	@echo '===> Linking $@'
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   725
	@$(if $(VERBOSE), echo '$(C_LINK) $@ $(TTDLDFLAGS) $(ttd_OBJS) $(LIBS)')
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   726
	@$(C_LINK) $@ $(TTDLDFLAGS) $(ttd_OBJS) $(LIBS)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   727
728
ed05a60c01de (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
   728
$(OSX): $(TTD)
610
88f7dc3aebd1 (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
   729
	@rm -fr "$(OSXAPP)"
88f7dc3aebd1 (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
   730
	@mkdir -p "$(OSXAPP)"/Contents/MacOS
88f7dc3aebd1 (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
   731
	@mkdir -p "$(OSXAPP)"/Contents/Resources
88f7dc3aebd1 (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
   732
	@mkdir -p "$(OSXAPP)"/Contents/Data
88f7dc3aebd1 (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
   733
	@mkdir -p "$(OSXAPP)"/Contents/Lang
88f7dc3aebd1 (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
   734
	@echo "APPL????" > "$(OSXAPP)"/Contents/PkgInfo
1099
ad7522bd5c1c (svn r1600) Mac: applied the new icon to the mac binary file
bjarni
parents: 1093
diff changeset
   735
	@cp os/macos/openttd.icns "$(OSXAPP)"/Contents/Resources/openttd.icns
610
88f7dc3aebd1 (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
   736
	@os/macos/plistgen.sh "$(OSXAPP)" "$(REV)"
88f7dc3aebd1 (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
	@cp os/macos/track_starter "$(OSXAPP)"/contents/macos
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   738
	@ls os/macos | grep -q "\.class" || \
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   739
	javac os/macos/OpenTTDMidi.java
610
88f7dc3aebd1 (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
	@cp os/macos/OpenTTDMidi.class "$(OSXAPP)"/contents/macos
88f7dc3aebd1 (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
	@cp data/* "$(OSXAPP)"/Contents/data/
88f7dc3aebd1 (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
	@cp lang/*.lng "$(OSXAPP)"/Contents/lang/
88f7dc3aebd1 (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 $(TTD) "$(OSXAPP)"/Contents/MacOS/$(TTD)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   744
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   745
$(endwarnings): $(64_bit_warnings)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   746
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   747
$(64_bit_warnings):
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   748
	$(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
   749
	$(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
   750
728
ed05a60c01de (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
   751
$(STRGEN): strgen/strgen.c endian.h
1118
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   752
	@echo '===> Compiling and Linking $@'
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   753
	@$(CC) $(BASECFLAGS) $(CDEFS) -o $@ $<
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   754
474
211d24b41a53 (svn r725) Fix language file dependencies
tron
parents: 462
diff changeset
   755
table/strings.h: lang/english.txt $(STRGEN)
1118
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   756
	@echo '===> Generating $@'
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   757
	@$(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
   758
476
68e6469a3c91 (svn r727) The langauge files depend on english.txt, not strings.h
tron
parents: 475
diff changeset
   759
lang/%.lng: lang/%.txt $(STRGEN) lang/english.txt
1118
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   760
	@echo '===> Compiling language $(*F)'
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   761
	@$(STRGEN) $(STRGEN_FLAGS) $< $(LANG_ERRORS)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   762
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   763
winres.o: ttd.rc
1118
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   764
	@echo '===> Compiling resource $<'
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   765
	@windres -o $@ $<
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   766
770
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   767
ifdef MORPHOS
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   768
release: all
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   769
	@rm -fr "/t/openttd-$(RELEASE)-morphos.lha"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   770
	@mkdir -p "/t/"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   771
	@mkdir -p "/t/openttd-$(RELEASE)-morphos"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   772
	@mkdir -p "/t/openttd-$(RELEASE)-morphos/docs"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   773
	@mkdir -p "/t/openttd-$(RELEASE)-morphos/data"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   774
	@mkdir -p "/t/openttd-$(RELEASE)-morphos/lang"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   775
	@cp -R $(TTD)                      "/t/openttd-$(RELEASE)-morphos/"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   776
	@cp data/*                         "/t/openttd-$(RELEASE)-morphos/data/"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   777
	@cp lang/*.lng                     "/t/openttd-$(RELEASE)-morphos/lang/"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   778
	@cp readme.txt                     "/t/openttd-$(RELEASE)-morphos/docs/ReadMe"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   779
	@cp docs/console.txt               "/t/openttd-$(RELEASE)-morphos/docs/Console"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   780
	@cp COPYING                        "/t/openttd-$(RELEASE)-morphos/docs/"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   781
	@cp changelog.txt                  "/t/openttd-$(RELEASE)-morphos/docs/ChangeLog"
1148
c7ffa9f5adc1 (svn r1649) Makefile: added known-bugs.txt to mac and MorphOS release scripts and made a really dirty hack to force 0.3.6 on binary files compiled with this makefile
bjarni
parents: 1146
diff changeset
   782
	@cp known-bugs.txt				   "/t/openttd-$(RELEASE)-morphos/docs/known-bugs.txt"
770
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   783
	@cp os/morphos/icons/openttd.info  "/t/openttd-$(RELEASE)-morphos/$(TTD).info"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   784
	@cp os/morphos/icons/docs.info     "/t/openttd-$(RELEASE)-morphos/docs.info"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   785
	@cp os/morphos/icons/drawer.info   "/t/openttd-$(RELEASE)-morphos.info"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   786
	@cp os/morphos/icons/document.info "/t/openttd-$(RELEASE)-morphos/docs/ReadMe.info"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   787
	@cp os/morphos/icons/document.info "/t/openttd-$(RELEASE)-morphos/docs/Console.info"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   788
	@cp os/morphos/icons/document.info "/t/openttd-$(RELEASE)-morphos/docs/COPYING.info"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   789
	@cp os/morphos/icons/document.info "/t/openttd-$(RELEASE)-morphos/docs/ChangeLog.info"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   790
	@strip --strip-all --strip-unneeded --remove-section .comment "/t/openttd-$(RELEASE)-morphos/$(TTD)"
944
d046a9f508df (svn r1432) -Fix: I seem to be unable to revert a simple file :s
truelight
parents: 943
diff changeset
   791
	@lha a -r "t:openttd-$(RELEASE)-morphos.lha" "t:openttd-$(RELEASE)-morphos" 
770
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   792
	@lha a    "t:openttd-$(RELEASE)-morphos.lha" "t:openttd-$(RELEASE)-morphos.info"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   793
	@rm -fr "/t/openttd-$(RELEASE)-morphos"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   794
	@rm -fr "/t/openttd-$(RELEASE)-morphos.info"
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   795
	@echo "Release archive can be found in RAM:t/ now."
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   796
944
d046a9f508df (svn r1432) -Fix: I seem to be unable to revert a simple file :s
truelight
parents: 943
diff changeset
   797
.PHONY: release 
770
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   798
endif
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   799
563
a6ef8e441cd6 (svn r972) Makefile: added make release (currently only works on mac)
bjarni
parents: 561
diff changeset
   800
ifdef OSX
a6ef8e441cd6 (svn r972) Makefile: added make release (currently only works on mac)
bjarni
parents: 561
diff changeset
   801
release: all
565
53c3b5626170 (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   802
	@mkdir -p "OpenTTD $(RELEASE)"
53c3b5626170 (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   803
	@mkdir -p "OpenTTD $(RELEASE)"/docs
53c3b5626170 (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   804
	@cp -R $(OSXAPP) "OpenTTD $(RELEASE)"/
53c3b5626170 (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   805
	@cp docs/OSX_where_did_the_package_go.txt "OpenTTD $(RELEASE)"/Where\ did\ the\ package\ go.txt
53c3b5626170 (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   806
	@cp readme.txt "OpenTTD $(RELEASE)"/docs/
53c3b5626170 (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   807
	@cp docs/README_if_game_crashed_on_OSX.txt "OpenTTD $(RELEASE)"/docs/readme\ if\ crashed\ on\ OSX.txt
53c3b5626170 (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   808
	@cp docs/console.txt "OpenTTD $(RELEASE)"/docs/
53c3b5626170 (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   809
	@cp COPYING "OpenTTD $(RELEASE)"/docs/
53c3b5626170 (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 changelog.txt "OpenTTD $(RELEASE)"/docs/
53c3b5626170 (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/README_if_game_crashed_on_OSX.txt "OpenTTD $(RELEASE)"/docs/
53c3b5626170 (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 os/macos/*.webloc "OpenTTD $(RELEASE)"
1148
c7ffa9f5adc1 (svn r1649) Makefile: added known-bugs.txt to mac and MorphOS release scripts and made a really dirty hack to force 0.3.6 on binary files compiled with this makefile
bjarni
parents: 1146
diff changeset
   813
	@cp known-bugs.txt "OpenTTD $(RELEASE)"/known-bugs.txt
590
9647e9b63e10 (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
   814
	@/usr/bin/hdiutil create -ov -format UDZO -srcfolder "OpenTTD $(RELEASE)" openttd-"$(RELEASE)"-osx.dmg
565
53c3b5626170 (svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents: 564
diff changeset
   815
	@rm -fr "OpenTTD $(RELEASE)"
563
a6ef8e441cd6 (svn r972) Makefile: added make release (currently only works on mac)
bjarni
parents: 561
diff changeset
   816
564
86d7afd68af8 (svn r973) Makefile: added make nightly_build (only on mac)
bjarni
parents: 563
diff changeset
   817
nightly_build: all
574
886b0fe8d477 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   818
	@mkdir -p "OpenTTD_nightly_$(DATE)"
886b0fe8d477 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   819
	@mkdir -p "OpenTTD_nightly_$(DATE)"/docs
886b0fe8d477 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   820
	@cp -R $(OSXAPP) "OpenTTD_nightly_$(DATE)"/
886b0fe8d477 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   821
	@cp docs/OSX_where_did_the_package_go.txt "OpenTTD_nightly_$(DATE)"/Where\ did\ the\ package\ go.txt
886b0fe8d477 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   822
	@cp readme.txt "OpenTTD_nightly_$(DATE)"/docs/
886b0fe8d477 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   823
	@cp docs/README_if_game_crashed_on_OSX.txt "OpenTTD_nightly_$(DATE)"/docs/readme\ if\ crashed\ on\ OSX.txt
886b0fe8d477 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   824
	@cp docs/console.txt "OpenTTD_nightly_$(DATE)"/docs/
886b0fe8d477 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   825
	@cp COPYING "OpenTTD_nightly_$(DATE)"/docs/
886b0fe8d477 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   826
	@cp revisionlog.txt "OpenTTD_nightly_$(DATE)"/revisionlog.txt
886b0fe8d477 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   827
	@cp docs/README_if_game_crashed_on_OSX.txt "OpenTTD_nightly_$(DATE)"/docs/
886b0fe8d477 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   828
	@cp os/macos/*.webloc "OpenTTD_nightly_$(DATE)"/
590
9647e9b63e10 (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
   829
	@/usr/bin/hdiutil create -ov -format UDZO -srcfolder "OpenTTD_nightly_$(DATE)" openttd-nightly-"$(DATE)".dmg
574
886b0fe8d477 (svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents: 569
diff changeset
   830
	@rm -fr "OpenTTD_nightly_$(DATE)"
564
86d7afd68af8 (svn r973) Makefile: added make nightly_build (only on mac)
bjarni
parents: 563
diff changeset
   831
86d7afd68af8 (svn r973) Makefile: added make nightly_build (only on mac)
bjarni
parents: 563
diff changeset
   832
.PHONY: release nightly_build
563
a6ef8e441cd6 (svn r972) Makefile: added make release (currently only works on mac)
bjarni
parents: 561
diff changeset
   833
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   834
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   835
rev.c: FORCE
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   836
	@# setting the revision number in a place, there the binary can read it
615
fc0771d6a26c (svn r1039) Makefile: now RELEASE flag can contain () too
bjarni
parents: 610
diff changeset
   837
	@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
   838
	@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
   839
	@# some additions for MorphOS versions tag
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   840
	@echo '#ifdef __MORPHOS__'  >>rev.c.new
615
fc0771d6a26c (svn r1039) Makefile: now RELEASE flag can contain () too
bjarni
parents: 610
diff changeset
   841
	@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
   842
	@echo '#endif' >>rev.c.new
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   843
	@# 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
   844
	@# useless rebuilds.
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   845
	@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
   846
	@rm -f rev.c.new
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   847
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   848
FORCE:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   849
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   850
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   851
clean:
1118
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   852
	@echo '===> Cleaning up'
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   853
	@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
   854
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   855
mrproper: clean
1118
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   856
	@rm -rf $(MAKE_CONFIG)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   857
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   858
ifndef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   859
ifndef MORPHOS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   860
install:
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   861
ifeq ($(INSTALL),)
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   862
	$(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
   863
	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
   864
	is set correctly up - run \"make upgradeconf\")
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   865
endif
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   866
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   867
ifeq ($(PREFIX), )
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   868
	$(error no prefix set - check makefile.config)
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   869
endif
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   870
#	We compare against the non prefixed version here, so we won't install
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   871
#	if only the prefix has been set
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   872
ifeq ($(DATA_DIR),)
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   873
	$(error no data path set - check makefile.config)
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   874
endif
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   875
ifeq ($(BINARY_DIR),)
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   876
	$(error no binary path set - check makefile.config)
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   877
endif
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   878
# We'll install in $DEST_DIR instead of root if it is set (we don't
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   879
# care about extra /'s
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   880
	mkdir -p $(DATA_DIR_INSTALL)/lang
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   881
	mkdir -p $(DATA_DIR_INSTALL)/data
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   882
	mkdir -p $(DATA_DIR_INSTALL)/gm
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   883
	mkdir -p $(BINARY_DIR_INSTALL)
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   884
	cp $(TTD) $(BINARY_DIR_INSTALL)
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   885
	cp lang/*.lng $(DATA_DIR_INSTALL)/lang
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   886
	cp data/*.grf $(DATA_DIR_INSTALL)/data
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   887
	cp data/opntitle.dat $(DATA_DIR_INSTALL)/data
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   888
	cp media/openttd.64.png $(DATA_DIR_INSTALL)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   889
else	#MorphOS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   890
install:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   891
	$(error make install is not supported on MorphOS)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   892
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   893
else	# OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   894
install:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   895
	$(error make install is not supported on MacOSX)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   896
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   897
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   898
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   899
love:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   900
	@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
   901
730
95ef392e5db0 (svn r1182) -Fix: Makefile had a small glitch, making it impossible to compile the game (Oskar_)
truelight
parents: 728
diff changeset
   902
.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
   903
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   904
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   905
### Automatic configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   906
-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
   907
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
# Export all variables set to subprocesses (a bit dirty)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   910
.EXPORT_ALL_VARIABLES:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   911
upgradeconf: $(MAKE_CONFIG)
1118
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   912
	@rm $(MAKE_CONFIG)
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   913
	@$(MAKE) $(MAKE_CONFIG)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   914
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   915
.PHONY: upgradeconf
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   916
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   917
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   918
### Internal build rules
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
# This makes sure the .deps dir is always around.
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   921
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
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
# Introduce the dependencies
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   924
-include $(ttd_DEPS)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   925
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   926
# 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
   927
# 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
   928
# 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
   929
# 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
   930
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
   931
728
ed05a60c01de (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
   932
%.o: %.c $(MAKE_CONFIG) endian.h table/strings.h
1118
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   933
	@echo '===> Compiling $<'
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   934
	@$(if $(VERBOSE), echo '$(C_BUILD) $<')
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   935
	@$(C_BUILD) $< -Wp,-MD,.deps/$(*F).pp
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   936
	@-cp .deps/$(*F).pp .deps/$(*F).P; \
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   937
		tr ' ' '\012' < .deps/$(*F).pp \
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   938
		| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   939
		>> .deps/$(*F).P; \
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   940
	rm .deps/$(*F).pp
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   941
532
d894d437be85 (svn r877) Moved bemidi.cpp correctly this time
bjarni
parents: 531
diff changeset
   942
# For DirectMusic build and BeOS specific parts
728
ed05a60c01de (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
   943
%.o: %.cpp  $(MAKE_CONFIG) endian.h table/strings.h
1119
44a402ca7c01 (svn r1620) Fix typo in r1619
tron
parents: 1118
diff changeset
   944
	@echo '===> Compiling $<'
1118
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   945
	@$(CXX_BUILD) $< -o $@