author | darkvater |
Sun, 14 Nov 2004 20:50:38 +0000 | |
changeset 413 | 36afcda97345 |
parent 348 | 959f425dc282 |
child 421 | 0b9bdcdfe0c5 |
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 |
|
39 |
||
40 |
# Options: |
|
41 |
# |
|
42 |
# Summary of OS choice defines |
|
43 |
# WIN32: building on Windows |
|
44 |
# UNIX: building on *nix derivate (Linux, FreeBSD) |
|
45 |
# OSX: building on Mac OS X |
|
46 |
# MORPHOS: building on MorphOS |
|
47 |
# |
|
48 |
# Summary of library choice defines |
|
49 |
# WITH_ZLIB: savegames using zlib |
|
50 |
# WITH_PNG: screenshots using PNG |
|
51 |
# WITH_SDL: SDL video driver support |
|
52 |
# |
|
53 |
# Summary of other defines: |
|
54 |
# MANUAL_CONFIG: do not use Makefile.config, config options set manually |
|
55 |
# DEBUG: build in debug mode |
|
56 |
# PROFILE: build in profile mode, disables -s and -fomit-frame-pointer |
|
57 |
# DISPLAY_WARNINGS: when off, some errors are not displayed while compiling |
|
58 |
# TRANSLATOR: build in translator mode (untranslated strings are prepended by |
|
59 |
# a <TODO> mark) |
|
60 |
# RELEASE: this will be the released version number. It replaces all places |
|
61 |
# 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
|
62 |
# MIDI: if set, it will use it as custom path to midi player. |
0 | 63 |
# If unset, it will use the hardcoded path in the c code |
222
b88456001397
(svn r223) -Fix: Const correctness and miscellaneous fixes. Thank you Tron for your diligent fixing of warnings (and some possibly bugs) (Tron)
darkvater
parents:
221
diff
changeset
|
64 |
# NOVERBOSE: supress all warnings and errors during compilation. |
162
565551f829e9
(svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents:
157
diff
changeset
|
65 |
# It looks nicer, but you will not know what went wrong. Use it on released (stable) sources only |
0 | 66 |
# |
285 | 67 |
# Paths: |
68 |
# INSTALL: If not set, the game uses the directory of the binary to |
|
69 |
# store everything (lang, data, gm, save and openttd.cfg), this is the `old' behaviour. |
|
70 |
# In this case, none of the following paths are used, you also should _not_ |
|
71 |
# use `make install', but copy the required stuff yourself (or just play out |
|
72 |
# of you source directory, which should work fine). |
|
73 |
# If you want to use `make install' to install the game globally, you should |
|
74 |
# define it _before_ you build the game. If you only define INSTALL when you |
|
75 |
# do `make install', the game won't be able to find it's files (so you should |
|
76 |
# also define all the following paths before building). |
|
77 |
# |
|
78 |
# So, the following paths should be defined if INSTALL is defined. |
|
79 |
# None of these paths have to end with / |
|
80 |
# PREFIX: Normally /usr/local |
|
81 |
# BINARY_DIR: The location of the binary, normally games. (Will be prefixed |
|
82 |
# with $PREFIX) |
|
83 |
# DATA_DIR: The location of the data (lang, data and gm), normally |
|
84 |
# share/games/openttd. (Will be prefixed with $PREFIX) |
|
85 |
# PERSONAL_DIR: The directory where openttd.cfg and the save folder will be |
|
86 |
# stored. You cannot use ~ here, define USE_HOMEDIR for that. |
|
87 |
# USE_HOMEDIR: If this variable is set, PERSONAL_DIR will be prefixed with |
|
88 |
# ~/ at runtime (the user's homedir) |
|
89 |
# |
|
90 |
# DEST_DIR: make install will use this directory instead of the filesystem |
|
91 |
# root to install its files. This should normally not be used by |
|
92 |
# ordinary users, currently it is only used for the debian |
|
93 |
# packaging. This value should only be set when calling `make |
|
94 |
# install' and is not saved in Makefile.config |
|
0 | 95 |
# |
96 |
# STATIC: link statically |
|
97 |
# CYGWIN: build in Cygwin environment |
|
98 |
# MINGW: build with MingW compiler, link with MingW libraries |
|
99 |
# |
|
100 |
# Experimental (does not work properly): |
|
101 |
# WITH_NETWORK: enable networking |
|
102 |
# WITH_DIRECTMUSIC: enable DirectMusic MIDI support |
|
103 |
||
104 |
||
105 |
############################################################################## |
|
106 |
# |
|
107 |
# Configuration |
|
108 |
# |
|
109 |
||
180
47ee14fe2b35
(svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents:
164
diff
changeset
|
110 |
# Makefile version tag |
47ee14fe2b35
(svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents:
164
diff
changeset
|
111 |
# it checks if the version tag in makefile.config is the same and force update outdated config files |
348
959f425dc282
(svn r531) Makefile: made asserts enabled by default
bjarni
parents:
347
diff
changeset
|
112 |
MAKEFILE_VERSION:=3 |
180
47ee14fe2b35
(svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents:
164
diff
changeset
|
113 |
|
0 | 114 |
# CONFIG_WRITER have to be found even for manual configuration |
115 |
CONFIG_WRITER=makefiledir/Makefile.config_writer |
|
116 |
||
117 |
ifndef MANUAL_CONFIG |
|
118 |
# Automatic configuration |
|
119 |
MAKE_CONFIG:=Makefile.config |
|
120 |
MAKEFILE:=Makefile |
|
121 |
LIB_DETECTION=makefiledir/Makefile.libdetection |
|
122 |
CONFIG_WRITER=makefiledir/Makefile.config_writer |
|
123 |
||
124 |
# Apply automatic configuration |
|
125 |
# See target section for how this is built, suppress errors |
|
126 |
# since first time it isn't found but make reads this twice |
|
127 |
-include $(MAKE_CONFIG) |
|
128 |
else |
|
129 |
CONFIG_INCLUDED:=1 |
|
130 |
endif |
|
131 |
||
180
47ee14fe2b35
(svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents:
164
diff
changeset
|
132 |
# 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
|
133 |
ifneq ($(MAKEFILE_VERSION),$(CONFIG_VERSION)) |
189
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
134 |
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
|
135 |
UPDATECONFIG:=upgradeconf |
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
136 |
CONFIG_INCLUDED:= |
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
137 |
else |
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
138 |
# 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
|
139 |
ifeq ($(shell uname),FreeBSD) |
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
140 |
SDL-CONFIG:=sdl11-config |
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
141 |
else |
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
142 |
SDL-CONFIG:=sdl-config |
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
143 |
endif |
4d133909845a
(svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents:
180
diff
changeset
|
144 |
endif |
0 | 145 |
else |
189
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 |
0 | 152 |
endif |
153 |
||
219
adfdf7fad721
(svn r220) Makefile: enables ENABLE_NETWORK by default if no config file is present
bjarni
parents:
189
diff
changeset
|
154 |
# this is used if there aren't any makefile.config |
0 | 155 |
ifndef CONFIG_INCLUDED |
285 | 156 |
# sets network on by default if there aren't any config file |
157 |
ENABLE_NETWORK:=1 |
|
158 |
||
159 |
# paths for make install |
|
160 |
# disabled as they would break it for some (many?) people if they were default |
|
161 |
#PREFIX:=/usr/local |
|
162 |
#DATA_DIR:=share/games/openttd |
|
163 |
#BINARY_DIR:=games |
|
164 |
#PERSONAL_DIR:=.openttd |
|
165 |
#USE_HOMEDIR:=1 |
|
166 |
||
0 | 167 |
-include $(LIB_DETECTION) |
168 |
endif |
|
169 |
||
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
|
170 |
# Verbose filter |
565551f829e9
(svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents:
157
diff
changeset
|
171 |
|
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
|
172 |
ifdef NOVERBOSE |
222
b88456001397
(svn r223) -Fix: Const correctness and miscellaneous fixes. Thank you Tron for your diligent fixing of warnings (and some possibly bugs) (Tron)
darkvater
parents:
221
diff
changeset
|
173 |
VERBOSE_FILTER = >/dev/null 2>&1 |
162
565551f829e9
(svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents:
157
diff
changeset
|
174 |
else |
222
b88456001397
(svn r223) -Fix: Const correctness and miscellaneous fixes. Thank you Tron for your diligent fixing of warnings (and some possibly bugs) (Tron)
darkvater
parents:
221
diff
changeset
|
175 |
VERBOSE_FILTER = |
162
565551f829e9
(svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents:
157
diff
changeset
|
176 |
endif |
565551f829e9
(svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents:
157
diff
changeset
|
177 |
|
0 | 178 |
ifdef DISPLAY_WARNINGS |
179 |
WARNING_DISPLAY:=-fstrict-aliasing |
|
222
b88456001397
(svn r223) -Fix: Const correctness and miscellaneous fixes. Thank you Tron for your diligent fixing of warnings (and some possibly bugs) (Tron)
darkvater
parents:
221
diff
changeset
|
180 |
VERBOSE_FILTER = |
0 | 181 |
else |
182 |
WARNING_DISPLAY:=-fno-strict-aliasing |
|
183 |
endif |
|
184 |
||
180
47ee14fe2b35
(svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents:
164
diff
changeset
|
185 |
ifdef SUPRESS_LANG_ERRORS |
47ee14fe2b35
(svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents:
164
diff
changeset
|
186 |
ifndef VERBOSE_FILTER |
47ee14fe2b35
(svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents:
164
diff
changeset
|
187 |
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
|
188 |
endif |
47ee14fe2b35
(svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents:
164
diff
changeset
|
189 |
endif |
47ee14fe2b35
(svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents:
164
diff
changeset
|
190 |
|
0 | 191 |
ifdef STATIC |
192 |
ifndef WIN32 |
|
193 |
ifndef OSX |
|
194 |
ifndef MORPHOS |
|
195 |
ifndef SKIP_STATIC_CHECK |
|
196 |
$(error Static is only known to work on MorphOS and MacOSX!!! --- Check makefile.config for more info and howto bypass this check) |
|
197 |
endif |
|
198 |
endif |
|
199 |
endif |
|
200 |
endif |
|
201 |
endif |
|
202 |
||
203 |
||
204 |
# Force SDL on UNIX platforms |
|
205 |
ifndef WITH_SDL |
|
206 |
ifdef UNIX |
|
207 |
$(error You need to have SDL installed in order to run OpenTTD on UNIX.) |
|
208 |
endif |
|
209 |
endif |
|
210 |
||
211 |
||
212 |
||
213 |
############################################################################## |
|
214 |
# |
|
215 |
# Compiler configuration |
|
216 |
# |
|
217 |
CC=gcc |
|
218 |
CXX=g++ |
|
219 |
||
220 |
ifdef MORPHOS |
|
221 |
CC += -noixemul -pipe |
|
222 |
CXX += -noixemul -pipe |
|
223 |
endif |
|
224 |
||
225 |
# Executable file extension |
|
226 |
ifdef WIN32 |
|
227 |
EXE=.exe |
|
228 |
else |
|
229 |
EXE= |
|
230 |
endif |
|
231 |
||
232 |
# Set output executable names |
|
32 | 233 |
TTD=openttd$(EXE) |
157
dd017fa3bad8
(svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents:
126
diff
changeset
|
234 |
ENDIAN_CHECK=endian_check$(EXE) |
0 | 235 |
STRGEN=strgen/strgen$(EXE) |
236 |
OSXAPP="OpenTTD.app" |
|
237 |
||
238 |
# What revision are we compiling, if we have an idea? |
|
239 |
REV_NUMBER := $(shell if test -d .svn; then svnversion . | tr -dc 0-9; fi) |
|
240 |
||
241 |
ifdef RELEASE |
|
242 |
REV:=$(RELEASE) |
|
243 |
else |
|
244 |
REV := $(shell if test -d .svn; then echo -n r; svnversion .; fi) |
|
245 |
tmp_test:=$(shell echo "$(REV)" | grep "M" ) |
|
246 |
ifdef tmp_test |
|
247 |
REV_NUMBER:=1 |
|
248 |
endif |
|
249 |
endif |
|
250 |
||
251 |
ifndef REV_NUMBER |
|
252 |
REV_NUMBER:=0 |
|
253 |
endif |
|
254 |
||
255 |
# MorphOS needs builddate |
|
256 |
BUILDDATE=`date +%d.%m.%y` |
|
257 |
||
258 |
# AMD64 needs a little more settings to work |
|
259 |
ifeq ($(shell uname -m), x86_64) |
|
260 |
endwarnings:=endwarnings |
|
261 |
64_bit_warnings:=64_bit_warnings |
|
157
dd017fa3bad8
(svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents:
126
diff
changeset
|
262 |
BASECFLAGS += -m64 |
0 | 263 |
endif |
264 |
||
265 |
||
266 |
# When calling the compiler, use these flags |
|
267 |
# -g debugging symbols |
|
268 |
# -Wall all warnings |
|
269 |
# -s automatic strip |
|
270 |
# |
|
271 |
# You may also want: |
|
272 |
# -O optimize or -O2 fully optimize (O's above 2 are not recommended) |
|
273 |
# -pg profile - generate profiling data. See "man gprof" to use this. |
|
274 |
||
275 |
CFLAGS=-Wall -Wno-multichar |
|
276 |
CDEFS=-DWITH_REV |
|
277 |
LDFLAGS= |
|
278 |
LIBS= |
|
279 |
||
280 |
ifdef DEBUG |
|
281 |
# Debug mode |
|
282 |
CDEFS += -D_DEBUG |
|
283 |
BASECFLAGS += -g |
|
284 |
else |
|
285 |
ifdef PROFILE |
|
286 |
BASECFLAGS += -pg |
|
287 |
else |
|
288 |
# Release mode |
|
289 |
ifndef MORPHOS |
|
290 |
# automatical strip breaks under morphos |
|
291 |
BASECFLAGS += -s |
|
292 |
LDFLAGS += -s |
|
293 |
endif |
|
294 |
endif |
|
295 |
||
296 |
ifdef OSX |
|
297 |
# these compilerflags makes the app run as fast as possible without making the app unstable. It works on G3 or newer |
|
298 |
BASECFLAGS += -O3 -funroll-loops -fsched-interblock -falign-loops=16 -falign-jumps=16 -falign-functions=16 -falign-jumps-max-skip=15 -falign-loops-max-skip=15 -mdynamic-no-pic -mpowerpc-gpopt -force_cpusubtype_ALL $(WARNING_DISPLAY) |
|
299 |
else |
|
300 |
ifdef MORPHOS |
|
301 |
BASECFLAGS += -O2 -funroll-loops -fexpensive-optimizations -mstring -mmultiple $(WARNING_DISPLAY) |
|
302 |
else |
|
303 |
BASECFLAGS += -O2 $(WARNING_DISPLAY) |
|
304 |
endif |
|
305 |
ifndef PROFILE |
|
306 |
BASECFLAGS += -fomit-frame-pointer |
|
307 |
endif |
|
308 |
endif |
|
309 |
endif |
|
310 |
||
311 |
ifdef STATIC |
|
312 |
ifndef OSX # OSX can't build static if -static flag is used |
|
313 |
LDFLAGS += -static |
|
314 |
endif |
|
315 |
endif |
|
316 |
||
317 |
# If building on Cygwin/MingW don't link with Cygwin libs |
|
318 |
ifdef WIN32 |
|
319 |
ifdef MINGW |
|
320 |
ifdef CYGWIN |
|
321 |
BASECFLAGS += -mno-cygwin |
|
322 |
LDFLAGS += -mno-cygwin |
|
323 |
endif |
|
324 |
endif |
|
325 |
endif |
|
326 |
||
327 |
CFLAGS += $(BASECFLAGS) |
|
328 |
||
329 |
ifdef UNIX |
|
330 |
CDEFS += -DUNIX |
|
331 |
endif |
|
332 |
||
333 |
# SDL config |
|
334 |
ifdef WITH_SDL |
|
335 |
CDEFS += -DWITH_SDL |
|
336 |
CFLAGS += `$(SDL-CONFIG) --cflags` |
|
337 |
ifdef STATIC |
|
338 |
LIBS += `$(SDL-CONFIG) --static-libs` |
|
339 |
else |
|
340 |
LIBS += `$(SDL-CONFIG) --libs` |
|
341 |
endif |
|
342 |
endif |
|
343 |
||
344 |
||
345 |
# zlib config |
|
346 |
ifdef WITH_ZLIB |
|
347 |
CDEFS += -DWITH_ZLIB |
|
348 |
ifdef STATIC |
|
349 |
ifdef OSX |
|
350 |
# zlib is default on OSX, so everybody have it. No need for static linking |
|
351 |
LIBS += -lz |
|
352 |
else |
|
353 |
ifndef STATIC_ZLIB_PATH |
|
354 |
ifndef MANUAL_CONFIG |
|
355 |
# updates makefile.config with the zlib path |
|
356 |
UPDATECONFIG:=upgradeconf |
|
357 |
endif |
|
358 |
TEMP:=$(shell ls /lib 2>/dev/null | grep "zlib.a")$(shell ls /lib 2>/dev/null | grep "libz.a") |
|
359 |
ifdef TEMP |
|
360 |
STATIC_ZLIB_PATH:=/lib/$(TEMP) |
|
361 |
else |
|
362 |
TEMP:=$(shell ls /usr/lib 2>/dev/null | grep "zlib.a")$(shell ls /usr/lib 2>/dev/null | grep "libz.a") |
|
363 |
ifdef TEMP |
|
364 |
STATIC_ZLIB_PATH:=/usr/lib/$(TEMP) |
|
365 |
else |
|
366 |
TEMP:=$(shell ls /usr/local/lib 2>/dev/null | grep "zlib.a")$(shell ls /usr/local/lib 2>/dev/null | grep "libz.a") |
|
367 |
ifdef TEMP |
|
368 |
STATIC_ZLIB_PATH:=/usr/local/lib/$(TEMP) |
|
369 |
endif |
|
370 |
endif |
|
371 |
endif |
|
372 |
endif |
|
373 |
LIBS += $(STATIC_ZLIB_PATH) |
|
374 |
endif |
|
375 |
else |
|
376 |
LIBS += -lz |
|
377 |
endif |
|
378 |
endif |
|
379 |
||
380 |
# libpng config |
|
381 |
ifdef WITH_PNG |
|
382 |
CDEFS += -DWITH_PNG |
|
383 |
# FreeBSD doesn't use libpng-config |
|
384 |
ifdef FREEBSD |
|
385 |
LIBS += -lpng |
|
386 |
else |
|
387 |
CFLAGS += `libpng-config --cflags` |
|
388 |
ifdef OSX |
|
389 |
ifdef STATIC |
|
390 |
# Seems like we need a tiny hack for OSX static to work |
|
391 |
LIBS += `libpng-config --prefix`/lib/libpng.a |
|
392 |
else |
|
393 |
LIBS += `libpng-config --libs` |
|
394 |
endif |
|
395 |
else |
|
396 |
# seems like older libpng versions are broken and need this |
|
397 |
PNGCONFIG_FLAGS = --ldflags --libs |
|
398 |
ifdef STATIC |
|
399 |
LIBS += `libpng-config --static $(PNGCONFIG_FLAGS)` |
|
400 |
else |
|
401 |
LIBS += `libpng-config $(PNGCONFIG_FLAGS)` |
|
402 |
endif |
|
403 |
endif |
|
404 |
endif |
|
405 |
endif |
|
406 |
||
347
892935295937
(svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents:
285
diff
changeset
|
407 |
# enables/disables assert() |
348
959f425dc282
(svn r531) Makefile: made asserts enabled by default
bjarni
parents:
347
diff
changeset
|
408 |
ifdef DISABLE_ASSERTS |
959f425dc282
(svn r531) Makefile: made asserts enabled by default
bjarni
parents:
347
diff
changeset
|
409 |
CFLAGS += -DNDEBUG |
959f425dc282
(svn r531) Makefile: made asserts enabled by default
bjarni
parents:
347
diff
changeset
|
410 |
endif |
959f425dc282
(svn r531) Makefile: made asserts enabled by default
bjarni
parents:
347
diff
changeset
|
411 |
|
959f425dc282
(svn r531) Makefile: made asserts enabled by default
bjarni
parents:
347
diff
changeset
|
412 |
# automatically disables asserts for release |
959f425dc282
(svn r531) Makefile: made asserts enabled by default
bjarni
parents:
347
diff
changeset
|
413 |
ifdef RELEASE |
347
892935295937
(svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents:
285
diff
changeset
|
414 |
ifndef ENABLE_ASSERTS |
892935295937
(svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents:
285
diff
changeset
|
415 |
CFLAGS += -DNDEBUG |
892935295937
(svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents:
285
diff
changeset
|
416 |
endif |
348
959f425dc282
(svn r531) Makefile: made asserts enabled by default
bjarni
parents:
347
diff
changeset
|
417 |
endif |
0 | 418 |
|
419 |
ifdef TRANSLATOR |
|
420 |
STRGEN_FLAGS=-t |
|
421 |
else |
|
422 |
STRGEN_FLAGS= |
|
423 |
endif |
|
424 |
||
425 |
||
426 |
# MIDI setup |
|
427 |
ifdef OSX |
|
428 |
ifndef MIDI |
|
429 |
MIDI:=$(OSXAPP)/contents/macos/track_starter |
|
430 |
endif |
|
431 |
endif |
|
432 |
||
433 |
ifdef MIDI |
|
434 |
CDEFS += -DEXTERNAL_PLAYER=\"$(MIDI)\" |
|
435 |
ifdef MIDI_ARG |
|
436 |
CDEFS += -DMIDI_ARG=\"$(MIDI_ARG)\" |
|
437 |
endif |
|
438 |
endif |
|
439 |
||
440 |
# Experimental |
|
441 |
ifdef WITH_NETWORK |
|
442 |
CDEFS += -DENABLE_NETWORK |
|
443 |
ifdef UNIX |
|
444 |
ifndef OSX |
|
445 |
ifndef MORPHOS |
|
446 |
# this have caused problems on many platforms and disabling it didn't break anything |
|
447 |
# now we test if disabling it as a general breaks it for anybody |
|
448 |
#LIBS += -lresolv |
|
449 |
endif |
|
450 |
endif |
|
451 |
endif |
|
452 |
endif |
|
453 |
||
454 |
ifdef WITH_DIRECTMUSIC |
|
455 |
CDEFS += -DWIN32_ENABLE_DIRECTMUSIC_SUPPORT |
|
456 |
endif |
|
457 |
||
458 |
ifdef WIN32 |
|
459 |
LIBS += -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32 -lstdc++ |
|
460 |
TTDLDFLAGS += -Wl,--subsystem,windows |
|
461 |
endif |
|
462 |
||
463 |
# sets up the paths for use for make install |
|
285 | 464 |
ifdef INSTALL |
465 |
# We use _PREFIXED vars here, so the paths are recalculated every time, and |
|
466 |
# the prefix is not prepended in the makefile config |
|
467 |
BINARY_DIR_PREFIXED:=$(PREFIX)/$(BINARY_DIR) |
|
468 |
DATA_DIR_PREFIXED:=$(PREFIX)/$(DATA_DIR) |
|
469 |
# We use _INSTALL vars here, these vars are the locations where the files will |
|
470 |
# be installed |
|
471 |
DATA_DIR_INSTALL=$(DEST_DIR)/$(DATA_DIR_PREFIXED) |
|
472 |
BINARY_DIR_INSTALL=$(DEST_DIR)/$(BINARY_DIR_PREFIXED) |
|
473 |
# Let the code know where to find stuff |
|
474 |
ifdef DATA_DIR_PREFIXED |
|
475 |
CDEFS += -DGAME_DATA_DIR=\"$(DATA_DIR_PREFIXED)/\" |
|
0 | 476 |
endif |
285 | 477 |
|
478 |
ifdef PERSONAL_DIR |
|
479 |
CDEFS += -DPERSONAL_DIR=\"$(PERSONAL_DIR)/\" |
|
480 |
endif |
|
481 |
||
482 |
ifdef USE_HOMEDIR |
|
483 |
CDEFS += -DUSE_HOMEDIR |
|
484 |
endif |
|
0 | 485 |
endif |
486 |
||
487 |
############################################################################## |
|
488 |
# |
|
489 |
# What to compile |
|
490 |
# (users do not want to modify anything below) |
|
491 |
# |
|
492 |
||
493 |
||
494 |
### Sources |
|
495 |
||
496 |
ttd_SOURCES = \ |
|
112
5291485847ff
(svn r113) -Update: re-ordered Makefile (filenames are now in alphabetic order again) (Celestar)
truelight
parents:
84
diff
changeset
|
497 |
ai.c ai_build.c ai_new.c ai_pathfinder.c ai_shared.c aircraft_cmd.c \ |
5291485847ff
(svn r113) -Update: re-ordered Makefile (filenames are now in alphabetic order again) (Celestar)
truelight
parents:
84
diff
changeset
|
498 |
aircraft_gui.c airport.c airport_gui.c aystar.c bridge_gui.c \ |
221
124a804562a5
(svn r222) -Fix: Added network.h and console_cmd.c to MSVC6 Project
signde
parents:
219
diff
changeset
|
499 |
clear_cmd.c command.c console.c console_cmds.c disaster_cmd.c dock_gui.c dummy_land.c economy.c \ |
112
5291485847ff
(svn r113) -Update: re-ordered Makefile (filenames are now in alphabetic order again) (Celestar)
truelight
parents:
84
diff
changeset
|
500 |
engine.c engine_gui.c fileio.c gfx.c graph_gui.c grfspecial.c \ |
5291485847ff
(svn r113) -Update: re-ordered Makefile (filenames are now in alphabetic order again) (Celestar)
truelight
parents:
84
diff
changeset
|
501 |
industry_cmd.c industry_gui.c intro_gui.c landscape.c main_gui.c \ |
5291485847ff
(svn r113) -Update: re-ordered Makefile (filenames are now in alphabetic order again) (Celestar)
truelight
parents:
84
diff
changeset
|
502 |
minilzo.c misc.c misc_cmd.c misc_gui.c music_gui.c namegen.c network.c \ |
5291485847ff
(svn r113) -Update: re-ordered Makefile (filenames are now in alphabetic order again) (Celestar)
truelight
parents:
84
diff
changeset
|
503 |
network_gui.c news_gui.c oldloader.c order_cmd.c order_gui.c \ |
5291485847ff
(svn r113) -Update: re-ordered Makefile (filenames are now in alphabetic order again) (Celestar)
truelight
parents:
84
diff
changeset
|
504 |
pathfind.c player_gui.c players.c queue.c rail_cmd.c rail_gui.c rev.c \ |
5291485847ff
(svn r113) -Update: re-ordered Makefile (filenames are now in alphabetic order again) (Celestar)
truelight
parents:
84
diff
changeset
|
505 |
road_cmd.c road_gui.c roadveh_cmd.c roadveh_gui.c saveload.c \ |
5291485847ff
(svn r113) -Update: re-ordered Makefile (filenames are now in alphabetic order again) (Celestar)
truelight
parents:
84
diff
changeset
|
506 |
screenshot.c settings.c settings_gui.c ship_cmd.c ship_gui.c \ |
413
36afcda97345
(svn r610) -newgrf: Support for some basic deterministical spritegroups regarding stations. Waypoints look changes based on year now :^) (pasky).
darkvater
parents:
348
diff
changeset
|
507 |
smallmap_gui.c sound.c sprite.c spritecache.c station_cmd.c station_gui.c \ |
112
5291485847ff
(svn r113) -Update: re-ordered Makefile (filenames are now in alphabetic order again) (Celestar)
truelight
parents:
84
diff
changeset
|
508 |
strings.c subsidy_gui.c terraform_gui.c texteff.c town_cmd.c \ |
5291485847ff
(svn r113) -Update: re-ordered Makefile (filenames are now in alphabetic order again) (Celestar)
truelight
parents:
84
diff
changeset
|
509 |
town_gui.c train_cmd.c train_gui.c tree_cmd.c ttd.c tunnelbridge_cmd.c \ |
164
0cbdf3c9bde1
(svn r165) -Feature: Option to sort vehicles in vehicle-list window by different criteria. Total independent sort for all types and players. Periodic resort of list every 10 TTD days. Thank you for your graphical inspiration follow and buxo (since none of you provided any code).
darkvater
parents:
163
diff
changeset
|
510 |
unmovable_cmd.c vehicle.c vehicle_gui.c viewport.c water_cmd.c widget.c window.c \ |
0 | 511 |
|
512 |
ifdef WITH_SDL |
|
513 |
ttd_SOURCES += sdl.c |
|
514 |
endif |
|
515 |
||
516 |
ifdef WIN32 |
|
517 |
ttd_SOURCES += win32.c w32dm.c |
|
518 |
else |
|
519 |
ttd_SOURCES += extmidi.c unix.c |
|
520 |
endif |
|
521 |
||
522 |
ttd_OBJS = $(ttd_SOURCES:%.c=%.o) |
|
523 |
||
524 |
ifdef WIN32 |
|
525 |
# Resource file |
|
526 |
ttd_OBJS += winres.o |
|
527 |
endif |
|
528 |
||
529 |
ifdef WITH_DIRECTMUSIC |
|
530 |
ttd_SOURCES += w32dm2.cpp |
|
531 |
ttd_OBJS += w32dm2.o |
|
532 |
endif |
|
533 |
||
534 |
ttd_DEPS1 = $(foreach obj,$(ttd_OBJS),.deps/$(obj)) |
|
535 |
ttd_DEPS = $(ttd_DEPS1:%.o=%.P) |
|
536 |
||
537 |
LANG_TXT = $(filter-out %.unfinished.txt,$(wildcard lang/*.txt)) |
|
538 |
LANGS = $(LANG_TXT:%.txt=%.lng) |
|
539 |
||
540 |
C_COMPILE = $(CC) $(CFLAGS) $(CDEFS) |
|
541 |
CXX_COMPILE = $(CXX) $(CFLAGS) $(CDEFS) |
|
542 |
||
543 |
C_BUILD = $(C_COMPILE) -c |
|
544 |
CXX_BUILD = $(CXX_COMPILE) -c |
|
545 |
||
546 |
C_LINK = $(CC) $(LDFLAGS) -o |
|
547 |
||
548 |
||
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
|
549 |
|
0 | 550 |
############################################################################## |
551 |
# |
|
552 |
# Targets |
|
553 |
# |
|
554 |
||
555 |
||
556 |
### Normal build rules |
|
557 |
||
558 |
||
559 |
ifdef OSX |
|
560 |
OSX:=OSX |
|
561 |
endif |
|
562 |
||
563 |
||
157
dd017fa3bad8
(svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents:
126
diff
changeset
|
564 |
all: endian.h $(UPDATECONFIG) $(TTD) $(OSX) $(endwarnings) |
0 | 565 |
|
157
dd017fa3bad8
(svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents:
126
diff
changeset
|
566 |
endian.h: $(ENDIAN_CHECK) |
222
b88456001397
(svn r223) -Fix: Const correctness and miscellaneous fixes. Thank you Tron for your diligent fixing of warnings (and some possibly bugs) (Tron)
darkvater
parents:
221
diff
changeset
|
567 |
@# Check if system is LITTLE_ENDIAN or BIG_ENDIAN |
163
deb9b58db3f4
(svn r164) -Fix: Makefile did not clean up endian-files
truelight
parents:
162
diff
changeset
|
568 |
@echo 'Running endian_check'; \ |
deb9b58db3f4
(svn r164) -Fix: Makefile did not clean up endian-files
truelight
parents:
162
diff
changeset
|
569 |
./$(ENDIAN_CHECK) > $@ |
157
dd017fa3bad8
(svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents:
126
diff
changeset
|
570 |
|
dd017fa3bad8
(svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents:
126
diff
changeset
|
571 |
$(ENDIAN_CHECK): endian_check.c |
163
deb9b58db3f4
(svn r164) -Fix: Makefile did not clean up endian-files
truelight
parents:
162
diff
changeset
|
572 |
@echo 'Compiling and Linking $@'; \ |
deb9b58db3f4
(svn r164) -Fix: Makefile did not clean up endian-files
truelight
parents:
162
diff
changeset
|
573 |
$(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
|
574 |
|
0 | 575 |
|
576 |
$(TTD): table/strings.h $(ttd_OBJS) $(LANGS) $(MAKE_CONFIG) |
|
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
|
577 |
@echo 'Compiling and Linking $@'; \ |
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
|
578 |
$(C_LINK) $@ $(TTDLDFLAGS) $(ttd_OBJS) $(LIBS) $(VERBOSE_FILTER) |
0 | 579 |
|
580 |
$(OSX): |
|
581 |
@mkdir -p $(OSXAPP)/Contents/MacOS |
|
582 |
@mkdir -p $(OSXAPP)/Contents/Resources |
|
583 |
@echo "APPL????" > $(OSXAPP)/Contents/PkgInfo |
|
35 | 584 |
@cp os/macos/ttd.icns $(OSXAPP)/Contents/Resources/openttd.icns |
0 | 585 |
@os/macos/plistgen.sh $(OSXAPP) $(REV) |
586 |
@cp os/macos/track_starter $(OSXAPP)/contents/macos |
|
587 |
@ls os/macos | grep -q "\.class" || \ |
|
588 |
javac os/macos/OpenTTDMidi.java |
|
589 |
@cp os/macos/OpenTTDMidi.class $(OSXAPP)/contents/macos |
|
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
|
590 |
@cp $(TTD) $(OSXAPP)/Contents/MacOS/$(TTD) |
0 | 591 |
|
592 |
$(endwarnings): $(64_bit_warnings) |
|
593 |
||
594 |
$(64_bit_warnings): |
|
595 |
$(warning 64 bit CPUs will get some 64 bit specific bugs!) |
|
596 |
$(warning If you see any bugs, include in your bug report that you use a 64 bit CPU) |
|
597 |
||
598 |
$(STRGEN): strgen/strgen.c rev.o |
|
162
565551f829e9
(svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents:
157
diff
changeset
|
599 |
@echo 'Compiling and Linking $@'; \ |
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
|
600 |
$(CC) $(BASECFLAGS) $(CDEFS) -o $@ $^ $(VERBOSE_FILTER) |
0 | 601 |
|
602 |
lang/english.lng: lang/english.txt $(STRGEN) |
|
162
565551f829e9
(svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents:
157
diff
changeset
|
603 |
@echo 'Generating $@'; \ |
0 | 604 |
$(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
|
605 |
|
0 | 606 |
table/strings.h: lang/english.lng |
607 |
||
608 |
lang/%.lng: lang/%.txt $(STRGEN) |
|
162
565551f829e9
(svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents:
157
diff
changeset
|
609 |
@echo 'Generating $@'; \ |
180
47ee14fe2b35
(svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents:
164
diff
changeset
|
610 |
$(STRGEN) $(STRGEN_FLAGS) $< $(VERBOSE_FILTER) $(LANG_ERRORS) |
0 | 611 |
|
612 |
winres.o: ttd.rc |
|
613 |
windres -o $@ $< |
|
614 |
||
615 |
||
616 |
rev.c: FORCE |
|
617 |
@# setting the revision number in a place, there the binary can read it |
|
618 |
@echo 'const char _openttd_revision[] = "'$(REV)'";' >>rev.c.new |
|
619 |
@echo 'const int _revision_number = $(REV_NUMBER);' >>rev.c.new |
|
620 |
@# some additions for MorphOS versions tag |
|
621 |
@echo '#ifdef __MORPHOS__' >>rev.c.new |
|
622 |
@echo 'const char morphos_versions_tag[] = "\\0$$VER: OpenTTD '$(REV)' ('${BUILDDATE}') © OpenTTD Team [MorphOS, PowerPC]";' >>rev.c.new |
|
623 |
@echo '#endif' >>rev.c.new |
|
624 |
@# Only update the real rev.c if it actually changed, to prevent |
|
625 |
@# useless rebuilds. |
|
626 |
@cmp -s rev.c rev.c.new 2>/dev/null || mv rev.c.new rev.c |
|
627 |
@rm -f rev.c.new |
|
628 |
||
629 |
FORCE: |
|
630 |
||
631 |
||
32 | 632 |
# ttd$(EXE) is removed just to make sure people execute the right binary (openttd$(EXE)) |
633 |
# remove this for next release! |
|
0 | 634 |
clean: |
162
565551f829e9
(svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents:
157
diff
changeset
|
635 |
@echo 'Cleaning up...'; \ |
163
deb9b58db3f4
(svn r164) -Fix: Makefile did not clean up endian-files
truelight
parents:
162
diff
changeset
|
636 |
rm -rf .deps *~ $(TTD) $(STRGEN) core table/strings.h $(LANGS) $(ttd_OBJS) endian.h $(ENDIAN_CHECK) ttd$(EXE) |
0 | 637 |
|
638 |
mrproper: clean |
|
639 |
rm -rf $(MAKE_CONFIG) |
|
640 |
||
641 |
ifndef OSX |
|
642 |
ifndef MORPHOS |
|
643 |
install: |
|
285 | 644 |
ifeq ($(INSTALL),) |
645 |
$(error make install is highly experimental at his state and not\ |
|
0 | 646 |
tested very much - use at your own risk - to use run \"make install INSTALL:=1\" - make sure makefile.config\ |
647 |
is set correctly up - run \"make upgradeconf\") |
|
285 | 648 |
endif |
649 |
||
650 |
ifeq ($(PREFIX), ) |
|
651 |
$(error no prefix set - check makefile.config) |
|
652 |
endif |
|
653 |
# We compare against the non prefixed version here, so we won't install |
|
654 |
# if only the prefix has been set |
|
655 |
ifeq ($(DATA_DIR),) |
|
656 |
$(error no data path set - check makefile.config) |
|
657 |
endif |
|
658 |
ifeq ($(BINARY_DIR),) |
|
659 |
$(error no binary path set - check makefile.config) |
|
660 |
endif |
|
661 |
# We'll install in $DEST_DIR instead of root if it is set (we don't |
|
662 |
# care about extra /'s |
|
663 |
mkdir -p $(DATA_DIR_INSTALL)/lang |
|
664 |
mkdir -p $(DATA_DIR_INSTALL)/data |
|
665 |
mkdir -p $(DATA_DIR_INSTALL)/gm |
|
666 |
mkdir -p $(BINARY_DIR_INSTALL) |
|
667 |
cp $(TTD) $(BINARY_DIR_INSTALL) |
|
668 |
cp lang/*.lng $(DATA_DIR_INSTALL)/lang |
|
669 |
cp data/*.grf $(DATA_DIR_INSTALL)/data |
|
670 |
cp data/opntitle.dat $(DATA_DIR_INSTALL)/data |
|
671 |
cp media/openttd.64.png $(DATA_DIR_INSTALL) |
|
0 | 672 |
else #MorphOS |
673 |
install: |
|
674 |
$(error make install is not supported on MorphOS) |
|
675 |
endif |
|
676 |
else # OSX |
|
677 |
install: |
|
678 |
$(error make install is not supported on MacOSX) |
|
679 |
endif |
|
680 |
||
681 |
||
682 |
love: |
|
683 |
@echo "YES! I thought you would never ask. We will have a great time. You can keep me turned on all night" |
|
684 |
||
685 |
.PHONY: clean all $(OSX) install $(64_bit_warnings) $(endwarnings) love |
|
686 |
||
687 |
||
688 |
### Automatic configuration |
|
689 |
-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
|
690 |
|
0 | 691 |
|
692 |
# Export all variables set to subprocesses (a bit dirty) |
|
693 |
.EXPORT_ALL_VARIABLES: |
|
694 |
upgradeconf: $(MAKE_CONFIG) |
|
695 |
rm $(MAKE_CONFIG) |
|
696 |
$(MAKE) $(MAKE_CONFIG) |
|
697 |
||
698 |
.PHONY: upgradeconf |
|
699 |
||
700 |
||
701 |
### Internal build rules |
|
702 |
||
703 |
# This makes sure the .deps dir is always around. |
|
704 |
DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) |
|
705 |
||
706 |
# Introduce the dependencies |
|
707 |
-include $(ttd_DEPS) |
|
708 |
||
709 |
# This compiles the object file as well as silently updating its dependencies |
|
710 |
# list at the same time. It is not an issue that they aren't around during the |
|
711 |
# first compilation round as we just build everything at that time anyway, |
|
712 |
# 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
|
713 |
|
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
|
714 |
#@echo '$(C_BUILD) $<'; \ |
565551f829e9
(svn r163) Makefile: made compileroutput nicer and added NOVERBOSE to supress all warnings/errors if wanted(default off) (sign_de)
bjarni
parents:
157
diff
changeset
|
715 |
|
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
|
716 |
|
0 | 717 |
%.o: %.c $(MAKE_CONFIG) |
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
|
718 |
@echo 'Compiling $(*F).o'; \ |
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
|
719 |
$(C_BUILD) $< -Wp,-MD,.deps/$(*F).pp $(VERBOSE_FILTER) |
0 | 720 |
@-cp .deps/$(*F).pp .deps/$(*F).P; \ |
721 |
tr ' ' '\012' < .deps/$(*F).pp \ |
|
722 |
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ |
|
723 |
>> .deps/$(*F).P; \ |
|
724 |
rm .deps/$(*F).pp |
|
725 |
||
726 |
# For DirectMusic build |
|
727 |
%.o: %.cpp $(MAKE_CONFIG) |
|
728 |
$(CXX_BUILD) $< |