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