author | pasky |
Mon, 28 Feb 2005 21:54:04 +0000 | |
changeset 1411 | 53935a3bcea0 |
parent 1324 | ff8b7799b44f |
child 1413 | 4a93d8682e11 |
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
f60fe5a7d56f
(svn r972) Makefile: added make release (currently only works on mac)
bjarni
parents:
561
diff
changeset
|
39 |
# release: used by OSX to make a dmg file ready to release |
0 | 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
0b9bdcdfe0c5
(svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents:
413
diff
changeset
|
48 |
# BEOS: building on BeOS |
446
20304ea8e94e
(svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents:
421
diff
changeset
|
49 |
# SUNOS: building on SunOS (Solaris) |
0 | 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
06aaddf6742b
(svn r1274) Makefile: networking is not longer experimental
bjarni
parents:
798
diff
changeset
|
66 |
# WITH_NETWORK: enable networking |
06aaddf6742b
(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
e3b43338096b
(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
e3b43338096b
(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
e3b9689745ab
(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
e3b9689745ab
(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 |
e3b9689745ab
(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 |
# |
|
1411
53935a3bcea0
(svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents:
1324
diff
changeset
|
106 |
# VERBOSE: show full compiler invocations instead of brief progress messages |
53935a3bcea0
(svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents:
1324
diff
changeset
|
107 |
# |
0 | 108 |
# Experimental (does not work properly): |
109 |
# WITH_DIRECTMUSIC: enable DirectMusic MIDI support |
|
110 |
||
111 |
||
112 |
############################################################################## |
|
113 |
# |
|
114 |
# Configuration |
|
115 |
# |
|
116 |
||
1148
c7925e9e1182
(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 |
|
180
47ee14fe2b35
(svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents:
164
diff
changeset
|
118 |
# Makefile version tag |
47ee14fe2b35
(svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents:
164
diff
changeset
|
119 |
# it checks if the version tag in makefile.config is the same and force update outdated config files |
804
06aaddf6742b
(svn r1274) Makefile: networking is not longer experimental
bjarni
parents:
798
diff
changeset
|
120 |
MAKEFILE_VERSION:=6 |
180
47ee14fe2b35
(svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents:
164
diff
changeset
|
121 |
|
1146 | 122 |
# CONFIG_WRITER has to be found even for manual configuration |
0 | 123 |
CONFIG_WRITER=makefiledir/Makefile.config_writer |
124 |
||
125 |
ifndef MANUAL_CONFIG |
|
126 |
# Automatic configuration |
|
127 |
MAKE_CONFIG:=Makefile.config |
|
128 |
MAKEFILE:=Makefile |
|
129 |
LIB_DETECTION=makefiledir/Makefile.libdetection |
|
130 |
CONFIG_WRITER=makefiledir/Makefile.config_writer |
|
131 |
||
132 |
# Apply automatic configuration |
|
133 |
# See target section for how this is built, suppress errors |
|
134 |
# since first time it isn't found but make reads this twice |
|
135 |
-include $(MAKE_CONFIG) |
|
136 |
else |
|
137 |
CONFIG_INCLUDED:=1 |
|
138 |
endif |
|
139 |
||
180
47ee14fe2b35
(svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents:
164
diff
changeset
|
140 |
# 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
|
141 |
ifneq ($(MAKEFILE_VERSION),$(CONFIG_VERSION)) |
189
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
142 |
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
|
143 |
UPDATECONFIG:=upgradeconf |
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
144 |
CONFIG_INCLUDED:= |
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
145 |
else |
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
146 |
# 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
|
147 |
ifeq ($(shell uname),FreeBSD) |
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
148 |
SDL-CONFIG:=sdl11-config |
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
149 |
else |
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
150 |
SDL-CONFIG:=sdl-config |
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
151 |
endif |
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
152 |
endif |
0 | 153 |
else |
189
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
154 |
# 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
|
155 |
ifeq ($(shell uname),FreeBSD) |
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
156 |
SDL-CONFIG:=sdl11-config |
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
157 |
else |
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
158 |
SDL-CONFIG:=sdl-config |
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
159 |
endif |
0 | 160 |
endif |
161 |
||
219
adfdf7fad721
(svn r220) Makefile: enables ENABLE_NETWORK by default if no config file is present
bjarni
parents:
189
diff
changeset
|
162 |
# this is used if there aren't any makefile.config |
0 | 163 |
ifndef CONFIG_INCLUDED |
285 | 164 |
# sets network on by default if there aren't any config file |
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
532
diff
changeset
|
165 |
ENABLE_NETWORK:=1 |
285 | 166 |
|
167 |
# paths for make install |
|
168 |
# disabled as they would break it for some (many?) people if they were default |
|
169 |
#PREFIX:=/usr/local |
|
170 |
#DATA_DIR:=share/games/openttd |
|
171 |
#BINARY_DIR:=games |
|
172 |
#PERSONAL_DIR:=.openttd |
|
173 |
#USE_HOMEDIR:=1 |
|
174 |
||
0 | 175 |
-include $(LIB_DETECTION) |
176 |
endif |
|
177 |
||
180
47ee14fe2b35
(svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents:
164
diff
changeset
|
178 |
ifdef SUPRESS_LANG_ERRORS |
47ee14fe2b35
(svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents:
164
diff
changeset
|
179 |
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
|
180 |
endif |
47ee14fe2b35
(svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents:
164
diff
changeset
|
181 |
|
0 | 182 |
ifdef STATIC |
183 |
ifndef WIN32 |
|
184 |
ifndef OSX |
|
185 |
ifndef MORPHOS |
|
186 |
ifndef SKIP_STATIC_CHECK |
|
187 |
$(error Static is only known to work on MorphOS and MacOSX!!! --- Check makefile.config for more info and howto bypass this check) |
|
188 |
endif |
|
189 |
endif |
|
190 |
endif |
|
191 |
endif |
|
192 |
endif |
|
193 |
||
580
be080525ea08
(svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents:
574
diff
changeset
|
194 |
ifdef RELEASE |
be080525ea08
(svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents:
574
diff
changeset
|
195 |
ifdef OSX |
be080525ea08
(svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents:
574
diff
changeset
|
196 |
ifndef STATIC |
be080525ea08
(svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents:
574
diff
changeset
|
197 |
$(error do not make dynamically linked releases. Most users can't use those) |
be080525ea08
(svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents:
574
diff
changeset
|
198 |
endif |
be080525ea08
(svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents:
574
diff
changeset
|
199 |
endif |
be080525ea08
(svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents:
574
diff
changeset
|
200 |
endif |
0 | 201 |
|
202 |
# Force SDL on UNIX platforms |
|
203 |
ifndef WITH_SDL |
|
204 |
ifdef UNIX |
|
549
004bcc2b1033
(svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
bjarni
parents:
543
diff
changeset
|
205 |
ifndef DEDICATED |
004bcc2b1033
(svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
bjarni
parents:
543
diff
changeset
|
206 |
$(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 | 207 |
endif |
208 |
endif |
|
549
004bcc2b1033
(svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
bjarni
parents:
543
diff
changeset
|
209 |
endif |
004bcc2b1033
(svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
bjarni
parents:
543
diff
changeset
|
210 |
|
1029
c6bbfed6fc26
(svn r1530) Makefilefix: now the binary never links to SDL if DEDICATED is set. Thanks to igor2code for making me aware of this issue even through I fixed it in a different way than his patch did. (I made dedicated never link to sdl, nomatter what makefile.config says)
bjarni
parents:
988
diff
changeset
|
211 |
# remove the dependancy for sdl if DEDICALTED is used |
c6bbfed6fc26
(svn r1530) Makefilefix: now the binary never links to SDL if DEDICATED is set. Thanks to igor2code for making me aware of this issue even through I fixed it in a different way than his patch did. (I made dedicated never link to sdl, nomatter what makefile.config says)
bjarni
parents:
988
diff
changeset
|
212 |
ifdef DEDICATED |
c6bbfed6fc26
(svn r1530) Makefilefix: now the binary never links to SDL if DEDICATED is set. Thanks to igor2code for making me aware of this issue even through I fixed it in a different way than his patch did. (I made dedicated never link to sdl, nomatter what makefile.config says)
bjarni
parents:
988
diff
changeset
|
213 |
WITH_SDL:= |
c6bbfed6fc26
(svn r1530) Makefilefix: now the binary never links to SDL if DEDICATED is set. Thanks to igor2code for making me aware of this issue even through I fixed it in a different way than his patch did. (I made dedicated never link to sdl, nomatter what makefile.config says)
bjarni
parents:
988
diff
changeset
|
214 |
endif |
0 | 215 |
|
216 |
||
217 |
############################################################################## |
|
218 |
# |
|
219 |
# Compiler configuration |
|
220 |
# |
|
221 |
||
222 |
# Executable file extension |
|
223 |
ifdef WIN32 |
|
224 |
EXE=.exe |
|
225 |
else |
|
226 |
EXE= |
|
227 |
endif |
|
228 |
||
229 |
# Set output executable names |
|
32 | 230 |
TTD=openttd$(EXE) |
157
dd017fa3bad8
(svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents:
126
diff
changeset
|
231 |
ENDIAN_CHECK=endian_check$(EXE) |
0 | 232 |
STRGEN=strgen/strgen$(EXE) |
233 |
OSXAPP="OpenTTD.app" |
|
234 |
||
235 |
# What revision are we compiling, if we have an idea? |
|
236 |
REV_NUMBER := $(shell if test -d .svn; then svnversion . | tr -dc 0-9; fi) |
|
237 |
||
238 |
ifdef RELEASE |
|
239 |
REV:=$(RELEASE) |
|
240 |
else |
|
450 | 241 |
REV := $(shell if test -d .svn; then svnversion . | awk '{ print "r"$$0 }'; fi) |
0 | 242 |
tmp_test:=$(shell echo "$(REV)" | grep "M" ) |
243 |
ifdef tmp_test |
|
244 |
REV_NUMBER:=1 |
|
245 |
endif |
|
246 |
endif |
|
247 |
||
248 |
ifndef REV_NUMBER |
|
249 |
REV_NUMBER:=0 |
|
250 |
endif |
|
251 |
||
252 |
# MorphOS needs builddate |
|
1289
93edd9c4e1b6
(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
|
253 |
BUILDDATE=`date +%d.%m.%y` |
0 | 254 |
|
255 |
# AMD64 needs a little more settings to work |
|
256 |
ifeq ($(shell uname -m), x86_64) |
|
257 |
endwarnings:=endwarnings |
|
258 |
64_bit_warnings:=64_bit_warnings |
|
157
dd017fa3bad8
(svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents:
126
diff
changeset
|
259 |
BASECFLAGS += -m64 |
0 | 260 |
endif |
261 |
||
262 |
||
263 |
# When calling the compiler, use these flags |
|
264 |
# -g debugging symbols |
|
265 |
# -Wall all warnings |
|
266 |
# -s automatic strip |
|
267 |
# |
|
268 |
# You may also want: |
|
269 |
# -O optimize or -O2 fully optimize (O's above 2 are not recommended) |
|
270 |
# -pg profile - generate profiling data. See "man gprof" to use this. |
|
271 |
||
1069
922f5c7be173
(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
|
272 |
CC_VERSION = $(shell $(CC) -dumpversion | cut -c 1,3) |
1052
53e669371277
(svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents:
1051
diff
changeset
|
273 |
|
53e669371277
(svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents:
1051
diff
changeset
|
274 |
# GNU make can only test for (in)equality |
53e669371277
(svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents:
1051
diff
changeset
|
275 |
# this is a workaround to test for >= |
1069
922f5c7be173
(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
|
276 |
ifeq ($(shell if test $(CC_VERSION) -ge 29; then echo true; fi), true) |
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1069
diff
changeset
|
277 |
CFLAGS += -O -Wall -Wno-multichar -Wsign-compare -Wstrict-prototypes |
1324
ff8b7799b44f
(svn r1828) New warning flag especially for truelight (:<
tron
parents:
1317
diff
changeset
|
278 |
CFLAGS += -Wwrite-strings -Wpointer-arith |
1052
53e669371277
(svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents:
1051
diff
changeset
|
279 |
endif |
1069
922f5c7be173
(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
|
280 |
ifeq ($(shell if test $(CC_VERSION) -ge 30; then echo true; fi), true) |
1052
53e669371277
(svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents:
1051
diff
changeset
|
281 |
CFLAGS += -W -Wno-unused-parameter |
53e669371277
(svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents:
1051
diff
changeset
|
282 |
endif |
1069
922f5c7be173
(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
|
283 |
ifeq ($(shell if test $(CC_VERSION) -ge 34; then echo true; fi), true) |
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1069
diff
changeset
|
284 |
CFLAGS += -Wdeclaration-after-statement -Wold-style-definition |
1052
53e669371277
(svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents:
1051
diff
changeset
|
285 |
endif |
53e669371277
(svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents:
1051
diff
changeset
|
286 |
|
1240
90b225e69c23
(svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents:
1211
diff
changeset
|
287 |
ifdef DEBUG |
1241 | 288 |
CFLAGS += -g -fno-inline -D_DEBUG |
1240
90b225e69c23
(svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents:
1211
diff
changeset
|
289 |
endif |
90b225e69c23
(svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents:
1211
diff
changeset
|
290 |
|
90b225e69c23
(svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents:
1211
diff
changeset
|
291 |
ifdef PROFILE |
90b225e69c23
(svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents:
1211
diff
changeset
|
292 |
CFLAGS += -pg |
90b225e69c23
(svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents:
1211
diff
changeset
|
293 |
LDFLAGS += -pg |
90b225e69c23
(svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents:
1211
diff
changeset
|
294 |
endif |
90b225e69c23
(svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents:
1211
diff
changeset
|
295 |
|
0 | 296 |
CDEFS=-DWITH_REV |
297 |
||
1240
90b225e69c23
(svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents:
1211
diff
changeset
|
298 |
ifndef DEBUG |
90b225e69c23
(svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents:
1211
diff
changeset
|
299 |
ifndef PROFILE |
0 | 300 |
# Release mode |
301 |
ifndef MORPHOS |
|
302 |
# automatical strip breaks under morphos |
|
303 |
BASECFLAGS += -s |
|
304 |
LDFLAGS += -s |
|
305 |
endif |
|
306 |
endif |
|
307 |
||
308 |
ifdef OSX |
|
309 |
# these compilerflags makes the app run as fast as possible without making the app unstable. It works on G3 or newer |
|
1169
30e8657f61d0
(svn r1671) Remove WARNING_DISPLAY, because it contained no warning, but an optimization flag
tron
parents:
1168
diff
changeset
|
310 |
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 | 311 |
else |
312 |
ifdef MORPHOS |
|
1291 | 313 |
BASECFLAGS += -O2 -noixemul -fstrict-aliasing -fexpensive-optimizations |
314 |
BASECFLAGS += -mcpu=604 -fno-inline -mstring -mmultiple |
|
0 | 315 |
else |
1169
30e8657f61d0
(svn r1671) Remove WARNING_DISPLAY, because it contained no warning, but an optimization flag
tron
parents:
1168
diff
changeset
|
316 |
BASECFLAGS += -O2 |
0 | 317 |
endif |
318 |
ifndef PROFILE |
|
319 |
BASECFLAGS += -fomit-frame-pointer |
|
320 |
endif |
|
321 |
endif |
|
322 |
endif |
|
323 |
||
324 |
ifdef STATIC |
|
325 |
ifndef OSX # OSX can't build static if -static flag is used |
|
326 |
LDFLAGS += -static |
|
327 |
endif |
|
328 |
endif |
|
329 |
||
798 | 330 |
# If building on MingW don't link with Cygwin libs |
0 | 331 |
ifdef WIN32 |
798 | 332 |
ifdef CYGWIN |
333 |
BASECFLAGS += -mwin32 |
|
334 |
LDFLAGS += -mwin32 |
|
335 |
endif |
|
0 | 336 |
ifdef MINGW |
337 |
BASECFLAGS += -mno-cygwin |
|
338 |
LDFLAGS += -mno-cygwin |
|
339 |
endif |
|
340 |
endif |
|
341 |
||
342 |
CFLAGS += $(BASECFLAGS) |
|
343 |
||
344 |
ifdef UNIX |
|
345 |
CDEFS += -DUNIX |
|
346 |
endif |
|
347 |
||
421
0b9bdcdfe0c5
(svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents:
413
diff
changeset
|
348 |
ifdef BEOS |
0b9bdcdfe0c5
(svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents:
413
diff
changeset
|
349 |
CDEFS += -DBEOS |
0b9bdcdfe0c5
(svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents:
413
diff
changeset
|
350 |
LDFLAGS += -lmidi -lbe |
0b9bdcdfe0c5
(svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents:
413
diff
changeset
|
351 |
ifdef WITH_NETWORK |
0b9bdcdfe0c5
(svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents:
413
diff
changeset
|
352 |
ifdef BEOS_NET_SERVER |
1051 | 353 |
CDEFS += -DBEOS_NET_SERVER |
354 |
else |
|
355 |
# Zeta needs a few more libraries than R5 |
|
356 |
LDFLAGS += -lbind -lsocket |
|
421
0b9bdcdfe0c5
(svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents:
413
diff
changeset
|
357 |
endif |
0b9bdcdfe0c5
(svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents:
413
diff
changeset
|
358 |
endif |
0b9bdcdfe0c5
(svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents:
413
diff
changeset
|
359 |
endif |
0b9bdcdfe0c5
(svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents:
413
diff
changeset
|
360 |
|
1164
01c12c2f1973
(svn r1666) Move some MorphOS compile flags to a place where they actually belong
tron
parents:
1163
diff
changeset
|
361 |
ifdef MORPHOS |
1291 | 362 |
# -Wstrict-prototypes generates much noise because of system headers |
363 |
CFLAGS += -Wno-strict-prototypes |
|
1164
01c12c2f1973
(svn r1666) Move some MorphOS compile flags to a place where they actually belong
tron
parents:
1163
diff
changeset
|
364 |
endif |
01c12c2f1973
(svn r1666) Move some MorphOS compile flags to a place where they actually belong
tron
parents:
1163
diff
changeset
|
365 |
|
446
20304ea8e94e
(svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents:
421
diff
changeset
|
366 |
ifdef SUNOS |
20304ea8e94e
(svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents:
421
diff
changeset
|
367 |
CDEFS += -DSUNOS |
20304ea8e94e
(svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents:
421
diff
changeset
|
368 |
ifdef WITH_NETWORK |
20304ea8e94e
(svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents:
421
diff
changeset
|
369 |
LDFLAGS += -lnsl -lsocket |
20304ea8e94e
(svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents:
421
diff
changeset
|
370 |
endif |
20304ea8e94e
(svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents:
421
diff
changeset
|
371 |
endif |
20304ea8e94e
(svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents:
421
diff
changeset
|
372 |
|
0 | 373 |
# SDL config |
374 |
ifdef WITH_SDL |
|
375 |
CDEFS += -DWITH_SDL |
|
1254
c3705f146d8a
(svn r1758) Replace `` with $(shell), because the latter is only evaluated once instead of over and over again
tron
parents:
1251
diff
changeset
|
376 |
CFLAGS += $(shell $(SDL-CONFIG) --cflags) |
0 | 377 |
ifdef STATIC |
1254
c3705f146d8a
(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) --static-libs) |
0 | 379 |
else |
1254
c3705f146d8a
(svn r1758) Replace `` with $(shell), because the latter is only evaluated once instead of over and over again
tron
parents:
1251
diff
changeset
|
380 |
LIBS += $(shell $(SDL-CONFIG) --libs) |
0 | 381 |
endif |
382 |
endif |
|
383 |
||
384 |
||
385 |
# zlib config |
|
386 |
ifdef WITH_ZLIB |
|
387 |
CDEFS += -DWITH_ZLIB |
|
388 |
ifdef STATIC |
|
389 |
ifdef OSX |
|
390 |
# zlib is default on OSX, so everybody have it. No need for static linking |
|
391 |
LIBS += -lz |
|
392 |
else |
|
393 |
ifndef STATIC_ZLIB_PATH |
|
394 |
ifndef MANUAL_CONFIG |
|
395 |
# updates makefile.config with the zlib path |
|
396 |
UPDATECONFIG:=upgradeconf |
|
397 |
endif |
|
398 |
TEMP:=$(shell ls /lib 2>/dev/null | grep "zlib.a")$(shell ls /lib 2>/dev/null | grep "libz.a") |
|
399 |
ifdef TEMP |
|
400 |
STATIC_ZLIB_PATH:=/lib/$(TEMP) |
|
401 |
else |
|
402 |
TEMP:=$(shell ls /usr/lib 2>/dev/null | grep "zlib.a")$(shell ls /usr/lib 2>/dev/null | grep "libz.a") |
|
403 |
ifdef TEMP |
|
404 |
STATIC_ZLIB_PATH:=/usr/lib/$(TEMP) |
|
405 |
else |
|
406 |
TEMP:=$(shell ls /usr/local/lib 2>/dev/null | grep "zlib.a")$(shell ls /usr/local/lib 2>/dev/null | grep "libz.a") |
|
407 |
ifdef TEMP |
|
408 |
STATIC_ZLIB_PATH:=/usr/local/lib/$(TEMP) |
|
409 |
endif |
|
410 |
endif |
|
411 |
endif |
|
412 |
endif |
|
413 |
LIBS += $(STATIC_ZLIB_PATH) |
|
414 |
endif |
|
415 |
else |
|
416 |
LIBS += -lz |
|
417 |
endif |
|
418 |
endif |
|
419 |
||
420 |
# libpng config |
|
421 |
ifdef WITH_PNG |
|
422 |
CDEFS += -DWITH_PNG |
|
423 |
# FreeBSD doesn't use libpng-config |
|
424 |
ifdef FREEBSD |
|
425 |
LIBS += -lpng |
|
426 |
else |
|
1254
c3705f146d8a
(svn r1758) Replace `` with $(shell), because the latter is only evaluated once instead of over and over again
tron
parents:
1251
diff
changeset
|
427 |
CFLAGS += $(shell libpng-config --cflags) |
551
48dc69ef0e94
(svn r951) Makefile: fixed missing flag for libpng, which prevented lib detection if SDL was not used
bjarni
parents:
549
diff
changeset
|
428 |
|
0 | 429 |
# seems like older libpng versions are broken and need this |
430 |
PNGCONFIG_FLAGS = --ldflags --libs |
|
431 |
ifdef STATIC |
|
583
3bcdf7a0c2f7
(svn r1003) Mac: reintroduced the static libpng hack in makefile since it appears to be needed in the nightly builds
bjarni
parents:
580
diff
changeset
|
432 |
ifdef OSX |
3bcdf7a0c2f7
(svn r1003) Mac: reintroduced the static libpng hack in makefile since it appears to be needed in the nightly builds
bjarni
parents:
580
diff
changeset
|
433 |
# Seems like we need a tiny hack for OSX static to work |
1254
c3705f146d8a
(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 --prefix)/lib/libpng.a |
583
3bcdf7a0c2f7
(svn r1003) Mac: reintroduced the static libpng hack in makefile since it appears to be needed in the nightly builds
bjarni
parents:
580
diff
changeset
|
435 |
else |
1254
c3705f146d8a
(svn r1758) Replace `` with $(shell), because the latter is only evaluated once instead of over and over again
tron
parents:
1251
diff
changeset
|
436 |
LIBS += $(shell libpng-config --static $(PNGCONFIG_FLAGS)) |
583
3bcdf7a0c2f7
(svn r1003) Mac: reintroduced the static libpng hack in makefile since it appears to be needed in the nightly builds
bjarni
parents:
580
diff
changeset
|
437 |
endif |
0 | 438 |
else |
1254
c3705f146d8a
(svn r1758) Replace `` with $(shell), because the latter is only evaluated once instead of over and over again
tron
parents:
1251
diff
changeset
|
439 |
LIBS += $(shell libpng-config --L_opts $(PNGCONFIG_FLAGS)) |
0 | 440 |
endif |
441 |
endif |
|
442 |
endif |
|
443 |
||
347
892935295937
(svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents:
285
diff
changeset
|
444 |
# enables/disables assert() |
348
959f425dc282
(svn r531) Makefile: made asserts enabled by default
bjarni
parents:
347
diff
changeset
|
445 |
ifdef DISABLE_ASSERTS |
959f425dc282
(svn r531) Makefile: made asserts enabled by default
bjarni
parents:
347
diff
changeset
|
446 |
CFLAGS += -DNDEBUG |
959f425dc282
(svn r531) Makefile: made asserts enabled by default
bjarni
parents:
347
diff
changeset
|
447 |
endif |
959f425dc282
(svn r531) Makefile: made asserts enabled by default
bjarni
parents:
347
diff
changeset
|
448 |
|
959f425dc282
(svn r531) Makefile: made asserts enabled by default
bjarni
parents:
347
diff
changeset
|
449 |
# automatically disables asserts for release |
959f425dc282
(svn r531) Makefile: made asserts enabled by default
bjarni
parents:
347
diff
changeset
|
450 |
ifdef RELEASE |
347
892935295937
(svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents:
285
diff
changeset
|
451 |
ifndef ENABLE_ASSERTS |
892935295937
(svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents:
285
diff
changeset
|
452 |
CFLAGS += -DNDEBUG |
892935295937
(svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents:
285
diff
changeset
|
453 |
endif |
348
959f425dc282
(svn r531) Makefile: made asserts enabled by default
bjarni
parents:
347
diff
changeset
|
454 |
endif |
0 | 455 |
|
456 |
ifdef TRANSLATOR |
|
457 |
STRGEN_FLAGS=-t |
|
458 |
else |
|
459 |
STRGEN_FLAGS= |
|
460 |
endif |
|
461 |
||
462 |
||
463 |
# MIDI setup |
|
464 |
ifdef OSX |
|
465 |
ifndef MIDI |
|
466 |
MIDI:=$(OSXAPP)/contents/macos/track_starter |
|
467 |
endif |
|
561
e3b9689745ab
(svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents:
551
diff
changeset
|
468 |
ifndef SECOND_DATA_PATH |
e3b9689745ab
(svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents:
551
diff
changeset
|
469 |
SECOND_DATA_PATH:="$(OSXAPP)/contents/data/" |
e3b9689745ab
(svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents:
551
diff
changeset
|
470 |
endif |
e3b9689745ab
(svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents:
551
diff
changeset
|
471 |
ifndef CUSTOM_LANG_DIR |
e3b9689745ab
(svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents:
551
diff
changeset
|
472 |
CUSTOM_LANG_DIR:="$(OSXAPP)/contents/lang/" |
e3b9689745ab
(svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents:
551
diff
changeset
|
473 |
endif |
0 | 474 |
endif |
475 |
||
476 |
ifdef MIDI |
|
477 |
CDEFS += -DEXTERNAL_PLAYER=\"$(MIDI)\" |
|
478 |
ifdef MIDI_ARG |
|
479 |
CDEFS += -DMIDI_ARG=\"$(MIDI_ARG)\" |
|
480 |
endif |
|
481 |
endif |
|
482 |
||
483 |
ifdef WITH_NETWORK |
|
484 |
CDEFS += -DENABLE_NETWORK |
|
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
532
diff
changeset
|
485 |
ifdef QNX |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
532
diff
changeset
|
486 |
LIBS += -lsocket |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
532
diff
changeset
|
487 |
endif |
0 | 488 |
ifdef UNIX |
489 |
ifndef OSX |
|
490 |
ifndef MORPHOS |
|
491 |
# this have caused problems on many platforms and disabling it didn't break anything |
|
492 |
# now we test if disabling it as a general breaks it for anybody |
|
493 |
#LIBS += -lresolv |
|
494 |
endif |
|
495 |
endif |
|
496 |
endif |
|
497 |
endif |
|
498 |
||
561
e3b9689745ab
(svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents:
551
diff
changeset
|
499 |
|
e3b9689745ab
(svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents:
551
diff
changeset
|
500 |
ifdef SECOND_DATA_PATH |
e3b9689745ab
(svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents:
551
diff
changeset
|
501 |
CDEFS += -DSECOND_DATA_DIR=\"$(SECOND_DATA_PATH)/\" |
e3b9689745ab
(svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents:
551
diff
changeset
|
502 |
endif |
e3b9689745ab
(svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents:
551
diff
changeset
|
503 |
|
e3b9689745ab
(svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents:
551
diff
changeset
|
504 |
ifdef CUSTOM_LANG_DIR |
e3b9689745ab
(svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents:
551
diff
changeset
|
505 |
CDEFS += -DCUSTOM_LANG_DIR=\"$(CUSTOM_LANG_DIR)/\" |
e3b9689745ab
(svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents:
551
diff
changeset
|
506 |
endif |
e3b9689745ab
(svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents:
551
diff
changeset
|
507 |
|
0 | 508 |
ifdef WITH_DIRECTMUSIC |
509 |
CDEFS += -DWIN32_ENABLE_DIRECTMUSIC_SUPPORT |
|
510 |
endif |
|
511 |
||
512 |
ifdef WIN32 |
|
513 |
LIBS += -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32 -lstdc++ |
|
514 |
TTDLDFLAGS += -Wl,--subsystem,windows |
|
515 |
endif |
|
516 |
||
517 |
# sets up the paths for use for make install |
|
285 | 518 |
ifdef INSTALL |
519 |
# We use _PREFIXED vars here, so the paths are recalculated every time, and |
|
520 |
# the prefix is not prepended in the makefile config |
|
521 |
BINARY_DIR_PREFIXED:=$(PREFIX)/$(BINARY_DIR) |
|
522 |
DATA_DIR_PREFIXED:=$(PREFIX)/$(DATA_DIR) |
|
523 |
# We use _INSTALL vars here, these vars are the locations where the files will |
|
524 |
# be installed |
|
525 |
DATA_DIR_INSTALL=$(DEST_DIR)/$(DATA_DIR_PREFIXED) |
|
526 |
BINARY_DIR_INSTALL=$(DEST_DIR)/$(BINARY_DIR_PREFIXED) |
|
527 |
# Let the code know where to find stuff |
|
528 |
ifdef DATA_DIR_PREFIXED |
|
529 |
CDEFS += -DGAME_DATA_DIR=\"$(DATA_DIR_PREFIXED)/\" |
|
0 | 530 |
endif |
285 | 531 |
|
532 |
ifdef PERSONAL_DIR |
|
533 |
CDEFS += -DPERSONAL_DIR=\"$(PERSONAL_DIR)/\" |
|
534 |
endif |
|
535 |
||
536 |
ifdef USE_HOMEDIR |
|
537 |
CDEFS += -DUSE_HOMEDIR |
|
538 |
endif |
|
0 | 539 |
endif |
540 |
||
541 |
############################################################################## |
|
542 |
# |
|
543 |
# What to compile |
|
544 |
# (users do not want to modify anything below) |
|
545 |
# |
|
546 |
||
547 |
||
548 |
### Sources |
|
549 |
||
677 | 550 |
C_SOURCES += ai.c |
551 |
C_SOURCES += ai_build.c |
|
552 |
C_SOURCES += ai_new.c |
|
553 |
C_SOURCES += ai_pathfinder.c |
|
554 |
C_SOURCES += ai_shared.c |
|
555 |
C_SOURCES += aircraft_cmd.c |
|
556 |
C_SOURCES += aircraft_gui.c |
|
557 |
C_SOURCES += airport.c |
|
558 |
C_SOURCES += airport_gui.c |
|
559 |
C_SOURCES += aystar.c |
|
560 |
C_SOURCES += bridge_gui.c |
|
561 |
C_SOURCES += callback_table.c |
|
562 |
C_SOURCES += clear_cmd.c |
|
563 |
C_SOURCES += command.c |
|
564 |
C_SOURCES += console.c |
|
565 |
C_SOURCES += console_cmds.c |
|
1299
0a6510cc889b
(svn r1803) Move debugging stuff into files of it's own
tron
parents:
1292
diff
changeset
|
566 |
C_SOURCES += debug.c |
677 | 567 |
C_SOURCES += dedicated.c |
1313
bba6afb8a995
(svn r1817) -Codechange: Moved depot-functions to depot.c
truelight
parents:
1299
diff
changeset
|
568 |
C_SOURCES += depot.c |
677 | 569 |
C_SOURCES += disaster_cmd.c |
570 |
C_SOURCES += dock_gui.c |
|
571 |
C_SOURCES += dummy_land.c |
|
572 |
C_SOURCES += economy.c |
|
573 |
C_SOURCES += engine.c |
|
574 |
C_SOURCES += engine_gui.c |
|
575 |
C_SOURCES += fileio.c |
|
576 |
C_SOURCES += gfx.c |
|
577 |
C_SOURCES += graph_gui.c |
|
578 |
C_SOURCES += newgrf.c |
|
579 |
C_SOURCES += industry_cmd.c |
|
580 |
C_SOURCES += industry_gui.c |
|
581 |
C_SOURCES += intro_gui.c |
|
582 |
C_SOURCES += landscape.c |
|
583 |
C_SOURCES += main_gui.c |
|
679
e959706a3e4d
(svn r1117) Move map arrays and some related macros into their own files map.c and map.h
tron
parents:
677
diff
changeset
|
584 |
C_SOURCES += map.c |
677 | 585 |
C_SOURCES += md5.c |
586 |
C_SOURCES += minilzo.c |
|
587 |
C_SOURCES += misc.c |
|
588 |
C_SOURCES += misc_cmd.c |
|
589 |
C_SOURCES += misc_gui.c |
|
590 |
C_SOURCES += music_gui.c |
|
591 |
C_SOURCES += namegen.c |
|
592 |
C_SOURCES += network.c |
|
593 |
C_SOURCES += network_client.c |
|
594 |
C_SOURCES += network_data.c |
|
595 |
C_SOURCES += network_gamelist.c |
|
596 |
C_SOURCES += network_gui.c |
|
597 |
C_SOURCES += network_server.c |
|
598 |
C_SOURCES += network_udp.c |
|
599 |
C_SOURCES += news_gui.c |
|
1247 | 600 |
C_SOURCES += npf.c |
677 | 601 |
C_SOURCES += oldloader.c |
602 |
C_SOURCES += order_cmd.c |
|
603 |
C_SOURCES += order_gui.c |
|
604 |
C_SOURCES += pathfind.c |
|
605 |
C_SOURCES += player_gui.c |
|
606 |
C_SOURCES += players.c |
|
1259
6dc9a1521c00
(svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents:
1257
diff
changeset
|
607 |
C_SOURCES += pool.c |
677 | 608 |
C_SOURCES += queue.c |
609 |
C_SOURCES += rail_cmd.c |
|
610 |
C_SOURCES += rail_gui.c |
|
611 |
C_SOURCES += rev.c |
|
612 |
C_SOURCES += road_cmd.c |
|
613 |
C_SOURCES += road_gui.c |
|
614 |
C_SOURCES += roadveh_cmd.c |
|
615 |
C_SOURCES += roadveh_gui.c |
|
616 |
C_SOURCES += saveload.c |
|
617 |
C_SOURCES += screenshot.c |
|
618 |
C_SOURCES += settings.c |
|
619 |
C_SOURCES += settings_gui.c |
|
620 |
C_SOURCES += ship_cmd.c |
|
621 |
C_SOURCES += ship_gui.c |
|
988
2482369a61ff
(svn r1486) -Codechange: moved all 'signs' stuff to signs.c/h and prepared it for
truelight
parents:
978
diff
changeset
|
622 |
C_SOURCES += signs.c |
677 | 623 |
C_SOURCES += smallmap_gui.c |
624 |
C_SOURCES += sound.c |
|
625 |
C_SOURCES += sprite.c |
|
626 |
C_SOURCES += spritecache.c |
|
627 |
C_SOURCES += station_cmd.c |
|
628 |
C_SOURCES += station_gui.c |
|
1317
f382f1b439c7
(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
|
629 |
C_SOURCES += string.c |
677 | 630 |
C_SOURCES += strings.c |
631 |
C_SOURCES += subsidy_gui.c |
|
632 |
C_SOURCES += terraform_gui.c |
|
633 |
C_SOURCES += texteff.c |
|
1211 | 634 |
C_SOURCES += tile.c |
677 | 635 |
C_SOURCES += town_cmd.c |
636 |
C_SOURCES += town_gui.c |
|
637 |
C_SOURCES += train_cmd.c |
|
638 |
C_SOURCES += train_gui.c |
|
639 |
C_SOURCES += tree_cmd.c |
|
640 |
C_SOURCES += ttd.c |
|
641 |
C_SOURCES += tunnelbridge_cmd.c |
|
642 |
C_SOURCES += unmovable_cmd.c |
|
643 |
C_SOURCES += vehicle.c |
|
644 |
C_SOURCES += vehicle_gui.c |
|
645 |
C_SOURCES += viewport.c |
|
646 |
C_SOURCES += water_cmd.c |
|
647 |
C_SOURCES += widget.c |
|
648 |
C_SOURCES += window.c |
|
649 |
||
421
0b9bdcdfe0c5
(svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents:
413
diff
changeset
|
650 |
CXX_SOURCES = |
0 | 651 |
|
652 |
ifdef WITH_SDL |
|
421
0b9bdcdfe0c5
(svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents:
413
diff
changeset
|
653 |
C_SOURCES += sdl.c |
0 | 654 |
endif |
655 |
||
656 |
ifdef WIN32 |
|
421
0b9bdcdfe0c5
(svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents:
413
diff
changeset
|
657 |
C_SOURCES += win32.c w32dm.c |
0 | 658 |
else |
421
0b9bdcdfe0c5
(svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents:
413
diff
changeset
|
659 |
C_SOURCES += extmidi.c unix.c |
0 | 660 |
endif |
661 |
||
1167
d8b7601118cf
(svn r1669) Rename all ttd_XXX to just XXX, because we already know who we are (;
tron
parents:
1164
diff
changeset
|
662 |
OBJS = $(C_SOURCES:%.c=%.o) $(CXX_SOURCES:%.cpp=%.o) |
421
0b9bdcdfe0c5
(svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents:
413
diff
changeset
|
663 |
|
0b9bdcdfe0c5
(svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents:
413
diff
changeset
|
664 |
ifdef BEOS |
532 | 665 |
CXX_SOURCES += os/beos/bemidi.cpp |
666 |
CFLAGS += -I. |
|
421
0b9bdcdfe0c5
(svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents:
413
diff
changeset
|
667 |
endif |
0 | 668 |
|
669 |
ifdef WIN32 |
|
670 |
# Resource file |
|
1167
d8b7601118cf
(svn r1669) Rename all ttd_XXX to just XXX, because we already know who we are (;
tron
parents:
1164
diff
changeset
|
671 |
OBJS += winres.o |
0 | 672 |
endif |
673 |
||
674 |
ifdef WITH_DIRECTMUSIC |
|
421
0b9bdcdfe0c5
(svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents:
413
diff
changeset
|
675 |
CXX_SOURCES += w32dm2.cpp |
0 | 676 |
endif |
677 |
||
1170
1cd3103acd66
(svn r1672) Simplify dependency tracking and actually implement it for C++ files, too.
tron
parents:
1169
diff
changeset
|
678 |
DEPS = $(OBJS:%.o=.deps/%.d) |
0 | 679 |
|
680 |
LANG_TXT = $(filter-out %.unfinished.txt,$(wildcard lang/*.txt)) |
|
681 |
LANGS = $(LANG_TXT:%.txt=%.lng) |
|
682 |
||
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
|
683 |
|
0 | 684 |
############################################################################## |
685 |
# |
|
686 |
# Targets |
|
687 |
# |
|
688 |
||
689 |
||
690 |
### Normal build rules |
|
691 |
||
692 |
||
693 |
ifdef OSX |
|
694 |
OSX:=OSX |
|
695 |
endif |
|
696 |
||
697 |
||
475
d9b87f0ffdb4
(svn r726) The OpenTTD binary doesn't depend on the language files, so move this dependency to the all target
tron
parents:
474
diff
changeset
|
698 |
all: endian.h $(UPDATECONFIG) $(LANGS) $(TTD) $(OSX) $(endwarnings) |
0 | 699 |
|
157
dd017fa3bad8
(svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents:
126
diff
changeset
|
700 |
endian.h: $(ENDIAN_CHECK) |
1118 | 701 |
@echo '===> Testing endianness' |
702 |
@./$(ENDIAN_CHECK) > $@ |
|
157
dd017fa3bad8
(svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents:
126
diff
changeset
|
703 |
|
dd017fa3bad8
(svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents:
126
diff
changeset
|
704 |
$(ENDIAN_CHECK): endian_check.c |
1118 | 705 |
@echo '===> Compiling and Linking $@' |
706 |
@$(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
|
707 |
|
0 | 708 |
|
1167
d8b7601118cf
(svn r1669) Rename all ttd_XXX to just XXX, because we already know who we are (;
tron
parents:
1164
diff
changeset
|
709 |
$(TTD): table/strings.h $(OBJS) $(MAKE_CONFIG) |
1411
53935a3bcea0
(svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents:
1324
diff
changeset
|
710 |
@if [ ! "$(VERBOSE)" ]; then \ |
53935a3bcea0
(svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents:
1324
diff
changeset
|
711 |
echo '===> Linking $@'; \ |
53935a3bcea0
(svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents:
1324
diff
changeset
|
712 |
else \ |
53935a3bcea0
(svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents:
1324
diff
changeset
|
713 |
echo $(CC) $(LDFLAGS) $(TTDLDFLAGS) $(OBJS) $(LIBS) -o $@; \ |
53935a3bcea0
(svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents:
1324
diff
changeset
|
714 |
fi |
1168
f7af0e482df0
(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
|
715 |
@$(CC) $(LDFLAGS) $(TTDLDFLAGS) $(OBJS) $(LIBS) -o $@ |
0 | 716 |
|
728
c8728c17f505
(svn r1180) Makefile: fixed dependancies so the flag -j can be used. It makes the compilation process into more than one job which makes it able to benefit from multiple CPUs. Using -j without setting a limit of jobs (like -j2) is not a great idea (thanks to ln-- for reporting the need for this one)
bjarni
parents:
679
diff
changeset
|
717 |
$(OSX): $(TTD) |
610
e70910461431
(svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents:
602
diff
changeset
|
718 |
@rm -fr "$(OSXAPP)" |
e70910461431
(svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents:
602
diff
changeset
|
719 |
@mkdir -p "$(OSXAPP)"/Contents/MacOS |
e70910461431
(svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents:
602
diff
changeset
|
720 |
@mkdir -p "$(OSXAPP)"/Contents/Resources |
e70910461431
(svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents:
602
diff
changeset
|
721 |
@mkdir -p "$(OSXAPP)"/Contents/Data |
e70910461431
(svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents:
602
diff
changeset
|
722 |
@mkdir -p "$(OSXAPP)"/Contents/Lang |
e70910461431
(svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents:
602
diff
changeset
|
723 |
@echo "APPL????" > "$(OSXAPP)"/Contents/PkgInfo |
1099
0b4f24a38642
(svn r1600) Mac: applied the new icon to the mac binary file
bjarni
parents:
1093
diff
changeset
|
724 |
@cp os/macos/openttd.icns "$(OSXAPP)"/Contents/Resources/openttd.icns |
610
e70910461431
(svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents:
602
diff
changeset
|
725 |
@os/macos/plistgen.sh "$(OSXAPP)" "$(REV)" |
e70910461431
(svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents:
602
diff
changeset
|
726 |
@cp os/macos/track_starter "$(OSXAPP)"/contents/macos |
0 | 727 |
@ls os/macos | grep -q "\.class" || \ |
728 |
javac os/macos/OpenTTDMidi.java |
|
610
e70910461431
(svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents:
602
diff
changeset
|
729 |
@cp os/macos/OpenTTDMidi.class "$(OSXAPP)"/contents/macos |
e70910461431
(svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents:
602
diff
changeset
|
730 |
@cp data/* "$(OSXAPP)"/Contents/data/ |
e70910461431
(svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents:
602
diff
changeset
|
731 |
@cp lang/*.lng "$(OSXAPP)"/Contents/lang/ |
e70910461431
(svn r1034) Makefile: fixed issue where it would not compile if RELEASE string contained space. Did the same fix to OSXAPP, just in case it's changed to something containing space at a later date
bjarni
parents:
602
diff
changeset
|
732 |
@cp $(TTD) "$(OSXAPP)"/Contents/MacOS/$(TTD) |
0 | 733 |
|
734 |
$(endwarnings): $(64_bit_warnings) |
|
735 |
||
736 |
$(64_bit_warnings): |
|
737 |
$(warning 64 bit CPUs will get some 64 bit specific bugs!) |
|
738 |
$(warning If you see any bugs, include in your bug report that you use a 64 bit CPU) |
|
739 |
||
728
c8728c17f505
(svn r1180) Makefile: fixed dependancies so the flag -j can be used. It makes the compilation process into more than one job which makes it able to benefit from multiple CPUs. Using -j without setting a limit of jobs (like -j2) is not a great idea (thanks to ln-- for reporting the need for this one)
bjarni
parents:
679
diff
changeset
|
740 |
$(STRGEN): strgen/strgen.c endian.h |
1118 | 741 |
@echo '===> Compiling and Linking $@' |
742 |
@$(CC) $(BASECFLAGS) $(CDEFS) -o $@ $< |
|
0 | 743 |
|
474 | 744 |
table/strings.h: lang/english.txt $(STRGEN) |
1118 | 745 |
@echo '===> Generating $@' |
746 |
@$(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
|
747 |
|
476
ad012336ed61
(svn r727) The langauge files depend on english.txt, not strings.h
tron
parents:
475
diff
changeset
|
748 |
lang/%.lng: lang/%.txt $(STRGEN) lang/english.txt |
1118 | 749 |
@echo '===> Compiling language $(*F)' |
750 |
@$(STRGEN) $(STRGEN_FLAGS) $< $(LANG_ERRORS) |
|
0 | 751 |
|
752 |
winres.o: ttd.rc |
|
1118 | 753 |
@echo '===> Compiling resource $<' |
754 |
@windres -o $@ $< |
|
0 | 755 |
|
770
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
756 |
ifdef MORPHOS |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
757 |
release: all |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
758 |
@rm -fr "/t/openttd-$(RELEASE)-morphos.lha" |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
759 |
@mkdir -p "/t/" |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
760 |
@mkdir -p "/t/openttd-$(RELEASE)-morphos" |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
761 |
@mkdir -p "/t/openttd-$(RELEASE)-morphos/docs" |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
762 |
@mkdir -p "/t/openttd-$(RELEASE)-morphos/data" |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
763 |
@mkdir -p "/t/openttd-$(RELEASE)-morphos/lang" |
1158
3478ebfecfe1
(svn r1659) Makefile: added scenario to mac and MorphOS release scripts
bjarni
parents:
1148
diff
changeset
|
764 |
@mkdir -p "/t/openttd-$(RELEASE)-morphos/scenario" |
770
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
765 |
@cp -R $(TTD) "/t/openttd-$(RELEASE)-morphos/" |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
766 |
@cp data/* "/t/openttd-$(RELEASE)-morphos/data/" |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
767 |
@cp lang/*.lng "/t/openttd-$(RELEASE)-morphos/lang/" |
1158
3478ebfecfe1
(svn r1659) Makefile: added scenario to mac and MorphOS release scripts
bjarni
parents:
1148
diff
changeset
|
768 |
@cp scenario/* "/t/openttd-$(RELEASE)-morphos/scenario/" |
770
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
769 |
@cp readme.txt "/t/openttd-$(RELEASE)-morphos/docs/ReadMe" |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
770 |
@cp docs/console.txt "/t/openttd-$(RELEASE)-morphos/docs/Console" |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
771 |
@cp COPYING "/t/openttd-$(RELEASE)-morphos/docs/" |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
772 |
@cp changelog.txt "/t/openttd-$(RELEASE)-morphos/docs/ChangeLog" |
1148
c7925e9e1182
(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
|
773 |
@cp known-bugs.txt "/t/openttd-$(RELEASE)-morphos/docs/known-bugs.txt" |
770
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
774 |
@cp os/morphos/icons/openttd.info "/t/openttd-$(RELEASE)-morphos/$(TTD).info" |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
775 |
@cp os/morphos/icons/docs.info "/t/openttd-$(RELEASE)-morphos/docs.info" |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
776 |
@cp os/morphos/icons/drawer.info "/t/openttd-$(RELEASE)-morphos.info" |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
777 |
@cp os/morphos/icons/document.info "/t/openttd-$(RELEASE)-morphos/docs/ReadMe.info" |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
778 |
@cp os/morphos/icons/document.info "/t/openttd-$(RELEASE)-morphos/docs/Console.info" |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
779 |
@cp os/morphos/icons/document.info "/t/openttd-$(RELEASE)-morphos/docs/COPYING.info" |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
780 |
@cp os/morphos/icons/document.info "/t/openttd-$(RELEASE)-morphos/docs/ChangeLog.info" |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
781 |
@strip --strip-all --strip-unneeded --remove-section .comment "/t/openttd-$(RELEASE)-morphos/$(TTD)" |
1251 | 782 |
@lha a -r "t:openttd-$(RELEASE)-morphos.lha" "t:openttd-$(RELEASE)-morphos" |
770
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
783 |
@lha a "t:openttd-$(RELEASE)-morphos.lha" "t:openttd-$(RELEASE)-morphos.info" |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
784 |
@rm -fr "/t/openttd-$(RELEASE)-morphos" |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
785 |
@rm -fr "/t/openttd-$(RELEASE)-morphos.info" |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
786 |
@echo "Release archive can be found in RAM:t/ now." |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
787 |
|
1251 | 788 |
.PHONY: release |
770
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
789 |
endif |
89dab23f04ca
(svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents:
730
diff
changeset
|
790 |
|
563
f60fe5a7d56f
(svn r972) Makefile: added make release (currently only works on mac)
bjarni
parents:
561
diff
changeset
|
791 |
ifdef OSX |
f60fe5a7d56f
(svn r972) Makefile: added make release (currently only works on mac)
bjarni
parents:
561
diff
changeset
|
792 |
release: all |
565
54f509007e3b
(svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents:
564
diff
changeset
|
793 |
@mkdir -p "OpenTTD $(RELEASE)" |
54f509007e3b
(svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents:
564
diff
changeset
|
794 |
@mkdir -p "OpenTTD $(RELEASE)"/docs |
1158
3478ebfecfe1
(svn r1659) Makefile: added scenario to mac and MorphOS release scripts
bjarni
parents:
1148
diff
changeset
|
795 |
@mkdir -p "OpenTTD $(RELEASE)"/scenario |
565
54f509007e3b
(svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents:
564
diff
changeset
|
796 |
@cp -R $(OSXAPP) "OpenTTD $(RELEASE)"/ |
54f509007e3b
(svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents:
564
diff
changeset
|
797 |
@cp docs/OSX_where_did_the_package_go.txt "OpenTTD $(RELEASE)"/Where\ did\ the\ package\ go.txt |
54f509007e3b
(svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents:
564
diff
changeset
|
798 |
@cp readme.txt "OpenTTD $(RELEASE)"/docs/ |
54f509007e3b
(svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents:
564
diff
changeset
|
799 |
@cp docs/README_if_game_crashed_on_OSX.txt "OpenTTD $(RELEASE)"/docs/readme\ if\ crashed\ on\ OSX.txt |
54f509007e3b
(svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents:
564
diff
changeset
|
800 |
@cp docs/console.txt "OpenTTD $(RELEASE)"/docs/ |
54f509007e3b
(svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents:
564
diff
changeset
|
801 |
@cp COPYING "OpenTTD $(RELEASE)"/docs/ |
54f509007e3b
(svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents:
564
diff
changeset
|
802 |
@cp changelog.txt "OpenTTD $(RELEASE)"/docs/ |
54f509007e3b
(svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents:
564
diff
changeset
|
803 |
@cp docs/README_if_game_crashed_on_OSX.txt "OpenTTD $(RELEASE)"/docs/ |
54f509007e3b
(svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents:
564
diff
changeset
|
804 |
@cp os/macos/*.webloc "OpenTTD $(RELEASE)" |
1148
c7925e9e1182
(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
|
805 |
@cp known-bugs.txt "OpenTTD $(RELEASE)"/known-bugs.txt |
1158
3478ebfecfe1
(svn r1659) Makefile: added scenario to mac and MorphOS release scripts
bjarni
parents:
1148
diff
changeset
|
806 |
@cp scenario/* "OpenTTD $(RELEASE)"/scenario/ |
590
1033437d21ef
(svn r1011) Makefile, mac: added absolute path to hdiutil (default location) to fix the path issues when building nightly builds with a cronjob
bjarni
parents:
589
diff
changeset
|
807 |
@/usr/bin/hdiutil create -ov -format UDZO -srcfolder "OpenTTD $(RELEASE)" openttd-"$(RELEASE)"-osx.dmg |
565
54f509007e3b
(svn r974) Makefile: fixed issue in make release and nightly_build, which caused failures if RELEASE contained spaces
bjarni
parents:
564
diff
changeset
|
808 |
@rm -fr "OpenTTD $(RELEASE)" |
563
f60fe5a7d56f
(svn r972) Makefile: added make release (currently only works on mac)
bjarni
parents:
561
diff
changeset
|
809 |
|
564
39e0d73fa19d
(svn r973) Makefile: added make nightly_build (only on mac)
bjarni
parents:
563
diff
changeset
|
810 |
nightly_build: all |
574
acaa37f42d88
(svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents:
569
diff
changeset
|
811 |
@mkdir -p "OpenTTD_nightly_$(DATE)" |
acaa37f42d88
(svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents:
569
diff
changeset
|
812 |
@mkdir -p "OpenTTD_nightly_$(DATE)"/docs |
acaa37f42d88
(svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents:
569
diff
changeset
|
813 |
@cp -R $(OSXAPP) "OpenTTD_nightly_$(DATE)"/ |
acaa37f42d88
(svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents:
569
diff
changeset
|
814 |
@cp docs/OSX_where_did_the_package_go.txt "OpenTTD_nightly_$(DATE)"/Where\ did\ the\ package\ go.txt |
acaa37f42d88
(svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents:
569
diff
changeset
|
815 |
@cp readme.txt "OpenTTD_nightly_$(DATE)"/docs/ |
acaa37f42d88
(svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents:
569
diff
changeset
|
816 |
@cp docs/README_if_game_crashed_on_OSX.txt "OpenTTD_nightly_$(DATE)"/docs/readme\ if\ crashed\ on\ OSX.txt |
acaa37f42d88
(svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents:
569
diff
changeset
|
817 |
@cp docs/console.txt "OpenTTD_nightly_$(DATE)"/docs/ |
acaa37f42d88
(svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents:
569
diff
changeset
|
818 |
@cp COPYING "OpenTTD_nightly_$(DATE)"/docs/ |
acaa37f42d88
(svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents:
569
diff
changeset
|
819 |
@cp revisionlog.txt "OpenTTD_nightly_$(DATE)"/revisionlog.txt |
acaa37f42d88
(svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents:
569
diff
changeset
|
820 |
@cp docs/README_if_game_crashed_on_OSX.txt "OpenTTD_nightly_$(DATE)"/docs/ |
acaa37f42d88
(svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents:
569
diff
changeset
|
821 |
@cp os/macos/*.webloc "OpenTTD_nightly_$(DATE)"/ |
590
1033437d21ef
(svn r1011) Makefile, mac: added absolute path to hdiutil (default location) to fix the path issues when building nightly builds with a cronjob
bjarni
parents:
589
diff
changeset
|
822 |
@/usr/bin/hdiutil create -ov -format UDZO -srcfolder "OpenTTD_nightly_$(DATE)" openttd-nightly-"$(DATE)".dmg |
574
acaa37f42d88
(svn r985) Makefile: repaired issue in make release (OSX)
bjarni
parents:
569
diff
changeset
|
823 |
@rm -fr "OpenTTD_nightly_$(DATE)" |
564
39e0d73fa19d
(svn r973) Makefile: added make nightly_build (only on mac)
bjarni
parents:
563
diff
changeset
|
824 |
|
39e0d73fa19d
(svn r973) Makefile: added make nightly_build (only on mac)
bjarni
parents:
563
diff
changeset
|
825 |
.PHONY: release nightly_build |
563
f60fe5a7d56f
(svn r972) Makefile: added make release (currently only works on mac)
bjarni
parents:
561
diff
changeset
|
826 |
endif |
0 | 827 |
|
828 |
rev.c: FORCE |
|
829 |
@# setting the revision number in a place, there the binary can read it |
|
615
3a22cf31bb29
(svn r1039) Makefile: now RELEASE flag can contain () too
bjarni
parents:
610
diff
changeset
|
830 |
@echo 'const char _openttd_revision[] = "$(REV)";' >>rev.c.new |
0 | 831 |
@echo 'const int _revision_number = $(REV_NUMBER);' >>rev.c.new |
832 |
@# some additions for MorphOS versions tag |
|
833 |
@echo '#ifdef __MORPHOS__' >>rev.c.new |
|
615
3a22cf31bb29
(svn r1039) Makefile: now RELEASE flag can contain () too
bjarni
parents:
610
diff
changeset
|
834 |
@echo 'const char morphos_versions_tag[] = "\\0$$VER: OpenTTD $(REV) ('${BUILDDATE}') © OpenTTD Team [MorphOS, PowerPC]";' >>rev.c.new |
0 | 835 |
@echo '#endif' >>rev.c.new |
836 |
@# Only update the real rev.c if it actually changed, to prevent |
|
837 |
@# useless rebuilds. |
|
838 |
@cmp -s rev.c rev.c.new 2>/dev/null || mv rev.c.new rev.c |
|
839 |
@rm -f rev.c.new |
|
840 |
||
841 |
FORCE: |
|
842 |
||
843 |
||
844 |
clean: |
|
1118 | 845 |
@echo '===> Cleaning up' |
1167
d8b7601118cf
(svn r1669) Rename all ttd_XXX to just XXX, because we already know who we are (;
tron
parents:
1164
diff
changeset
|
846 |
@rm -rf .deps *~ $(TTD) $(STRGEN) core table/strings.h $(LANGS) $(OBJS) endian.h $(ENDIAN_CHECK) |
0 | 847 |
|
848 |
mrproper: clean |
|
1118 | 849 |
@rm -rf $(MAKE_CONFIG) |
0 | 850 |
|
851 |
ifndef OSX |
|
852 |
ifndef MORPHOS |
|
853 |
install: |
|
285 | 854 |
ifeq ($(INSTALL),) |
855 |
$(error make install is highly experimental at his state and not\ |
|
0 | 856 |
tested very much - use at your own risk - to use run \"make install INSTALL:=1\" - make sure makefile.config\ |
857 |
is set correctly up - run \"make upgradeconf\") |
|
285 | 858 |
endif |
859 |
||
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
532
diff
changeset
|
860 |
ifeq ($(PREFIX), ) |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
532
diff
changeset
|
861 |
$(error no prefix set - check makefile.config) |
285 | 862 |
endif |
863 |
# We compare against the non prefixed version here, so we won't install |
|
864 |
# if only the prefix has been set |
|
865 |
ifeq ($(DATA_DIR),) |
|
866 |
$(error no data path set - check makefile.config) |
|
867 |
endif |
|
868 |
ifeq ($(BINARY_DIR),) |
|
869 |
$(error no binary path set - check makefile.config) |
|
870 |
endif |
|
871 |
# We'll install in $DEST_DIR instead of root if it is set (we don't |
|
872 |
# care about extra /'s |
|
873 |
mkdir -p $(DATA_DIR_INSTALL)/lang |
|
874 |
mkdir -p $(DATA_DIR_INSTALL)/data |
|
875 |
mkdir -p $(DATA_DIR_INSTALL)/gm |
|
876 |
mkdir -p $(BINARY_DIR_INSTALL) |
|
1160
467d3ff0ad97
(svn r1661) Makefile: added scenario to make install
bjarni
parents:
1158
diff
changeset
|
877 |
mkdir -p $(PERSONAL_DIR)/scenario |
285 | 878 |
cp $(TTD) $(BINARY_DIR_INSTALL) |
879 |
cp lang/*.lng $(DATA_DIR_INSTALL)/lang |
|
880 |
cp data/*.grf $(DATA_DIR_INSTALL)/data |
|
881 |
cp data/opntitle.dat $(DATA_DIR_INSTALL)/data |
|
882 |
cp media/openttd.64.png $(DATA_DIR_INSTALL) |
|
1160
467d3ff0ad97
(svn r1661) Makefile: added scenario to make install
bjarni
parents:
1158
diff
changeset
|
883 |
cp scenario/* $(PERSONAL_DIR)/scenario/ |
0 | 884 |
else #MorphOS |
885 |
install: |
|
886 |
$(error make install is not supported on MorphOS) |
|
887 |
endif |
|
888 |
else # OSX |
|
889 |
install: |
|
890 |
$(error make install is not supported on MacOSX) |
|
891 |
endif |
|
892 |
||
893 |
||
894 |
love: |
|
895 |
@echo "YES! I thought you would never ask. We will have a great time. You can keep me turned on all night" |
|
896 |
||
730
939c4654fdea
(svn r1182) -Fix: Makefile had a small glitch, making it impossible to compile the game (Oskar_)
truelight
parents:
728
diff
changeset
|
897 |
.PHONY: clean all $(OSX) install $(64_bit_warnings) $(endwarnings) love |
0 | 898 |
|
899 |
||
900 |
### Automatic configuration |
|
901 |
-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
|
902 |
|
0 | 903 |
|
904 |
# Export all variables set to subprocesses (a bit dirty) |
|
905 |
.EXPORT_ALL_VARIABLES: |
|
906 |
upgradeconf: $(MAKE_CONFIG) |
|
1118 | 907 |
@rm $(MAKE_CONFIG) |
908 |
@$(MAKE) $(MAKE_CONFIG) |
|
0 | 909 |
|
910 |
.PHONY: upgradeconf |
|
911 |
||
912 |
||
913 |
### Internal build rules |
|
914 |
||
915 |
# This makes sure the .deps dir is always around. |
|
916 |
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) |
|
917 |
||
918 |
# Introduce the dependencies |
|
1167
d8b7601118cf
(svn r1669) Rename all ttd_XXX to just XXX, because we already know who we are (;
tron
parents:
1164
diff
changeset
|
919 |
-include $(DEPS) |
0 | 920 |
|
921 |
# This compiles the object file as well as silently updating its dependencies |
|
922 |
# list at the same time. It is not an issue that they aren't around during the |
|
923 |
# first compilation round as we just build everything at that time anyway, |
|
924 |
# 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
|
925 |
|
728
c8728c17f505
(svn r1180) Makefile: fixed dependancies so the flag -j can be used. It makes the compilation process into more than one job which makes it able to benefit from multiple CPUs. Using -j without setting a limit of jobs (like -j2) is not a great idea (thanks to ln-- for reporting the need for this one)
bjarni
parents:
679
diff
changeset
|
926 |
%.o: %.c $(MAKE_CONFIG) endian.h table/strings.h |
1411
53935a3bcea0
(svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents:
1324
diff
changeset
|
927 |
@if [ ! "$(VERBOSE)" ]; then \ |
53935a3bcea0
(svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents:
1324
diff
changeset
|
928 |
echo '===> Compiling $<'; \ |
53935a3bcea0
(svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents:
1324
diff
changeset
|
929 |
else \ |
53935a3bcea0
(svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents:
1324
diff
changeset
|
930 |
echo $(CC) $(CFLAGS) $(CDEFS) -c $< -o $@; \ |
53935a3bcea0
(svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents:
1324
diff
changeset
|
931 |
fi |
1170
1cd3103acd66
(svn r1672) Simplify dependency tracking and actually implement it for C++ files, too.
tron
parents:
1169
diff
changeset
|
932 |
@$(CC) $(CFLAGS) $(CDEFS) -MD -c $< -o $@ |
1cd3103acd66
(svn r1672) Simplify dependency tracking and actually implement it for C++ files, too.
tron
parents:
1169
diff
changeset
|
933 |
@mv $(<:%.c=%.d) $(<:%.c=.deps/%.d) |
0 | 934 |
|
728
c8728c17f505
(svn r1180) Makefile: fixed dependancies so the flag -j can be used. It makes the compilation process into more than one job which makes it able to benefit from multiple CPUs. Using -j without setting a limit of jobs (like -j2) is not a great idea (thanks to ln-- for reporting the need for this one)
bjarni
parents:
679
diff
changeset
|
935 |
%.o: %.cpp $(MAKE_CONFIG) endian.h table/strings.h |
1411
53935a3bcea0
(svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents:
1324
diff
changeset
|
936 |
@if [ ! "$(VERBOSE)" ]; then \ |
53935a3bcea0
(svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents:
1324
diff
changeset
|
937 |
echo '===> Compiling $<'; \ |
53935a3bcea0
(svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents:
1324
diff
changeset
|
938 |
else \ |
53935a3bcea0
(svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents:
1324
diff
changeset
|
939 |
echo $(CXX) $(CFLAGS) $(CDEFS) -c $< -o $@; \ |
53935a3bcea0
(svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents:
1324
diff
changeset
|
940 |
fi |
1170
1cd3103acd66
(svn r1672) Simplify dependency tracking and actually implement it for C++ files, too.
tron
parents:
1169
diff
changeset
|
941 |
@$(CXX) $(CFLAGS) $(CDEFS) -MD -c $< -o $@ |
1cd3103acd66
(svn r1672) Simplify dependency tracking and actually implement it for C++ files, too.
tron
parents:
1169
diff
changeset
|
942 |
@mv $(<:%.c=%.d) $(<:%.c=.deps/%.d) |
1cd3103acd66
(svn r1672) Simplify dependency tracking and actually implement it for C++ files, too.
tron
parents:
1169
diff
changeset
|
943 |
|
1cd3103acd66
(svn r1672) Simplify dependency tracking and actually implement it for C++ files, too.
tron
parents:
1169
diff
changeset
|
944 |
# Silence stale header dependencies |
1cd3103acd66
(svn r1672) Simplify dependency tracking and actually implement it for C++ files, too.
tron
parents:
1169
diff
changeset
|
945 |
%.h: |
1cd3103acd66
(svn r1672) Simplify dependency tracking and actually implement it for C++ files, too.
tron
parents:
1169
diff
changeset
|
946 |
@true |
1163
044430212516
(svn r1665) Remove VERBOSE flag, because it was only partially implemented
tron
parents:
1162
diff
changeset
|
947 |
|
044430212516
(svn r1665) Remove VERBOSE flag, because it was only partially implemented
tron
parents:
1162
diff
changeset
|
948 |
|
044430212516
(svn r1665) Remove VERBOSE flag, because it was only partially implemented
tron
parents:
1162
diff
changeset
|
949 |
info: |
044430212516
(svn r1665) Remove VERBOSE flag, because it was only partially implemented
tron
parents:
1162
diff
changeset
|
950 |
@echo 'CFLAGS = $(CFLAGS)' |
044430212516
(svn r1665) Remove VERBOSE flag, because it was only partially implemented
tron
parents:
1162
diff
changeset
|
951 |
@echo 'LDFLAGS = $(LDFLAGS)' |
044430212516
(svn r1665) Remove VERBOSE flag, because it was only partially implemented
tron
parents:
1162
diff
changeset
|
952 |
@echo 'LIBS = $(LIBS)' |