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