Makefile
author bjarni
Tue, 06 Dec 2005 14:35:10 +0000
changeset 2719 146eaa0ec83c
parent 2717 0f385152f0d3
child 2722 dcbf94a5ad1a
permissions -rw-r--r--
(svn r3264) -Codechange: [OSX] OSX targets will now always use the preprocessor to determine endianess
this means that ENDIAN_FORCE is obsolite since it's always overwritten with PREPROCESSOR
Since the preprocessor should never be able to pick wrong, it's easier this way
specially when compiling universal binaries as they got both endianess
2185
b06d0e4a26eb (svn r2700) Insert Id tag into the Makefile
tron
parents: 2177
diff changeset
     1
# $Id$
b06d0e4a26eb (svn r2700) Insert Id tag into the Makefile
tron
parents: 2177
diff changeset
     2
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     3
##############################################################################
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     4
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     5
# Usage
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     6
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     7
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     8
# Synopsis:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     9
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    10
# make WITH_ZLIB=1 UNIX=1 MANUAL_CONFIG=1
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    11
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    12
# (See below for the list of possible options.)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    13
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    14
# Alternately, you can run make without the MANUAL_CONFIG part. It then
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    15
# generates Makefile.config, where you can customize all the options.
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    16
# However beware that for all subsequent calls the option values from
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    17
# Makefile.config take precedence to the commandline options.
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    18
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    19
# (That means that you probably want to either specify the options on command
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    20
# line together with MANUAL_CONFIG=1 or you want to specify no commandline
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    21
# options at all.)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    22
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    23
# Targets:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    24
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    25
# Defaults to building binary
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    26
# clean: remove intermediate build files
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    27
# mrproper: remove intermediate files and makefile configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    28
# upgradeconf: add new options to old Makefile.config
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    29
# osx: OS X application
563
f60fe5a7d56f (svn r972) Makefile: added make release (currently only works on mac)
bjarni
parents: 561
diff changeset
    30
# release: used by OSX to make a dmg file ready to release
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    31
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    32
# Options:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    33
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    34
# Summary of OS choice defines
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    35
# WIN32: building on Windows
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    36
# UNIX: building on *nix derivate (Linux, FreeBSD)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    37
# OSX: building on Mac OS X
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    38
# MORPHOS: building on MorphOS
421
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
    39
# BEOS: building on BeOS
446
20304ea8e94e (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
    40
# SUNOS: building on SunOS (Solaris)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    41
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    42
# Summary of library choice defines
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    43
# WITH_ZLIB: savegames using zlib
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    44
# WITH_PNG: screenshots using PNG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    45
# WITH_SDL: SDL video driver support
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    46
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    47
# Summary of other defines:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    48
# MANUAL_CONFIG: do not use Makefile.config, config options set manually
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    49
# DEBUG: build in debug mode
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    50
# PROFILE: build in profile mode, disables -s and -fomit-frame-pointer
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    51
# TRANSLATOR: build in translator mode (untranslated strings are prepended by
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    52
#             a <TODO> mark)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    53
# RELEASE: this will be the released version number. It replaces all places
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    54
#          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
    55
# MIDI: if set, it will use it as custom path to midi player.
1584
aa7fe51c4368 (svn r2088) - Fix: [ 1155158 ] Make extmidi command a config option in addition to the compile-time MIDI switch. Patch by macbaine.
pasky
parents: 1542
diff changeset
    56
#       If unset, it will use the hardcoded path in the c code
aa7fe51c4368 (svn r2088) - Fix: [ 1155158 ] Make extmidi command a config option in addition to the compile-time MIDI switch. Patch by macbaine.
pasky
parents: 1542
diff changeset
    57
#       This can still be overriden by the music.extmidi openttd.cfg option.
2197
0ffe98032b29 (svn r2712) Overhaul DirectMusic MIDI backend:
tron
parents: 2189
diff changeset
    58
# WITH_DIRECTMUSIC: enable DirectMusic MIDI support
804
06aaddf6742b (svn r1274) Makefile: networking is not longer experimental
bjarni
parents: 798
diff changeset
    59
# WITH_NETWORK: enable networking
06aaddf6742b (svn r1274) Makefile: networking is not longer experimental
bjarni
parents: 798
diff changeset
    60
# DEDICATED: allows compilation on UNIX without SDL. Useful for dedicated servers
2672
ea469d7b34ff (svn r3214) -Feature: openttd.cfg can now set how many autosaves to keep before starting to overwrite old ones
bjarni
parents: 2625
diff changeset
    61
# MAX_NUM_AUTOSAVES: sets the number of autosaves the games will make before starting
ea469d7b34ff (svn r3214) -Feature: openttd.cfg can now set how many autosaves to keep before starting to overwrite old ones
bjarni
parents: 2625
diff changeset
    62
#		to overwrite the old ones. If not set, the game will use 16.
ea469d7b34ff (svn r3214) -Feature: openttd.cfg can now set how many autosaves to keep before starting to overwrite old ones
bjarni
parents: 2625
diff changeset
    63
#		NOTE: assign a number, not a string of a number
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    64
#
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    65
# Paths:
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    66
# INSTALL: If not set, the game uses the directory of the binary to
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
    67
# store everything (lang, data, gm, save and openttd.cfg), this is the `old' behaviour.
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    68
# In this case, none of the following paths are used, you also should _not_
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    69
# use `make install', but copy the required stuff yourself (or just play out
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    70
# of you source directory, which should work fine).
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    71
# If you want to use `make install' to install the game globally, you should
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    72
# define it _before_ you build the game. If you only define INSTALL when you
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    73
# do `make install', the game won't be able to find it's files (so you should
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    74
# also define all the following paths before building).
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    75
#
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    76
# So, the following paths should be defined if INSTALL is defined.
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    77
# None of these paths have to end with /
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    78
# PREFIX:	Normally /usr/local
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    79
# BINARY_DIR:	The location of the binary, normally games. (Will be prefixed
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    80
#		with $PREFIX)
1865
8f237a5b1a5f (svn r2371) - Fix: [ 1144510 ] make install tries to install scenarios in the (non-existing) personal dir when USE_HOMEDIR is specified.
matthijs
parents: 1829
diff changeset
    81
# DATA_DIR: 	The location of the data (lang, data, gm and scenario), normally
8f237a5b1a5f (svn r2371) - Fix: [ 1144510 ] make install tries to install scenarios in the (non-existing) personal dir when USE_HOMEDIR is specified.
matthijs
parents: 1829
diff changeset
    82
#		share/games/openttd. (Will be prefixed with $PREFIX) Note that scenarios
8f237a5b1a5f (svn r2371) - Fix: [ 1144510 ] make install tries to install scenarios in the (non-existing) personal dir when USE_HOMEDIR is specified.
matthijs
parents: 1829
diff changeset
    83
#		are only put here if USE_HOMEDIR is true, otherwise they are placed in
8f237a5b1a5f (svn r2371) - Fix: [ 1144510 ] make install tries to install scenarios in the (non-existing) personal dir when USE_HOMEDIR is specified.
matthijs
parents: 1829
diff changeset
    84
#		PERSONAL_DIR/scenario
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    85
# PERSONAL_DIR:	The directory where openttd.cfg and the save folder will be
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    86
#		stored. You cannot use ~ here, define USE_HOMEDIR for that.
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    87
# USE_HOMEDIR:	If this variable is set, PERSONAL_DIR will be prefixed with
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    88
#		~/ at runtime (the user's homedir)
561
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
    89
# SECOND_DATA_PATH  Use this data dir if a file is not found in the data dir in the data path
1251
792ada467c21 (svn r1755) Trim trailing whitespace
tron
parents: 1247
diff changeset
    90
# CUSTOM_LANG_PATH  If this is set, it will use the path given to search for lng files
561
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
    91
#		instead of the lang dir in the data path
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
    92
#   NOTE: both SECOND_DATA_PATH and CUSTOM_LANG_PATH uses paths relative to where OTTD is opened
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    93
#
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    94
# DEST_DIR:	make install will use this directory instead of the filesystem
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    95
# 		root to install its files. This should normally not be used by
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    96
# 		ordinary users, currently it is only used for the debian
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    97
# 		packaging. This value should only be set when calling `make
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    98
# 		install' and is not saved in Makefile.config
1476
abbcea18a01c (svn r1980) Check $DESTDIR if $DEST_DIR was not set.
pasky
parents: 1435
diff changeset
    99
#               (Note that DESTDIR is checked if DEST_DIR is not set.)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   100
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   101
# STATIC: link statically
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   102
# CYGWIN: build in Cygwin environment
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   103
# MINGW: build with MingW compiler, link with MingW libraries
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   104
#
1411
53935a3bcea0 (svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents: 1324
diff changeset
   105
# VERBOSE: show full compiler invocations instead of brief progress messages
53935a3bcea0 (svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents: 1324
diff changeset
   106
#
1692
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   107
# Special for crosscompiling there are some commands available:
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   108
#
2713
9f06e1f94ce9 (svn r3258) -Feature: [OSX] added support for universal binaries
bjarni
parents: 2712
diff changeset
   109
# BUILD_UNIVERSAL_BINARY: builds a universal binary for OSX. Make sure you got both PPC and x86 libs
9f06e1f94ce9 (svn r3258) -Feature: [OSX] added support for universal binaries
bjarni
parents: 2712
diff changeset
   110
#
2719
146eaa0ec83c (svn r3264) -Codechange: [OSX] OSX targets will now always use the preprocessor to determine endianess
bjarni
parents: 2717
diff changeset
   111
# ENDIAN_FORCE: forces the endian-check to give a certain result. Can be BE, LE or PREPROCESSOR.
146eaa0ec83c (svn r3264) -Codechange: [OSX] OSX targets will now always use the preprocessor to determine endianess
bjarni
parents: 2717
diff changeset
   112
#	PREPROCESSOR is always used on all OSX targets and will make the preprocessor pick the right endian.
146eaa0ec83c (svn r3264) -Codechange: [OSX] OSX targets will now always use the preprocessor to determine endianess
bjarni
parents: 2717
diff changeset
   113
#	this means that you don't have to think about endianess when compiling for OSX.
146eaa0ec83c (svn r3264) -Codechange: [OSX] OSX targets will now always use the preprocessor to determine endianess
bjarni
parents: 2717
diff changeset
   114
#	Very useful for universal binaries and crosscompilers. Not sure if it works on non OSX targets
1692
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   115
# WINDRES: the location of your windres
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   116
# CC_HOST: the gcc of your localhost if you are making a target that produces incompatible executables
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   117
# CFLAGS_HOST: cflags used for CC_HOST. Make it something if you are getting errors when you try to compi
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   118
#		windows executables on linux. (just: CFLAGS_HOST:='-I' or something)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   119
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   120
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   121
##############################################################################
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   122
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   123
# Configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   124
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   125
1148
c7925e9e1182 (svn r1649) Makefile: added known-bugs.txt to mac and MorphOS release scripts and made a really dirty hack to force 0.3.6 on binary files compiled with this makefile
bjarni
parents: 1146
diff changeset
   126
180
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   127
# Makefile version tag
1492
e03a8c6f7efd (svn r1996) makefile.config -> Makefile.config, that's its name.
pasky
parents: 1491
diff changeset
   128
# it checks if the version tag in Makefile.config is the same and force update outdated config files
2672
ea469d7b34ff (svn r3214) -Feature: openttd.cfg can now set how many autosaves to keep before starting to overwrite old ones
bjarni
parents: 2625
diff changeset
   129
MAKEFILE_VERSION:=8
180
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   130
1146
320c139342d0 (svn r1647) Remove stale comment and fix typo
tron
parents: 1119
diff changeset
   131
# CONFIG_WRITER has to be found even for manual configuration
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   132
CONFIG_WRITER=makefiledir/Makefile.config_writer
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   133
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   134
ifndef MANUAL_CONFIG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   135
# Automatic configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   136
MAKE_CONFIG:=Makefile.config
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   137
MAKEFILE:=Makefile
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   138
LIB_DETECTION=makefiledir/Makefile.libdetection
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   139
CONFIG_WRITER=makefiledir/Makefile.config_writer
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   140
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   141
# Apply automatic configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   142
# See target section for how this is built, suppress errors
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   143
# since first time it isn't found but make reads this twice
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   144
-include $(MAKE_CONFIG)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   145
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   146
CONFIG_INCLUDED:=1
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   147
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   148
1955
52a84e880864 (svn r2461) -Feature [Makefile] libpng-config can now be called something else in Makefile.config
bjarni
parents: 1952
diff changeset
   149
ifndef LIBPNG-CONFIG
52a84e880864 (svn r2461) -Feature [Makefile] libpng-config can now be called something else in Makefile.config
bjarni
parents: 1952
diff changeset
   150
LIBPNG-CONFIG :=libpng-config
52a84e880864 (svn r2461) -Feature [Makefile] libpng-config can now be called something else in Makefile.config
bjarni
parents: 1952
diff changeset
   151
endif
52a84e880864 (svn r2461) -Feature [Makefile] libpng-config can now be called something else in Makefile.config
bjarni
parents: 1952
diff changeset
   152
1492
e03a8c6f7efd (svn r1996) makefile.config -> Makefile.config, that's its name.
pasky
parents: 1491
diff changeset
   153
# 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
   154
ifneq ($(MAKEFILE_VERSION),$(CONFIG_VERSION))
189
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   155
	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
   156
		UPDATECONFIG:=upgradeconf
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   157
		CONFIG_INCLUDED:=
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
		# 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
   160
		ifeq ($(shell uname),FreeBSD)
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   161
			SDL-CONFIG:=sdl11-config
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   162
		else
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   163
			SDL-CONFIG:=sdl-config
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   164
		endif
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   165
	endif
1693
e3a6eedee876 (svn r2197) -fix [Makefile]: SDL_CONFIG from makefile.config is now not always overwritten
bjarni
parents: 1692
diff changeset
   166
endif
e3a6eedee876 (svn r2197) -fix [Makefile]: SDL_CONFIG from makefile.config is now not always overwritten
bjarni
parents: 1692
diff changeset
   167
e3a6eedee876 (svn r2197) -fix [Makefile]: SDL_CONFIG from makefile.config is now not always overwritten
bjarni
parents: 1692
diff changeset
   168
ifndef SDL-CONFIG
e3a6eedee876 (svn r2197) -fix [Makefile]: SDL_CONFIG from makefile.config is now not always overwritten
bjarni
parents: 1692
diff changeset
   169
	UPDATECONFIG:=upgradeconf
e3a6eedee876 (svn r2197) -fix [Makefile]: SDL_CONFIG from makefile.config is now not always overwritten
bjarni
parents: 1692
diff changeset
   170
	CONFIG_INCLUDED:=
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   171
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   172
2713
9f06e1f94ce9 (svn r3258) -Feature: [OSX] added support for universal binaries
bjarni
parents: 2712
diff changeset
   173
ifdef UNIVERSAL_OTHER_HALF
9f06e1f94ce9 (svn r3258) -Feature: [OSX] added support for universal binaries
bjarni
parents: 2712
diff changeset
   174
	ifndef CC_HOST
9f06e1f94ce9 (svn r3258) -Feature: [OSX] added support for universal binaries
bjarni
parents: 2712
diff changeset
   175
	# we are crosscompiling, so we should remember what compiler we should use for strgen
9f06e1f94ce9 (svn r3258) -Feature: [OSX] added support for universal binaries
bjarni
parents: 2712
diff changeset
   176
		CC_HOST = $(CC)
9f06e1f94ce9 (svn r3258) -Feature: [OSX] added support for universal binaries
bjarni
parents: 2712
diff changeset
   177
	endif
9f06e1f94ce9 (svn r3258) -Feature: [OSX] added support for universal binaries
bjarni
parents: 2712
diff changeset
   178
	CC_TARGET = $(CC_UNI)
9f06e1f94ce9 (svn r3258) -Feature: [OSX] added support for universal binaries
bjarni
parents: 2712
diff changeset
   179
	CFLAGS = $(CFLAGS_UNI)
9f06e1f94ce9 (svn r3258) -Feature: [OSX] added support for universal binaries
bjarni
parents: 2712
diff changeset
   180
	LDFLAGS = $(LDFLAGS_UNI)
9f06e1f94ce9 (svn r3258) -Feature: [OSX] added support for universal binaries
bjarni
parents: 2712
diff changeset
   181
	SDL-CONFIG = $(SDL-CONFIG_UNI)
9f06e1f94ce9 (svn r3258) -Feature: [OSX] added support for universal binaries
bjarni
parents: 2712
diff changeset
   182
	LIBPNG-CONFIG = $(LIBPNG-CONFIG_UNI)
2717
0f385152f0d3 (svn r3262) -Fix: [OSX] universal binaries can now include the dynamic SDL lib into the bundle
bjarni
parents: 2714
diff changeset
   183
	LIBS:=
2713
9f06e1f94ce9 (svn r3258) -Feature: [OSX] added support for universal binaries
bjarni
parents: 2712
diff changeset
   184
endif
9f06e1f94ce9 (svn r3258) -Feature: [OSX] added support for universal binaries
bjarni
parents: 2712
diff changeset
   185
1492
e03a8c6f7efd (svn r1996) makefile.config -> Makefile.config, that's its name.
pasky
parents: 1491
diff changeset
   186
# this is used if there aren't any Makefile.config
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   187
ifndef CONFIG_INCLUDED
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   188
# sets network on by default if there aren't any config file
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   189
ENABLE_NETWORK:=1
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   190
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   191
# paths for make install
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   192
# disabled as they would break it for some (many?) people if they were default
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   193
#PREFIX:=/usr/local
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   194
#DATA_DIR:=share/games/openttd
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   195
#BINARY_DIR:=games
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   196
#PERSONAL_DIR:=.openttd
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   197
#USE_HOMEDIR:=1
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   198
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   199
-include $(LIB_DETECTION)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   200
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   201
180
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   202
ifdef SUPRESS_LANG_ERRORS
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   203
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
   204
endif
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   205
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   206
ifdef STATIC
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   207
ifndef WIN32
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   208
ifndef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   209
ifndef MORPHOS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   210
ifndef SKIP_STATIC_CHECK
1492
e03a8c6f7efd (svn r1996) makefile.config -> Makefile.config, that's its name.
pasky
parents: 1491
diff changeset
   211
$(error Static is only known to work on MorphOS and MacOSX!!! --- Check Makefile.config for more info and howto bypass this check)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   212
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   213
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   214
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   215
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   216
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   217
2712
53cd36fff6c1 (svn r3257) -Codechange: [OSX] removed the dynamic lib in bundle option (introduced in rev 3230)
bjarni
parents: 2689
diff changeset
   218
ifdef OSX
53cd36fff6c1 (svn r3257) -Codechange: [OSX] removed the dynamic lib in bundle option (introduced in rev 3230)
bjarni
parents: 2689
diff changeset
   219
ifdef RELEASE
53cd36fff6c1 (svn r3257) -Codechange: [OSX] removed the dynamic lib in bundle option (introduced in rev 3230)
bjarni
parents: 2689
diff changeset
   220
# all OSX releases needs to be static
53cd36fff6c1 (svn r3257) -Codechange: [OSX] removed the dynamic lib in bundle option (introduced in rev 3230)
bjarni
parents: 2689
diff changeset
   221
# end users don't tend to have the dynamic libs installed
53cd36fff6c1 (svn r3257) -Codechange: [OSX] removed the dynamic lib in bundle option (introduced in rev 3230)
bjarni
parents: 2689
diff changeset
   222
$(warning Compiling a dynamic release. It should be static unless you really know what you are doing!!!)
53cd36fff6c1 (svn r3257) -Codechange: [OSX] removed the dynamic lib in bundle option (introduced in rev 3230)
bjarni
parents: 2689
diff changeset
   223
endif
53cd36fff6c1 (svn r3257) -Codechange: [OSX] removed the dynamic lib in bundle option (introduced in rev 3230)
bjarni
parents: 2689
diff changeset
   224
endif
53cd36fff6c1 (svn r3257) -Codechange: [OSX] removed the dynamic lib in bundle option (introduced in rev 3230)
bjarni
parents: 2689
diff changeset
   225
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   226
# Force SDL on UNIX platforms
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   227
ifndef WITH_SDL
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   228
ifdef UNIX
549
004bcc2b1033 (svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
bjarni
parents: 543
diff changeset
   229
ifndef DEDICATED
004bcc2b1033 (svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
bjarni
parents: 543
diff changeset
   230
$(error You need to have SDL installed in order to run OpenTTD on UNIX. Use DEDICATED if you want to compile a CLI based server)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   231
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   232
endif
549
004bcc2b1033 (svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
bjarni
parents: 543
diff changeset
   233
endif
004bcc2b1033 (svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
bjarni
parents: 543
diff changeset
   234
1029
c6bbfed6fc26 (svn r1530) Makefilefix: now the binary never links to SDL if DEDICATED is set. Thanks to igor2code for making me aware of this issue even through I fixed it in a different way than his patch did. (I made dedicated never link to sdl, nomatter what makefile.config says)
bjarni
parents: 988
diff changeset
   235
# remove the dependancy for sdl if DEDICALTED is used
1952
499b7bd9f63c (svn r2458) -Fix: Quickfix to make dedicated-server compile again. We need a more ellegant way to fix this...
truelight
parents: 1951
diff changeset
   236
# and add -lpthread to LDFLAGS, because SDL normally adds that...
1029
c6bbfed6fc26 (svn r1530) Makefilefix: now the binary never links to SDL if DEDICATED is set. Thanks to igor2code for making me aware of this issue even through I fixed it in a different way than his patch did. (I made dedicated never link to sdl, nomatter what makefile.config says)
bjarni
parents: 988
diff changeset
   237
ifdef DEDICATED
c6bbfed6fc26 (svn r1530) Makefilefix: now the binary never links to SDL if DEDICATED is set. Thanks to igor2code for making me aware of this issue even through I fixed it in a different way than his patch did. (I made dedicated never link to sdl, nomatter what makefile.config says)
bjarni
parents: 988
diff changeset
   238
WITH_SDL:=
2298
64a87da01248 (svn r2822) -Fix: don't compile pthread for win32 dedicated servers
truelight
parents: 2291
diff changeset
   239
ifndef WIN32
2299
480d89e53ab1 (svn r2823) -Fix: MorphOS doesn't have pthread either!
truelight
parents: 2298
diff changeset
   240
ifndef MORPHOS
2300
d85dbbd78fd5 (svn r2824) -Fix: OSX can now also produce dedicated servers
truelight
parents: 2299
diff changeset
   241
ifndef OSX
1952
499b7bd9f63c (svn r2458) -Fix: Quickfix to make dedicated-server compile again. We need a more ellegant way to fix this...
truelight
parents: 1951
diff changeset
   242
LDFLAGS+=-lpthread
1029
c6bbfed6fc26 (svn r1530) Makefilefix: now the binary never links to SDL if DEDICATED is set. Thanks to igor2code for making me aware of this issue even through I fixed it in a different way than his patch did. (I made dedicated never link to sdl, nomatter what makefile.config says)
bjarni
parents: 988
diff changeset
   243
endif
2298
64a87da01248 (svn r2822) -Fix: don't compile pthread for win32 dedicated servers
truelight
parents: 2291
diff changeset
   244
endif
2299
480d89e53ab1 (svn r2823) -Fix: MorphOS doesn't have pthread either!
truelight
parents: 2298
diff changeset
   245
endif
2300
d85dbbd78fd5 (svn r2824) -Fix: OSX can now also produce dedicated servers
truelight
parents: 2299
diff changeset
   246
ifdef OSX
d85dbbd78fd5 (svn r2824) -Fix: OSX can now also produce dedicated servers
truelight
parents: 2299
diff changeset
   247
LDFLAGS+=-framework Cocoa
d85dbbd78fd5 (svn r2824) -Fix: OSX can now also produce dedicated servers
truelight
parents: 2299
diff changeset
   248
endif
d85dbbd78fd5 (svn r2824) -Fix: OSX can now also produce dedicated servers
truelight
parents: 2299
diff changeset
   249
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   250
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   251
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   252
##############################################################################
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   253
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   254
# Compiler configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   255
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   256
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   257
# Executable file extension
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   258
ifdef WIN32
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   259
EXE=.exe
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   260
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   261
EXE=
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   262
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   263
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   264
# Set output executable names
32
bc861ea6d23b (svn r33) -Executeable is now openttd(.exe) always
darkvater
parents: 0
diff changeset
   265
TTD=openttd$(EXE)
157
dd017fa3bad8 (svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents: 126
diff changeset
   266
ENDIAN_CHECK=endian_check$(EXE)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   267
STRGEN=strgen/strgen$(EXE)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   268
OSXAPP="OpenTTD.app"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   269
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   270
ifdef RELEASE
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   271
REV:=$(RELEASE)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   272
else
450
c5102d6f280e (svn r660) Fix typo introduced in r655
tron
parents: 446
diff changeset
   273
REV := $(shell if test -d .svn; then svnversion . | awk '{ print "r"$$0 }'; fi)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   274
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   275
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   276
# MorphOS needs builddate
1289
93edd9c4e1b6 (svn r1793) Revert one instance of $(shell) back to ``, because MorphOS does The Wrong Thing(tm) when date is used within $(shell)
tron
parents: 1288
diff changeset
   277
BUILDDATE=`date +%d.%m.%y`
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   278
1692
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   279
# Check if there is a windres override
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   280
ifndef WINDRES
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   281
WINDRES = windres
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   282
endif
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   283
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   284
# Check if we have a new target
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   285
ifdef CC_TARGET
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   286
CC = $(CC_TARGET)
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   287
endif
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   288
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   289
# Check if CC_HOST is defined. If not, it is CC
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   290
ifndef CC_HOST
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   291
CC_HOST = $(CC)
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   292
endif
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   293
ifndef CFLAGS_HOST
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   294
CFLAGS_HOST = $(BASECFLAGS)
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   295
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   296
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   297
1069
922f5c7be173 (svn r1570) Make the gcc version test work with old versions of test (i.e. don't use the < operator)
tron
parents: 1052
diff changeset
   298
CC_VERSION = $(shell $(CC) -dumpversion | cut -c 1,3)
1052
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   299
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   300
# GNU make can only test for (in)equality
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   301
# this is a workaround to test for >=
2240
8f18d87a4b5c (svn r2760) Remove stale comments, long unused stuff and simplify some checks
tron
parents: 2236
diff changeset
   302
ifeq ($(shell expr $(CC_VERSION) \>= 29), 1)
1093
e8d26c7dc42f (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents: 1069
diff changeset
   303
  CFLAGS += -O -Wall -Wno-multichar -Wsign-compare -Wstrict-prototypes
1324
ff8b7799b44f (svn r1828) New warning flag especially for truelight (:<
tron
parents: 1317
diff changeset
   304
  CFLAGS += -Wwrite-strings -Wpointer-arith
1052
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   305
endif
2240
8f18d87a4b5c (svn r2760) Remove stale comments, long unused stuff and simplify some checks
tron
parents: 2236
diff changeset
   306
ifeq ($(shell expr $(CC_VERSION) \>= 30), 1)
1052
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   307
  CFLAGS += -W -Wno-unused-parameter
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   308
endif
2240
8f18d87a4b5c (svn r2760) Remove stale comments, long unused stuff and simplify some checks
tron
parents: 2236
diff changeset
   309
ifeq ($(shell expr $(CC_VERSION) \>= 34), 1)
1093
e8d26c7dc42f (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents: 1069
diff changeset
   310
  CFLAGS += -Wdeclaration-after-statement -Wold-style-definition
1052
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   311
endif
53e669371277 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   312
1240
90b225e69c23 (svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents: 1211
diff changeset
   313
ifdef DEBUG
1479
3bb687fbe344 (svn r1983) Introduce multiple compile time debug levels
tron
parents: 1476
diff changeset
   314
  ifeq ($(shell expr $(DEBUG) \>= 1), 1)
3bb687fbe344 (svn r1983) Introduce multiple compile time debug levels
tron
parents: 1476
diff changeset
   315
    CFLAGS += -g -D_DEBUG
3bb687fbe344 (svn r1983) Introduce multiple compile time debug levels
tron
parents: 1476
diff changeset
   316
  endif
3bb687fbe344 (svn r1983) Introduce multiple compile time debug levels
tron
parents: 1476
diff changeset
   317
  ifeq ($(shell expr $(DEBUG) \>= 2), 1)
3bb687fbe344 (svn r1983) Introduce multiple compile time debug levels
tron
parents: 1476
diff changeset
   318
    CFLAGS += -fno-inline
3bb687fbe344 (svn r1983) Introduce multiple compile time debug levels
tron
parents: 1476
diff changeset
   319
  endif
3bb687fbe344 (svn r1983) Introduce multiple compile time debug levels
tron
parents: 1476
diff changeset
   320
  ifeq ($(shell expr $(DEBUG) \>= 3), 1)
3bb687fbe344 (svn r1983) Introduce multiple compile time debug levels
tron
parents: 1476
diff changeset
   321
    CFLAGS += -O0
3bb687fbe344 (svn r1983) Introduce multiple compile time debug levels
tron
parents: 1476
diff changeset
   322
  endif
1240
90b225e69c23 (svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents: 1211
diff changeset
   323
endif
90b225e69c23 (svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents: 1211
diff changeset
   324
90b225e69c23 (svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents: 1211
diff changeset
   325
ifdef PROFILE
90b225e69c23 (svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents: 1211
diff changeset
   326
  CFLAGS += -pg
90b225e69c23 (svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents: 1211
diff changeset
   327
  LDFLAGS += -pg
90b225e69c23 (svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents: 1211
diff changeset
   328
endif
90b225e69c23 (svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents: 1211
diff changeset
   329
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   330
CDEFS=-DWITH_REV
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   331
1240
90b225e69c23 (svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents: 1211
diff changeset
   332
ifndef DEBUG
90b225e69c23 (svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents: 1211
diff changeset
   333
ifndef PROFILE
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   334
# Release mode
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   335
ifndef MORPHOS
1810
bf33a29287e5 (svn r2314) - Feature: [ 1187490 ] Patches for building on IRIX (jgilje)
Darkvater
parents: 1722
diff changeset
   336
ifndef IRIX
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   337
# automatical strip breaks under morphos
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   338
BASECFLAGS += -s
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   339
LDFLAGS += -s
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   340
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   341
endif
1810
bf33a29287e5 (svn r2314) - Feature: [ 1187490 ] Patches for building on IRIX (jgilje)
Darkvater
parents: 1722
diff changeset
   342
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   343
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   344
ifdef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   345
# these compilerflags makes the app run as fast as possible without making the app unstable. It works on G3 or newer
2713
9f06e1f94ce9 (svn r3258) -Feature: [OSX] added support for universal binaries
bjarni
parents: 2712
diff changeset
   346
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
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   347
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   348
ifdef MORPHOS
2356
9277224514f6 (svn r2882) Some fixes for MorphOS (by tokai)
tron
parents: 2340
diff changeset
   349
BASECFLAGS += -I/gg/os-include -O2 -noixemul -fstrict-aliasing -fexpensive-optimizations
1291
95fbc2f47175 (svn r1795) Change CFLAGS for MorphOS (tokai)
tron
parents: 1289
diff changeset
   350
BASECFLAGS += -mcpu=604 -fno-inline -mstring -mmultiple
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   351
else
1169
30e8657f61d0 (svn r1671) Remove WARNING_DISPLAY, because it contained no warning, but an optimization flag
tron
parents: 1168
diff changeset
   352
BASECFLAGS += -O2
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   353
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   354
ifndef PROFILE
1810
bf33a29287e5 (svn r2314) - Feature: [ 1187490 ] Patches for building on IRIX (jgilje)
Darkvater
parents: 1722
diff changeset
   355
ifndef IRIX
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   356
BASECFLAGS += -fomit-frame-pointer
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   357
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   358
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   359
endif
1810
bf33a29287e5 (svn r2314) - Feature: [ 1187490 ] Patches for building on IRIX (jgilje)
Darkvater
parents: 1722
diff changeset
   360
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   361
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   362
ifdef STATIC
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   363
ifndef OSX	# OSX can't build static if -static flag is used
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   364
LDFLAGS += -static
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   365
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   366
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   367
798
6b5518bf858f (svn r1268) -Fix: some warnings in gfx.c fixed
darkvater
parents: 770
diff changeset
   368
# If building on MingW don't link with Cygwin libs
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   369
ifdef WIN32
798
6b5518bf858f (svn r1268) -Fix: some warnings in gfx.c fixed
darkvater
parents: 770
diff changeset
   370
ifdef CYGWIN
6b5518bf858f (svn r1268) -Fix: some warnings in gfx.c fixed
darkvater
parents: 770
diff changeset
   371
BASECFLAGS += -mwin32
6b5518bf858f (svn r1268) -Fix: some warnings in gfx.c fixed
darkvater
parents: 770
diff changeset
   372
LDFLAGS += -mwin32
6b5518bf858f (svn r1268) -Fix: some warnings in gfx.c fixed
darkvater
parents: 770
diff changeset
   373
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   374
ifdef MINGW
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   375
BASECFLAGS += -mno-cygwin
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   376
LDFLAGS += -mno-cygwin
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   377
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   378
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   379
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   380
CFLAGS += $(BASECFLAGS)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   381
2033
1eb15b79b6f3 (svn r2542) -Add: [GPMI] Added GPMI (http://sourceforge.net/projects/libgpmi/)
truelight
parents: 2008
diff changeset
   382
# See if we want to enable GPMI
1eb15b79b6f3 (svn r2542) -Add: [GPMI] Added GPMI (http://sourceforge.net/projects/libgpmi/)
truelight
parents: 2008
diff changeset
   383
ifdef GPMI
2689
9b010b734253 (svn r3231) Fix: update the GPMI implementation to the latest GPMI-API version
truelight
parents: 2688
diff changeset
   384
CFLAGS  += -DGPMI `gpmi-config --include`
2033
1eb15b79b6f3 (svn r2542) -Add: [GPMI] Added GPMI (http://sourceforge.net/projects/libgpmi/)
truelight
parents: 2008
diff changeset
   385
GPMI_STATIC_PATH = `gpmi-config --static`
1eb15b79b6f3 (svn r2542) -Add: [GPMI] Added GPMI (http://sourceforge.net/projects/libgpmi/)
truelight
parents: 2008
diff changeset
   386
LDFLAGS += -rdynamic `gpmi-config --libs`
1eb15b79b6f3 (svn r2542) -Add: [GPMI] Added GPMI (http://sourceforge.net/projects/libgpmi/)
truelight
parents: 2008
diff changeset
   387
# Static link paths into the game
1eb15b79b6f3 (svn r2542) -Add: [GPMI] Added GPMI (http://sourceforge.net/projects/libgpmi/)
truelight
parents: 2008
diff changeset
   388
LDFLAGS += $(GPMI_STATIC_PATH)/paths-static.o
1eb15b79b6f3 (svn r2542) -Add: [GPMI] Added GPMI (http://sourceforge.net/projects/libgpmi/)
truelight
parents: 2008
diff changeset
   389
endif
1eb15b79b6f3 (svn r2542) -Add: [GPMI] Added GPMI (http://sourceforge.net/projects/libgpmi/)
truelight
parents: 2008
diff changeset
   390
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   391
ifdef UNIX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   392
CDEFS += -DUNIX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   393
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   394
421
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   395
ifdef BEOS
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   396
CDEFS += -DBEOS
2497
1c8460570c0d (svn r3023) -Fix [BeOS] fixed compilation on BeOS R5 (MYOB)
bjarni
parents: 2496
diff changeset
   397
LDFLAGS += -lmidi -lbe -lpthread
421
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   398
ifdef WITH_NETWORK
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   399
	ifdef BEOS_NET_SERVER
1051
c56a3ce9b64f (svn r1552) Make ottd compile on Zeta
tron
parents: 1029
diff changeset
   400
		CDEFS += -DBEOS_NET_SERVER
2497
1c8460570c0d (svn r3023) -Fix [BeOS] fixed compilation on BeOS R5 (MYOB)
bjarni
parents: 2496
diff changeset
   401
		LDFLAGS += -lnet
1051
c56a3ce9b64f (svn r1552) Make ottd compile on Zeta
tron
parents: 1029
diff changeset
   402
	else
2497
1c8460570c0d (svn r3023) -Fix [BeOS] fixed compilation on BeOS R5 (MYOB)
bjarni
parents: 2496
diff changeset
   403
		# BONE needs a few more libraries than R5
1051
c56a3ce9b64f (svn r1552) Make ottd compile on Zeta
tron
parents: 1029
diff changeset
   404
		LDFLAGS += -lbind -lsocket
421
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   405
	endif
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   406
endif
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   407
endif
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   408
1164
01c12c2f1973 (svn r1666) Move some MorphOS compile flags to a place where they actually belong
tron
parents: 1163
diff changeset
   409
ifdef MORPHOS
1291
95fbc2f47175 (svn r1795) Change CFLAGS for MorphOS (tokai)
tron
parents: 1289
diff changeset
   410
# -Wstrict-prototypes generates much noise because of system headers
95fbc2f47175 (svn r1795) Change CFLAGS for MorphOS (tokai)
tron
parents: 1289
diff changeset
   411
CFLAGS += -Wno-strict-prototypes
1164
01c12c2f1973 (svn r1666) Move some MorphOS compile flags to a place where they actually belong
tron
parents: 1163
diff changeset
   412
endif
01c12c2f1973 (svn r1666) Move some MorphOS compile flags to a place where they actually belong
tron
parents: 1163
diff changeset
   413
446
20304ea8e94e (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   414
ifdef SUNOS
20304ea8e94e (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   415
CDEFS += -DSUNOS
20304ea8e94e (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   416
ifdef WITH_NETWORK
20304ea8e94e (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   417
LDFLAGS += -lnsl -lsocket
20304ea8e94e (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   418
endif
20304ea8e94e (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   419
endif
20304ea8e94e (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   420
2500
e2b13f720a94 (svn r3026) -Fix: [OSX] fixed bug that prevented dedicated servers from compiling (introduced in r3022)
bjarni
parents: 2497
diff changeset
   421
# tell the source that we are building a dedicated server
e2b13f720a94 (svn r3026) -Fix: [OSX] fixed bug that prevented dedicated servers from compiling (introduced in r3022)
bjarni
parents: 2497
diff changeset
   422
ifdef DEDICATED
e2b13f720a94 (svn r3026) -Fix: [OSX] fixed bug that prevented dedicated servers from compiling (introduced in r3022)
bjarni
parents: 2497
diff changeset
   423
CDEFS += -DDEDICATED
e2b13f720a94 (svn r3026) -Fix: [OSX] fixed bug that prevented dedicated servers from compiling (introduced in r3022)
bjarni
parents: 2497
diff changeset
   424
endif
e2b13f720a94 (svn r3026) -Fix: [OSX] fixed bug that prevented dedicated servers from compiling (introduced in r3022)
bjarni
parents: 2497
diff changeset
   425
2717
0f385152f0d3 (svn r3262) -Fix: [OSX] universal binaries can now include the dynamic SDL lib into the bundle
bjarni
parents: 2714
diff changeset
   426
ifdef OSX
0f385152f0d3 (svn r3262) -Fix: [OSX] universal binaries can now include the dynamic SDL lib into the bundle
bjarni
parents: 2714
diff changeset
   427
ifdef STATIC
0f385152f0d3 (svn r3262) -Fix: [OSX] universal binaries can now include the dynamic SDL lib into the bundle
bjarni
parents: 2714
diff changeset
   428
ifdef UNIVERSAL_OTHER_HALF
0f385152f0d3 (svn r3262) -Fix: [OSX] universal binaries can now include the dynamic SDL lib into the bundle
bjarni
parents: 2714
diff changeset
   429
	STATIC:=
0f385152f0d3 (svn r3262) -Fix: [OSX] universal binaries can now include the dynamic SDL lib into the bundle
bjarni
parents: 2714
diff changeset
   430
	DYNAMIC_SDL_IN_STATIC:=1
0f385152f0d3 (svn r3262) -Fix: [OSX] universal binaries can now include the dynamic SDL lib into the bundle
bjarni
parents: 2714
diff changeset
   431
endif
0f385152f0d3 (svn r3262) -Fix: [OSX] universal binaries can now include the dynamic SDL lib into the bundle
bjarni
parents: 2714
diff changeset
   432
endif
0f385152f0d3 (svn r3262) -Fix: [OSX] universal binaries can now include the dynamic SDL lib into the bundle
bjarni
parents: 2714
diff changeset
   433
endif
0f385152f0d3 (svn r3262) -Fix: [OSX] universal binaries can now include the dynamic SDL lib into the bundle
bjarni
parents: 2714
diff changeset
   434
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   435
# SDL config
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   436
ifdef WITH_SDL
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   437
CDEFS += -DWITH_SDL
1254
c3705f146d8a (svn r1758) Replace `` with $(shell), because the latter is only evaluated once instead of over and over again
tron
parents: 1251
diff changeset
   438
CFLAGS += $(shell $(SDL-CONFIG) --cflags)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   439
ifdef STATIC
1254
c3705f146d8a (svn r1758) Replace `` with $(shell), because the latter is only evaluated once instead of over and over again
tron
parents: 1251
diff changeset
   440
LIBS += $(shell $(SDL-CONFIG) --static-libs)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   441
else
1254
c3705f146d8a (svn r1758) Replace `` with $(shell), because the latter is only evaluated once instead of over and over again
tron
parents: 1251
diff changeset
   442
LIBS += $(shell $(SDL-CONFIG) --libs)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   443
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   444
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   445
2717
0f385152f0d3 (svn r3262) -Fix: [OSX] universal binaries can now include the dynamic SDL lib into the bundle
bjarni
parents: 2714
diff changeset
   446
ifdef DYNAMIC_SDL_IN_STATIC
0f385152f0d3 (svn r3262) -Fix: [OSX] universal binaries can now include the dynamic SDL lib into the bundle
bjarni
parents: 2714
diff changeset
   447
STATIC:=1
0f385152f0d3 (svn r3262) -Fix: [OSX] universal binaries can now include the dynamic SDL lib into the bundle
bjarni
parents: 2714
diff changeset
   448
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   449
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   450
# zlib config
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   451
ifdef WITH_ZLIB
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   452
	CDEFS +=  -DWITH_ZLIB
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   453
	ifdef STATIC
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   454
		ifdef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   455
# zlib is default on OSX, so everybody have it. No need for static linking
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   456
			LIBS += -lz
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   457
		else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   458
			ifndef STATIC_ZLIB_PATH
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   459
				ifndef MANUAL_CONFIG
1492
e03a8c6f7efd (svn r1996) makefile.config -> Makefile.config, that's its name.
pasky
parents: 1491
diff changeset
   460
					# updates Makefile.config with the zlib path
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   461
					UPDATECONFIG:=upgradeconf
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   462
				endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   463
				TEMP:=$(shell ls /lib 2>/dev/null | grep "zlib.a")$(shell ls /lib 2>/dev/null | grep "libz.a")
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   464
				ifdef TEMP
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   465
					STATIC_ZLIB_PATH:=/lib/$(TEMP)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   466
				else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   467
					TEMP:=$(shell ls /usr/lib 2>/dev/null | grep "zlib.a")$(shell ls /usr/lib 2>/dev/null | grep "libz.a")
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   468
					ifdef TEMP
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   469
						STATIC_ZLIB_PATH:=/usr/lib/$(TEMP)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   470
					else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   471
						TEMP:=$(shell ls /usr/local/lib 2>/dev/null | grep "zlib.a")$(shell ls /usr/local/lib 2>/dev/null | grep "libz.a")
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   472
						ifdef TEMP
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   473
							STATIC_ZLIB_PATH:=/usr/local/lib/$(TEMP)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   474
						endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   475
					endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   476
				endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   477
			endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   478
			LIBS += $(STATIC_ZLIB_PATH)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   479
		endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   480
	else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   481
		LIBS += -lz
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   482
	endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   483
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   484
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   485
# libpng config
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   486
ifdef WITH_PNG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   487
CDEFS += -DWITH_PNG
2315
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
   488
CFLAGS += $(shell $(LIBPNG-CONFIG) --cppflags --I_opts)
551
48dc69ef0e94 (svn r951) Makefile: fixed missing flag for libpng, which prevented lib detection if SDL was not used
bjarni
parents: 549
diff changeset
   489
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   490
# seems like older libpng versions are broken and need this
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   491
PNGCONFIG_FLAGS = --ldflags --libs
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   492
ifdef STATIC
583
3bcdf7a0c2f7 (svn r1003) Mac: reintroduced the static libpng hack in makefile since it appears to be needed in the nightly builds
bjarni
parents: 580
diff changeset
   493
ifdef OSX
3bcdf7a0c2f7 (svn r1003) Mac: reintroduced the static libpng hack in makefile since it appears to be needed in the nightly builds
bjarni
parents: 580
diff changeset
   494
# Seems like we need a tiny hack for OSX static to work
1955
52a84e880864 (svn r2461) -Feature [Makefile] libpng-config can now be called something else in Makefile.config
bjarni
parents: 1952
diff changeset
   495
LIBS += $(shell $(LIBPNG-CONFIG) --prefix)/lib/libpng.a
583
3bcdf7a0c2f7 (svn r1003) Mac: reintroduced the static libpng hack in makefile since it appears to be needed in the nightly builds
bjarni
parents: 580
diff changeset
   496
else
1955
52a84e880864 (svn r2461) -Feature [Makefile] libpng-config can now be called something else in Makefile.config
bjarni
parents: 1952
diff changeset
   497
LIBS += $(shell $(LIBPNG-CONFIG) --static $(PNGCONFIG_FLAGS))
583
3bcdf7a0c2f7 (svn r1003) Mac: reintroduced the static libpng hack in makefile since it appears to be needed in the nightly builds
bjarni
parents: 580
diff changeset
   498
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   499
else
1955
52a84e880864 (svn r2461) -Feature [Makefile] libpng-config can now be called something else in Makefile.config
bjarni
parents: 1952
diff changeset
   500
LIBS += $(shell $(LIBPNG-CONFIG)  --L_opts $(PNGCONFIG_FLAGS))
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   501
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   502
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   503
347
892935295937 (svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents: 285
diff changeset
   504
# enables/disables assert()
348
959f425dc282 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   505
ifdef DISABLE_ASSERTS
959f425dc282 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   506
CFLAGS += -DNDEBUG
959f425dc282 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   507
endif
959f425dc282 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   508
959f425dc282 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   509
# automatically disables asserts for release
959f425dc282 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   510
ifdef RELEASE
347
892935295937 (svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents: 285
diff changeset
   511
ifndef ENABLE_ASSERTS
892935295937 (svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents: 285
diff changeset
   512
CFLAGS += -DNDEBUG
892935295937 (svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents: 285
diff changeset
   513
endif
348
959f425dc282 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   514
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   515
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   516
ifdef TRANSLATOR
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   517
STRGEN_FLAGS=-t
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   518
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   519
STRGEN_FLAGS=
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   520
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   521
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   522
2555
58ed3afaf3ab (svn r3088) -Fix: [OSX] fixed issue where OSX could not dynamic link to quicktime [ 1334917 ]
bjarni
parents: 2505
diff changeset
   523
# OSX specific setup
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   524
ifdef OSX
2719
146eaa0ec83c (svn r3264) -Codechange: [OSX] OSX targets will now always use the preprocessor to determine endianess
bjarni
parents: 2717
diff changeset
   525
	# set the endian flag for OSX, that can't fail
146eaa0ec83c (svn r3264) -Codechange: [OSX] OSX targets will now always use the preprocessor to determine endianess
bjarni
parents: 2717
diff changeset
   526
	ENDIAN_FORCE:=PREPROCESSOR
146eaa0ec83c (svn r3264) -Codechange: [OSX] OSX targets will now always use the preprocessor to determine endianess
bjarni
parents: 2717
diff changeset
   527
2688
ef9861cdd745 (svn r3230) -Feature: [OSX] OSX builds can now change where it searches for dynamic libs and can move libs into the bundle
bjarni
parents: 2672
diff changeset
   528
	# ensure that changing libpathnames will not overwrite anything in the binary
ef9861cdd745 (svn r3230) -Feature: [OSX] OSX builds can now change where it searches for dynamic libs and can move libs into the bundle
bjarni
parents: 2672
diff changeset
   529
	LDFLAGS += -headerpad_max_install_names
ef9861cdd745 (svn r3230) -Feature: [OSX] OSX builds can now change where it searches for dynamic libs and can move libs into the bundle
bjarni
parents: 2672
diff changeset
   530
2555
58ed3afaf3ab (svn r3088) -Fix: [OSX] fixed issue where OSX could not dynamic link to quicktime [ 1334917 ]
bjarni
parents: 2505
diff changeset
   531
	ifndef DEDICATED
58ed3afaf3ab (svn r3088) -Fix: [OSX] fixed issue where OSX could not dynamic link to quicktime [ 1334917 ]
bjarni
parents: 2505
diff changeset
   532
		LIBS += -framework QuickTime
58ed3afaf3ab (svn r3088) -Fix: [OSX] fixed issue where OSX could not dynamic link to quicktime [ 1334917 ]
bjarni
parents: 2505
diff changeset
   533
	endif
58ed3afaf3ab (svn r3088) -Fix: [OSX] fixed issue where OSX could not dynamic link to quicktime [ 1334917 ]
bjarni
parents: 2505
diff changeset
   534
58ed3afaf3ab (svn r3088) -Fix: [OSX] fixed issue where OSX could not dynamic link to quicktime [ 1334917 ]
bjarni
parents: 2505
diff changeset
   535
	# OSX path setup
58ed3afaf3ab (svn r3088) -Fix: [OSX] fixed issue where OSX could not dynamic link to quicktime [ 1334917 ]
bjarni
parents: 2505
diff changeset
   536
	ifndef SECOND_DATA_PATH
58ed3afaf3ab (svn r3088) -Fix: [OSX] fixed issue where OSX could not dynamic link to quicktime [ 1334917 ]
bjarni
parents: 2505
diff changeset
   537
		SECOND_DATA_PATH:="$(OSXAPP)/Contents/Data/"
58ed3afaf3ab (svn r3088) -Fix: [OSX] fixed issue where OSX could not dynamic link to quicktime [ 1334917 ]
bjarni
parents: 2505
diff changeset
   538
	endif
58ed3afaf3ab (svn r3088) -Fix: [OSX] fixed issue where OSX could not dynamic link to quicktime [ 1334917 ]
bjarni
parents: 2505
diff changeset
   539
58ed3afaf3ab (svn r3088) -Fix: [OSX] fixed issue where OSX could not dynamic link to quicktime [ 1334917 ]
bjarni
parents: 2505
diff changeset
   540
	ifndef CUSTOM_LANG_DIR
58ed3afaf3ab (svn r3088) -Fix: [OSX] fixed issue where OSX could not dynamic link to quicktime [ 1334917 ]
bjarni
parents: 2505
diff changeset
   541
		ifndef DEDICATED
58ed3afaf3ab (svn r3088) -Fix: [OSX] fixed issue where OSX could not dynamic link to quicktime [ 1334917 ]
bjarni
parents: 2505
diff changeset
   542
		CUSTOM_LANG_DIR:="$(OSXAPP)/Contents/Lang/"
58ed3afaf3ab (svn r3088) -Fix: [OSX] fixed issue where OSX could not dynamic link to quicktime [ 1334917 ]
bjarni
parents: 2505
diff changeset
   543
		endif
58ed3afaf3ab (svn r3088) -Fix: [OSX] fixed issue where OSX could not dynamic link to quicktime [ 1334917 ]
bjarni
parents: 2505
diff changeset
   544
	endif
2500
e2b13f720a94 (svn r3026) -Fix: [OSX] fixed bug that prevented dedicated servers from compiling (introduced in r3022)
bjarni
parents: 2497
diff changeset
   545
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   546
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   547
ifdef MIDI
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   548
CDEFS += -DEXTERNAL_PLAYER=\"$(MIDI)\"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   549
ifdef MIDI_ARG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   550
CDEFS += -DMIDI_ARG=\"$(MIDI_ARG)\"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   551
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   552
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   553
2672
ea469d7b34ff (svn r3214) -Feature: openttd.cfg can now set how many autosaves to keep before starting to overwrite old ones
bjarni
parents: 2625
diff changeset
   554
ifdef MAX_NUM_AUTOSAVES
ea469d7b34ff (svn r3214) -Feature: openttd.cfg can now set how many autosaves to keep before starting to overwrite old ones
bjarni
parents: 2625
diff changeset
   555
CDEFS += -DMAX_NUM_AUTOSAVES=$(MAX_NUM_AUTOSAVES)
ea469d7b34ff (svn r3214) -Feature: openttd.cfg can now set how many autosaves to keep before starting to overwrite old ones
bjarni
parents: 2625
diff changeset
   556
endif
ea469d7b34ff (svn r3214) -Feature: openttd.cfg can now set how many autosaves to keep before starting to overwrite old ones
bjarni
parents: 2625
diff changeset
   557
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   558
ifdef WITH_NETWORK
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   559
CDEFS += -DENABLE_NETWORK
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   560
ifdef QNX
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   561
LIBS += -lsocket
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   562
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   563
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   564
561
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   565
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   566
ifdef SECOND_DATA_PATH
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   567
CDEFS += -DSECOND_DATA_DIR=\"$(SECOND_DATA_PATH)/\"
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   568
endif
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   569
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   570
ifdef CUSTOM_LANG_DIR
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   571
CDEFS += -DCUSTOM_LANG_DIR=\"$(CUSTOM_LANG_DIR)/\"
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   572
endif
e3b9689745ab (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   573
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   574
ifdef WITH_DIRECTMUSIC
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   575
CDEFS += -DWIN32_ENABLE_DIRECTMUSIC_SUPPORT
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   576
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   577
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   578
ifdef WIN32
1692
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   579
LIBS += -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   580
ifdef WITH_DIRECTMUSIC
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   581
LIBS += -lstdc++
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   582
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   583
TTDLDFLAGS += -Wl,--subsystem,windows
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   584
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   585
1476
abbcea18a01c (svn r1980) Check $DESTDIR if $DEST_DIR was not set.
pasky
parents: 1435
diff changeset
   586
ifndef DEST_DIR
abbcea18a01c (svn r1980) Check $DESTDIR if $DEST_DIR was not set.
pasky
parents: 1435
diff changeset
   587
DEST_DIR = $(DESTDIR)
abbcea18a01c (svn r1980) Check $DESTDIR if $DEST_DIR was not set.
pasky
parents: 1435
diff changeset
   588
endif
abbcea18a01c (svn r1980) Check $DESTDIR if $DEST_DIR was not set.
pasky
parents: 1435
diff changeset
   589
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   590
# sets up the paths for use for make install
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   591
ifdef INSTALL
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   592
# We use _PREFIXED vars here, so the paths are recalculated every time, and
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   593
# the prefix is not prepended in the makefile config
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   594
BINARY_DIR_PREFIXED:=$(PREFIX)/$(BINARY_DIR)
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   595
DATA_DIR_PREFIXED:=$(PREFIX)/$(DATA_DIR)
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   596
# We use _INSTALL vars here, these vars are the locations where the files will
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   597
# be installed
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   598
DATA_DIR_INSTALL=$(DEST_DIR)/$(DATA_DIR_PREFIXED)
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   599
BINARY_DIR_INSTALL=$(DEST_DIR)/$(BINARY_DIR_PREFIXED)
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   600
# Let the code know where to find stuff
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   601
ifdef DATA_DIR_PREFIXED
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   602
CDEFS += -DGAME_DATA_DIR=\"$(DATA_DIR_PREFIXED)/\"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   603
endif
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   604
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   605
ifdef PERSONAL_DIR
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   606
CDEFS += -DPERSONAL_DIR=\"$(PERSONAL_DIR)/\"
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   607
endif
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   608
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   609
ifdef USE_HOMEDIR
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   610
CDEFS += -DUSE_HOMEDIR
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   611
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   612
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   613
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   614
##############################################################################
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   615
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   616
# What to compile
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   617
# (users do not want to modify anything below)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   618
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   619
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   620
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   621
### Sources
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   622
2713
9f06e1f94ce9 (svn r3258) -Feature: [OSX] added support for universal binaries
bjarni
parents: 2712
diff changeset
   623
# clean up C_SOURCES first. Needed since building universal binaries on OSX calls the makefile recursively (just one time)
9f06e1f94ce9 (svn r3258) -Feature: [OSX] added support for universal binaries
bjarni
parents: 2712
diff changeset
   624
C_SOURCES:=
9f06e1f94ce9 (svn r3258) -Feature: [OSX] added support for universal binaries
bjarni
parents: 2712
diff changeset
   625
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   626
C_SOURCES += aircraft_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   627
C_SOURCES += aircraft_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   628
C_SOURCES += airport.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   629
C_SOURCES += airport_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   630
C_SOURCES += aystar.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   631
C_SOURCES += bridge_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   632
C_SOURCES += callback_table.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   633
C_SOURCES += clear_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   634
C_SOURCES += command.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   635
C_SOURCES += console.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   636
C_SOURCES += console_cmds.c
2291
2b064aa97f91 (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents: 2285
diff changeset
   637
C_SOURCES += currency.c
1299
0a6510cc889b (svn r1803) Move debugging stuff into files of it's own
tron
parents: 1292
diff changeset
   638
C_SOURCES += debug.c
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   639
C_SOURCES += dedicated.c
1313
bba6afb8a995 (svn r1817) -Codechange: Moved depot-functions to depot.c
truelight
parents: 1299
diff changeset
   640
C_SOURCES += depot.c
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   641
C_SOURCES += disaster_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   642
C_SOURCES += dock_gui.c
2171
008122046f7f (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents: 2106
diff changeset
   643
C_SOURCES += driver.c
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   644
C_SOURCES += dummy_land.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   645
C_SOURCES += economy.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   646
C_SOURCES += engine.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   647
C_SOURCES += engine_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   648
C_SOURCES += fileio.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   649
C_SOURCES += gfx.c
2340
0a9f3eeccb96 (svn r2866) Move all functions and tables which aren't directly involved in managing the sprite heap to a new file gfxinit.c.
tron
parents: 2327
diff changeset
   650
C_SOURCES += gfxinit.c
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   651
C_SOURCES += graph_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   652
C_SOURCES += newgrf.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   653
C_SOURCES += industry_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   654
C_SOURCES += industry_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   655
C_SOURCES += intro_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   656
C_SOURCES += landscape.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   657
C_SOURCES += main_gui.c
679
e959706a3e4d (svn r1117) Move map arrays and some related macros into their own files map.c and map.h
tron
parents: 677
diff changeset
   658
C_SOURCES += map.c
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   659
C_SOURCES += md5.c
2075
7f0ca01392db (svn r2585) - Fix [Makefile]: some small cleanups, remove warnings, and add mersenne to makefile (Luca)
Darkvater
parents: 2033
diff changeset
   660
C_SOURCES += mersenne.c
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   661
C_SOURCES += minilzo.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   662
C_SOURCES += misc.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   663
C_SOURCES += misc_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   664
C_SOURCES += misc_gui.c
1496
3d0b86f5dcb8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents: 1492
diff changeset
   665
C_SOURCES += mixer.c
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   666
C_SOURCES += music_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   667
C_SOURCES += namegen.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   668
C_SOURCES += network.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   669
C_SOURCES += network_client.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   670
C_SOURCES += network_data.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   671
C_SOURCES += network_gamelist.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   672
C_SOURCES += network_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   673
C_SOURCES += network_server.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   674
C_SOURCES += network_udp.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   675
C_SOURCES += news_gui.c
1247
01711347f9ac (svn r1751) - Feature: New PathFinder (NPF).
matthijs
parents: 1241
diff changeset
   676
C_SOURCES += npf.c
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   677
C_SOURCES += oldloader.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   678
C_SOURCES += order_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   679
C_SOURCES += order_gui.c
1985
c4ec1653a337 (svn r2491) -Fix: Solved a performance problem introduced in r2467. While busy
celestar
parents: 1955
diff changeset
   680
C_SOURCES += openttd.c
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   681
C_SOURCES += pathfind.c
2008
c9d6585c96c8 (svn r2516) - Feature: [pbs] Implement path-based-signalling. This allows multiple trains within the same signal block, provided their paths dont intersect. For this the block must have all exit and entry signals be pbs signals. Place these by ctrl-clicking 4 times on a normal signal.
hackykid
parents: 1985
diff changeset
   682
C_SOURCES += pbs.c
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   683
C_SOURCES += player_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   684
C_SOURCES += players.c
1259
6dc9a1521c00 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents: 1257
diff changeset
   685
C_SOURCES += pool.c
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   686
C_SOURCES += queue.c
1942
634961366cdc (svn r2448) General cleanup of rail related code, more to follow.
matthijs
parents: 1891
diff changeset
   687
C_SOURCES += rail.c
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   688
C_SOURCES += rail_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   689
C_SOURCES += rail_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   690
C_SOURCES += rev.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   691
C_SOURCES += road_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   692
C_SOURCES += road_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   693
C_SOURCES += roadveh_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   694
C_SOURCES += roadveh_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   695
C_SOURCES += saveload.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   696
C_SOURCES += screenshot.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   697
C_SOURCES += settings.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   698
C_SOURCES += settings_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   699
C_SOURCES += ship_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   700
C_SOURCES += ship_gui.c
988
2482369a61ff (svn r1486) -Codechange: moved all 'signs' stuff to signs.c/h and prepared it for
truelight
parents: 978
diff changeset
   701
C_SOURCES += signs.c
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   702
C_SOURCES += smallmap_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   703
C_SOURCES += sound.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   704
C_SOURCES += sprite.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   705
C_SOURCES += spritecache.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   706
C_SOURCES += station_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   707
C_SOURCES += station_gui.c
2625
66b3d632dcd2 (svn r3167) - NewGRF: Start moving custom station code to separate files.
peter1138
parents: 2576
diff changeset
   708
C_SOURCES += station_newgrf.c
1317
f382f1b439c7 (svn r1821) Move generic string handling functions to string.[ch] and introduce stre{cpy,cat}, see string.h for their semantics
tron
parents: 1313
diff changeset
   709
C_SOURCES += string.c
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   710
C_SOURCES += strings.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   711
C_SOURCES += subsidy_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   712
C_SOURCES += terraform_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   713
C_SOURCES += texteff.c
2285
3193cbd1ba88 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents: 2240
diff changeset
   714
C_SOURCES += thread.c
1211
6f2f723e5c36 (svn r1715) Move [GS]etMapExtraBits to tile.[ch]
tron
parents: 1170
diff changeset
   715
C_SOURCES += tile.c
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   716
C_SOURCES += town_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   717
C_SOURCES += town_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   718
C_SOURCES += train_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   719
C_SOURCES += train_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   720
C_SOURCES += tree_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   721
C_SOURCES += tunnelbridge_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   722
C_SOURCES += unmovable_cmd.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   723
C_SOURCES += vehicle.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   724
C_SOURCES += vehicle_gui.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   725
C_SOURCES += viewport.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   726
C_SOURCES += water_cmd.c
1542
2ca6d1624e6d (svn r2046) -Codechange: moved all waypoint code to waypoint.c/waypoint.h
truelight
parents: 1496
diff changeset
   727
C_SOURCES += waypoint.c
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   728
C_SOURCES += widget.c
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   729
C_SOURCES += window.c
2174
41d7c884dc52 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents: 2171
diff changeset
   730
C_SOURCES += music/null_m.c
41d7c884dc52 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents: 2171
diff changeset
   731
C_SOURCES += sound/null_s.c
2177
73d67828ea5e (svn r2691) Separate dedicated video driver and fix bemidi declarations
tron
parents: 2174
diff changeset
   732
C_SOURCES += video/dedicated_v.c
2174
41d7c884dc52 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents: 2171
diff changeset
   733
C_SOURCES += video/null_v.c
677
90346642763a (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   734
2395
19b4da30806b (svn r2921) -Codechange: moved all AI-code to 1 central place (ai/ai.c)
truelight
parents: 2381
diff changeset
   735
# AI related files
19b4da30806b (svn r2921) -Codechange: moved all AI-code to 1 central place (ai/ai.c)
truelight
parents: 2381
diff changeset
   736
C_SOURCES += ai/ai.c
2381
de9053fe2a2c (svn r2907) -Codechange: splitted the AIs to their own directory. AINew becomes 'trolly', AIOld becomes 'default', both in their own dir in the 'ai' dir. More AIs to come.
truelight
parents: 2378
diff changeset
   737
C_SOURCES += ai/default/default.c
de9053fe2a2c (svn r2907) -Codechange: splitted the AIs to their own directory. AINew becomes 'trolly', AIOld becomes 'default', both in their own dir in the 'ai' dir. More AIs to come.
truelight
parents: 2378
diff changeset
   738
C_SOURCES += ai/trolly/trolly.c
de9053fe2a2c (svn r2907) -Codechange: splitted the AIs to their own directory. AINew becomes 'trolly', AIOld becomes 'default', both in their own dir in the 'ai' dir. More AIs to come.
truelight
parents: 2378
diff changeset
   739
C_SOURCES += ai/trolly/build.c
de9053fe2a2c (svn r2907) -Codechange: splitted the AIs to their own directory. AINew becomes 'trolly', AIOld becomes 'default', both in their own dir in the 'ai' dir. More AIs to come.
truelight
parents: 2378
diff changeset
   740
C_SOURCES += ai/trolly/pathfinder.c
de9053fe2a2c (svn r2907) -Codechange: splitted the AIs to their own directory. AINew becomes 'trolly', AIOld becomes 'default', both in their own dir in the 'ai' dir. More AIs to come.
truelight
parents: 2378
diff changeset
   741
C_SOURCES += ai/trolly/shared.c
de9053fe2a2c (svn r2907) -Codechange: splitted the AIs to their own directory. AINew becomes 'trolly', AIOld becomes 'default', both in their own dir in the 'ai' dir. More AIs to come.
truelight
parents: 2378
diff changeset
   742
421
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   743
CXX_SOURCES =
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   744
2188
9acde6fcc645 (svn r2703) - Feature: [OSX] Added a native alert window to show whatever error() needs to print (Tobin made this, while I fixed some issued in it)
bjarni
parents: 2185
diff changeset
   745
OBJC_SOURCES =
9acde6fcc645 (svn r2703) - Feature: [OSX] Added a native alert window to show whatever error() needs to print (Tobin made this, while I fixed some issued in it)
bjarni
parents: 2185
diff changeset
   746
1829
0b6de3b4458a (svn r2334) - Fix (regression): moved togglefullscreen into the video-driver, now windows works, dedicated works and sdl works. Also reverted the change to the makefile.
Darkvater
parents: 1825
diff changeset
   747
ifdef WITH_SDL
0b6de3b4458a (svn r2334) - Fix (regression): moved togglefullscreen into the video-driver, now windows works, dedicated works and sdl works. Also reverted the change to the makefile.
Darkvater
parents: 1825
diff changeset
   748
C_SOURCES += sdl.c
2174
41d7c884dc52 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents: 2171
diff changeset
   749
C_SOURCES += sound/sdl_s.c
41d7c884dc52 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents: 2171
diff changeset
   750
C_SOURCES += video/sdl_v.c
1829
0b6de3b4458a (svn r2334) - Fix (regression): moved togglefullscreen into the video-driver, now windows works, dedicated works and sdl works. Also reverted the change to the makefile.
Darkvater
parents: 1825
diff changeset
   751
endif
0b6de3b4458a (svn r2334) - Fix (regression): moved togglefullscreen into the video-driver, now windows works, dedicated works and sdl works. Also reverted the change to the makefile.
Darkvater
parents: 1825
diff changeset
   752
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   753
ifdef WIN32
2171
008122046f7f (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents: 2106
diff changeset
   754
C_SOURCES += win32.c
2174
41d7c884dc52 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents: 2171
diff changeset
   755
C_SOURCES += music/win32_m.c
41d7c884dc52 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents: 2171
diff changeset
   756
C_SOURCES += sound/win32_s.c
41d7c884dc52 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents: 2171
diff changeset
   757
C_SOURCES += video/win32_v.c
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   758
else
2171
008122046f7f (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents: 2106
diff changeset
   759
C_SOURCES += unix.c
008122046f7f (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents: 2106
diff changeset
   760
C_SOURCES += music/extmidi.c
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   761
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   762
2188
9acde6fcc645 (svn r2703) - Feature: [OSX] Added a native alert window to show whatever error() needs to print (Tobin made this, while I fixed some issued in it)
bjarni
parents: 2185
diff changeset
   763
ifdef OSX
9acde6fcc645 (svn r2703) - Feature: [OSX] Added a native alert window to show whatever error() needs to print (Tobin made this, while I fixed some issued in it)
bjarni
parents: 2185
diff changeset
   764
OBJC_SOURCES += os/macosx/macos.m
2500
e2b13f720a94 (svn r3026) -Fix: [OSX] fixed bug that prevented dedicated servers from compiling (introduced in r3022)
bjarni
parents: 2497
diff changeset
   765
ifndef DEDICATED
2496
ad131afbc8cb (svn r3022) -feature: [OSX] OSX now uses quicktime to play midi files
bjarni
parents: 2395
diff changeset
   766
C_SOURCES    += music/qtmidi.c
2188
9acde6fcc645 (svn r2703) - Feature: [OSX] Added a native alert window to show whatever error() needs to print (Tobin made this, while I fixed some issued in it)
bjarni
parents: 2185
diff changeset
   767
endif
2500
e2b13f720a94 (svn r3026) -Fix: [OSX] fixed bug that prevented dedicated servers from compiling (introduced in r3022)
bjarni
parents: 2497
diff changeset
   768
endif
2188
9acde6fcc645 (svn r2703) - Feature: [OSX] Added a native alert window to show whatever error() needs to print (Tobin made this, while I fixed some issued in it)
bjarni
parents: 2185
diff changeset
   769
9acde6fcc645 (svn r2703) - Feature: [OSX] Added a native alert window to show whatever error() needs to print (Tobin made this, while I fixed some issued in it)
bjarni
parents: 2185
diff changeset
   770
OBJS = $(C_SOURCES:%.c=%.o) $(CXX_SOURCES:%.cpp=%.o) $(OBJC_SOURCES:%.m=%.o)
421
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   771
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   772
ifdef BEOS
2171
008122046f7f (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents: 2106
diff changeset
   773
CXX_SOURCES += music/bemidi.cpp
421
0b9bdcdfe0c5 (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   774
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   775
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   776
ifdef WIN32
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   777
# Resource file
1167
d8b7601118cf (svn r1669) Rename all ttd_XXX to just XXX, because we already know who we are (;
tron
parents: 1164
diff changeset
   778
OBJS += winres.o
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   779
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   780
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   781
ifdef WITH_DIRECTMUSIC
2197
0ffe98032b29 (svn r2712) Overhaul DirectMusic MIDI backend:
tron
parents: 2189
diff changeset
   782
CXX_SOURCES += music/dmusic.cpp
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   783
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   784
1170
1cd3103acd66 (svn r1672) Simplify dependency tracking and actually implement it for C++ files, too.
tron
parents: 1169
diff changeset
   785
DEPS = $(OBJS:%.o=.deps/%.d)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   786
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   787
LANG_TXT = $(filter-out %.unfinished.txt,$(wildcard lang/*.txt))
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   788
LANGS = $(LANG_TXT:%.txt=%.lng)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   789
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
   790
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   791
##############################################################################
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   792
#
1413
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   793
# Build commands
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   794
#
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   795
2369
ede4483a0214 (svn r2895) Remove unused variables and bring a comment closer to reality
tron
parents: 2356
diff changeset
   796
# If we are verbose, we will show commands prefixed by $(Q).
ede4483a0214 (svn r2895) Remove unused variables and bring a comment closer to reality
tron
parents: 2356
diff changeset
   797
# The $(Q)s get replaced by @ in non-verbose mode.
1413
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   798
# Inspired by the Linux kernel build system.
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   799
ifdef VERBOSE
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   800
	Q =
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   801
else
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   802
	Q = @
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   803
endif
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   804
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   805
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   806
##############################################################################
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   807
#
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   808
# Targets
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   809
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   810
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   811
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   812
### Normal build rules
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   813
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   814
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   815
ifdef OSX
2713
9f06e1f94ce9 (svn r3258) -Feature: [OSX] added support for universal binaries
bjarni
parents: 2712
diff changeset
   816
# needs to be before all
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   817
OSX:=OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   818
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   819
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   820
2576
8f68e7d7d941 (svn r3113) -Fix: The Makefile had 64bit code which was obsolete, not to say wrong.
truelight
parents: 2555
diff changeset
   821
all: endian_target.h endian_host.h $(UPDATECONFIG) $(LANGS) $(TTD) $(OSX)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   822
2714
2b34ba290a5c (svn r3259) -Fix: [OSX] fixed that universal binaries did not make a bundle
bjarni
parents: 2713
diff changeset
   823
ifdef OSX
2b34ba290a5c (svn r3259) -Fix: [OSX] fixed that universal binaries did not make a bundle
bjarni
parents: 2713
diff changeset
   824
-include os/macosx/Makefile
2b34ba290a5c (svn r3259) -Fix: [OSX] fixed that universal binaries did not make a bundle
bjarni
parents: 2713
diff changeset
   825
endif
2b34ba290a5c (svn r3259) -Fix: [OSX] fixed that universal binaries did not make a bundle
bjarni
parents: 2713
diff changeset
   826
1721
64d59b181596 (svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents: 1720
diff changeset
   827
endian_host.h: $(ENDIAN_CHECK)
64d59b181596 (svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents: 1720
diff changeset
   828
	@echo '===> Testing endianness for host'
64d59b181596 (svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents: 1720
diff changeset
   829
	$(Q)./$(ENDIAN_CHECK) > $@
64d59b181596 (svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents: 1720
diff changeset
   830
64d59b181596 (svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents: 1720
diff changeset
   831
endian_target.h: $(ENDIAN_CHECK)
64d59b181596 (svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents: 1720
diff changeset
   832
	@echo '===> Testing endianness for target'
1692
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   833
	$(Q)./$(ENDIAN_CHECK) $(ENDIAN_FORCE) > $@
157
dd017fa3bad8 (svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents: 126
diff changeset
   834
dd017fa3bad8 (svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents: 126
diff changeset
   835
$(ENDIAN_CHECK): endian_check.c
2315
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
   836
	@echo '===> Compiling and Linking $@'
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
   837
	$(Q)$(CC_HOST) $(CFLAGS_HOST) $(CDEFS) $< -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
   838
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   839
2315
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
   840
$(TTD): $(OBJS) $(MAKE_CONFIG)
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
   841
	@echo '===> Linking $@'
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
   842
	$(Q)$(CC) $(LDFLAGS) $(TTDLDFLAGS) $(OBJS) $(LIBS) -o $@
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   843
1721
64d59b181596 (svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents: 1720
diff changeset
   844
$(STRGEN): strgen/strgen.c endian_host.h
2315
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
   845
	@echo '===> Compiling and Linking $@'
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
   846
	$(Q)$(CC_HOST) $(CFLAGS_HOST) $(CDEFS) $< -o $@
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   847
474
75f8c36e36ba (svn r725) Fix language file dependencies
tron
parents: 462
diff changeset
   848
table/strings.h: lang/english.txt $(STRGEN)
1118
a3c31d3fe6e1 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   849
	@echo '===> Generating $@'
1413
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   850
	$(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
   851
476
ad012336ed61 (svn r727) The langauge files depend on english.txt, not strings.h
tron
parents: 475
diff changeset
   852
lang/%.lng: lang/%.txt $(STRGEN) lang/english.txt
1118
a3c31d3fe6e1 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   853
	@echo '===> Compiling language $(*F)'
2106
e0cbbec2e6e9 (svn r2616) Don't stop when compiling a language fails, just delete the defective .lng
tron
parents: 2096
diff changeset
   854
	$(Q)$(STRGEN) $(STRGEN_FLAGS) $< $(LANG_ERRORS) || rm -f $@
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   855
1891
92a3b0aa0946 (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.
Darkvater
parents: 1865
diff changeset
   856
winres.o: openttd.rc
1118
a3c31d3fe6e1 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   857
	@echo '===> Compiling resource $<'
1692
2587eee1c632 (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   858
	$(Q)$(WINDRES) -o $@ $<
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   859
770
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   860
ifdef MORPHOS
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   861
release: all
1413
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   862
	$(Q)rm -fr "/t/openttd-$(RELEASE)-morphos.lha"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   863
	$(Q)mkdir -p "/t/"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   864
	$(Q)mkdir -p "/t/openttd-$(RELEASE)-morphos"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   865
	$(Q)mkdir -p "/t/openttd-$(RELEASE)-morphos/docs"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   866
	$(Q)mkdir -p "/t/openttd-$(RELEASE)-morphos/data"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   867
	$(Q)mkdir -p "/t/openttd-$(RELEASE)-morphos/lang"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   868
	$(Q)mkdir -p "/t/openttd-$(RELEASE)-morphos/scenario"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   869
	$(Q)cp -R $(TTD)                      "/t/openttd-$(RELEASE)-morphos/"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   870
	$(Q)cp data/*                         "/t/openttd-$(RELEASE)-morphos/data/"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   871
	$(Q)cp lang/*.lng                     "/t/openttd-$(RELEASE)-morphos/lang/"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   872
	$(Q)cp scenario/*                     "/t/openttd-$(RELEASE)-morphos/scenario/"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   873
	$(Q)cp readme.txt                     "/t/openttd-$(RELEASE)-morphos/docs/ReadMe"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   874
	$(Q)cp docs/console.txt               "/t/openttd-$(RELEASE)-morphos/docs/Console"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   875
	$(Q)cp COPYING                        "/t/openttd-$(RELEASE)-morphos/docs/"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   876
	$(Q)cp changelog.txt                  "/t/openttd-$(RELEASE)-morphos/docs/ChangeLog"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   877
	$(Q)cp known-bugs.txt				   "/t/openttd-$(RELEASE)-morphos/docs/known-bugs.txt"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   878
	$(Q)cp os/morphos/icons/openttd.info  "/t/openttd-$(RELEASE)-morphos/$(TTD).info"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   879
	$(Q)cp os/morphos/icons/docs.info     "/t/openttd-$(RELEASE)-morphos/docs.info"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   880
	$(Q)cp os/morphos/icons/drawer.info   "/t/openttd-$(RELEASE)-morphos.info"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   881
	$(Q)cp os/morphos/icons/document.info "/t/openttd-$(RELEASE)-morphos/docs/ReadMe.info"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   882
	$(Q)cp os/morphos/icons/document.info "/t/openttd-$(RELEASE)-morphos/docs/Console.info"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   883
	$(Q)cp os/morphos/icons/document.info "/t/openttd-$(RELEASE)-morphos/docs/COPYING.info"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   884
	$(Q)cp os/morphos/icons/document.info "/t/openttd-$(RELEASE)-morphos/docs/ChangeLog.info"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   885
	$(Q)strip --strip-all --strip-unneeded --remove-section .comment "/t/openttd-$(RELEASE)-morphos/$(TTD)"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   886
	$(Q)lha a -r "t:openttd-$(RELEASE)-morphos.lha" "t:openttd-$(RELEASE)-morphos"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   887
	$(Q)lha a    "t:openttd-$(RELEASE)-morphos.lha" "t:openttd-$(RELEASE)-morphos.info"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   888
	$(Q)rm -fr "/t/openttd-$(RELEASE)-morphos"
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   889
	$(Q)rm -fr "/t/openttd-$(RELEASE)-morphos.info"
770
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   890
	@echo "Release archive can be found in RAM:t/ now."
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   891
1251
792ada467c21 (svn r1755) Trim trailing whitespace
tron
parents: 1247
diff changeset
   892
.PHONY: release
770
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   893
endif
89dab23f04ca (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   894
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   895
rev.c: FORCE
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   896
	@# setting the revision number in a place, there the binary can read it
615
3a22cf31bb29 (svn r1039) Makefile: now RELEASE flag can contain () too
bjarni
parents: 610
diff changeset
   897
	@echo 'const char _openttd_revision[] = "$(REV)";' >>rev.c.new
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   898
	@# some additions for MorphOS versions tag
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   899
	@echo '#ifdef __MORPHOS__'  >>rev.c.new
2378
20c6e78b2b9d (svn r2904) Stupid editors, and renaming files with the same name just different casing is not really possible, so here comes another commit
Darkvater
parents: 2377
diff changeset
   900
	@echo 'const char morphos_versions_tag[] = "\\0$$VER: OpenTTD $(REV) ('${BUILDDATE}') © OpenTTD Team [MorphOS, PowerPC]";'  >>rev.c.new
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   901
	@echo '#endif' >>rev.c.new
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   902
	@# Only update the real rev.c if it actually changed, to prevent
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   903
	@# useless rebuilds.
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   904
	@cmp -s rev.c rev.c.new 2>/dev/null || mv rev.c.new rev.c
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   905
	@rm -f rev.c.new
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   906
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   907
FORCE:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   908
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   909
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   910
clean:
1118
a3c31d3fe6e1 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   911
	@echo '===> Cleaning up'
1721
64d59b181596 (svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents: 1720
diff changeset
   912
# endian.h is out-dated and no longer in use, so it can be removed soon
64d59b181596 (svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents: 1720
diff changeset
   913
	$(Q)rm -rf .deps *~ $(TTD) $(STRGEN) core table/strings.h $(LANGS) $(OBJS) $(OSX_MIDI_PLAYER_FILE) endian.h endian_host.h endian_target.h $(ENDIAN_CHECK)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   914
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   915
mrproper: clean
1413
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   916
	$(Q)rm -rf $(MAKE_CONFIG)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   917
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   918
ifndef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   919
ifndef MORPHOS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   920
install:
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   921
ifeq ($(INSTALL),)
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   922
	$(error make install is highly experimental at his state and not\
1492
e03a8c6f7efd (svn r1996) makefile.config -> Makefile.config, that's its name.
pasky
parents: 1491
diff changeset
   923
	tested very much - use at your own risk - to use run \"make install INSTALL:=1\" - make sure Makefile.config\
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   924
	is set correctly up - run \"make upgradeconf\")
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   925
endif
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   926
543
e3b43338096b (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   927
ifeq ($(PREFIX), )
1492
e03a8c6f7efd (svn r1996) makefile.config -> Makefile.config, that's its name.
pasky
parents: 1491
diff changeset
   928
	$(error no prefix set - check Makefile.config)
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   929
endif
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   930
#	We compare against the non prefixed version here, so we won't install
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   931
#	if only the prefix has been set
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   932
ifeq ($(DATA_DIR),)
1492
e03a8c6f7efd (svn r1996) makefile.config -> Makefile.config, that's its name.
pasky
parents: 1491
diff changeset
   933
	$(error no data path set - check Makefile.config)
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   934
endif
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   935
ifeq ($(BINARY_DIR),)
1492
e03a8c6f7efd (svn r1996) makefile.config -> Makefile.config, that's its name.
pasky
parents: 1491
diff changeset
   936
	$(error no binary path set - check Makefile.config)
285
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   937
endif
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   938
# We'll install in $DEST_DIR instead of root if it is set (we don't
e306da1c4ad1 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   939
# care about extra /'s
1491
d010857e470a (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
   940
	install -d $(DATA_DIR_INSTALL)/lang \
d010857e470a (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
   941
	           $(DATA_DIR_INSTALL)/data \
d010857e470a (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
   942
	           $(DATA_DIR_INSTALL)/gm \
d010857e470a (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
   943
	           $(BINARY_DIR_INSTALL)
1865
8f237a5b1a5f (svn r2371) - Fix: [ 1144510 ] make install tries to install scenarios in the (non-existing) personal dir when USE_HOMEDIR is specified.
matthijs
parents: 1829
diff changeset
   944
ifndef USE_HOMEDIR
8f237a5b1a5f (svn r2371) - Fix: [ 1144510 ] make install tries to install scenarios in the (non-existing) personal dir when USE_HOMEDIR is specified.
matthijs
parents: 1829
diff changeset
   945
	mkdir -p $(PERSONAL_DIR)/scenario
8f237a5b1a5f (svn r2371) - Fix: [ 1144510 ] make install tries to install scenarios in the (non-existing) personal dir when USE_HOMEDIR is specified.
matthijs
parents: 1829
diff changeset
   946
else
8f237a5b1a5f (svn r2371) - Fix: [ 1144510 ] make install tries to install scenarios in the (non-existing) personal dir when USE_HOMEDIR is specified.
matthijs
parents: 1829
diff changeset
   947
	mkdir -p $(DATA_DIR_INSTALL)/scenario
8f237a5b1a5f (svn r2371) - Fix: [ 1144510 ] make install tries to install scenarios in the (non-existing) personal dir when USE_HOMEDIR is specified.
matthijs
parents: 1829
diff changeset
   948
endif
1491
d010857e470a (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
   949
	install $(TTD) $(BINARY_DIR_INSTALL)
d010857e470a (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
   950
	install -m 644 lang/*.lng $(DATA_DIR_INSTALL)/lang
d010857e470a (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
   951
	install -m 644 data/*.grf $(DATA_DIR_INSTALL)/data
d010857e470a (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
   952
	install -m 644 data/opntitle.dat $(DATA_DIR_INSTALL)/data
d010857e470a (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
   953
	install -m 644 media/openttd.64.png $(DATA_DIR_INSTALL)
1865
8f237a5b1a5f (svn r2371) - Fix: [ 1144510 ] make install tries to install scenarios in the (non-existing) personal dir when USE_HOMEDIR is specified.
matthijs
parents: 1829
diff changeset
   954
	install -m 644 media/openttd.32.xpm $(DATA_DIR_INSTALL)
8f237a5b1a5f (svn r2371) - Fix: [ 1144510 ] make install tries to install scenarios in the (non-existing) personal dir when USE_HOMEDIR is specified.
matthijs
parents: 1829
diff changeset
   955
ifndef USE_HOMEDIR
1160
467d3ff0ad97 (svn r1661) Makefile: added scenario to make install
bjarni
parents: 1158
diff changeset
   956
	cp scenario/* $(PERSONAL_DIR)/scenario/
1865
8f237a5b1a5f (svn r2371) - Fix: [ 1144510 ] make install tries to install scenarios in the (non-existing) personal dir when USE_HOMEDIR is specified.
matthijs
parents: 1829
diff changeset
   957
else
8f237a5b1a5f (svn r2371) - Fix: [ 1144510 ] make install tries to install scenarios in the (non-existing) personal dir when USE_HOMEDIR is specified.
matthijs
parents: 1829
diff changeset
   958
	cp scenario/* $(DATA_DIR_INSTALL)/scenario/
8f237a5b1a5f (svn r2371) - Fix: [ 1144510 ] make install tries to install scenarios in the (non-existing) personal dir when USE_HOMEDIR is specified.
matthijs
parents: 1829
diff changeset
   959
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   960
else	#MorphOS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   961
install:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   962
	$(error make install is not supported on MorphOS)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   963
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   964
else	# OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   965
install:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   966
	$(error make install is not supported on MacOSX)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   967
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   968
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   969
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   970
love:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   971
	@echo "YES! I thought you would never ask. We will have a great time. You can keep me turned on all night"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   972
2576
8f68e7d7d941 (svn r3113) -Fix: The Makefile had 64bit code which was obsolete, not to say wrong.
truelight
parents: 2555
diff changeset
   973
.PHONY: clean all $(OSX) install love
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   974
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   975
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   976
### Automatic configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   977
-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
   978
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   979
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   980
# Export all variables set to subprocesses (a bit dirty)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   981
.EXPORT_ALL_VARIABLES:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   982
upgradeconf: $(MAKE_CONFIG)
1413
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   983
	$(Q)rm $(MAKE_CONFIG)
4a93d8682e11 (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   984
	$(Q)$(MAKE) $(MAKE_CONFIG)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   985
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   986
.PHONY: upgradeconf
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   987
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   988
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   989
### Internal build rules
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   990
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   991
# This makes sure the .deps dir is always around.
2381
de9053fe2a2c (svn r2907) -Codechange: splitted the AIs to their own directory. AINew becomes 'trolly', AIOld becomes 'default', both in their own dir in the 'ai' dir. More AIs to come.
truelight
parents: 2378
diff changeset
   992
DEPS_MAGIC := $(shell mkdir -p .deps .deps/music .deps/sound .deps/video .deps/os .deps/os/macosx .deps/ai/default .deps/ai/trolly)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   993
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   994
# Introduce the dependencies
2315
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
   995
ifneq ($(MAKECMDGOALS), clean)
1167
d8b7601118cf (svn r1669) Rename all ttd_XXX to just XXX, because we already know who we are (;
tron
parents: 1164
diff changeset
   996
-include $(DEPS)
2315
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
   997
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   998
2315
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
   999
%.o: .deps/%.d
1170
1cd3103acd66 (svn r1672) Simplify dependency tracking and actually implement it for C++ files, too.
tron
parents: 1169
diff changeset
  1000
2327
076c79dea490 (svn r2853) Add missing dependencies and flags to the dependency targets and make the info target more informative
tron
parents: 2317
diff changeset
  1001
.deps/%.d: %.c $(MAKE_CONFIG) table/strings.h endian_target.h
2315
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1002
	@echo '===> Determining dependencies of $<'
2356
9277224514f6 (svn r2882) Some fixes for MorphOS (by tokai)
tron
parents: 2340
diff changeset
  1003
	$(Q)$(CC) $(CFLAGS) $(CDEFS) -MM $< > $@
2188
9acde6fcc645 (svn r2703) - Feature: [OSX] Added a native alert window to show whatever error() needs to print (Tobin made this, while I fixed some issued in it)
bjarni
parents: 2185
diff changeset
  1004
2327
076c79dea490 (svn r2853) Add missing dependencies and flags to the dependency targets and make the info target more informative
tron
parents: 2317
diff changeset
  1005
.deps/%.d: %.cpp $(MAKE_CONFIG) table/strings.h endian_target.h
2315
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1006
	@echo '===> Determining dependencies of $<'
2356
9277224514f6 (svn r2882) Some fixes for MorphOS (by tokai)
tron
parents: 2340
diff changeset
  1007
	$(Q)$(CXX) $(CFLAGS) $(CDEFS) -MM $< > $@
2315
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1008
2327
076c79dea490 (svn r2853) Add missing dependencies and flags to the dependency targets and make the info target more informative
tron
parents: 2317
diff changeset
  1009
.deps/%.d: %.m $(MAKE_CONFIG) table/strings.h endian_target.h
2315
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1010
	@echo '===> Determining dependencies of $<'
2356
9277224514f6 (svn r2882) Some fixes for MorphOS (by tokai)
tron
parents: 2340
diff changeset
  1011
	$(Q)$(CC) $(CFLAGS) $(CDEFS) -MM $< > $@
2315
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1012
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1013
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1014
%.o: %.c $(MAKE_CONFIG)
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1015
	@echo '===> Compiling $<'
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1016
	$(Q)$(CC) $(CFLAGS) $(CDEFS) -c -o $@ $<
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1017
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1018
%.o: %.cpp  $(MAKE_CONFIG)
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1019
	@echo '===> Compiling $<'
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1020
	$(Q)$(CXX) $(CFLAGS) $(CDEFS) -c -o $@ $<
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1021
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1022
%.o: %.m  $(MAKE_CONFIG)
a6dc17991fa5 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1023
	@echo '===> Compiling $<'
2317
1221c9576436 (svn r2843) OSX doesn't like OBJC, so give it back its beloved CC, because it's the only ObjectiveC consumer
tron
parents: 2315
diff changeset
  1024
	$(Q)$(CC) $(CFLAGS) $(CDEFS) -c -o $@ $<
1163
044430212516 (svn r1665) Remove VERBOSE flag, because it was only partially implemented
tron
parents: 1162
diff changeset
  1025
044430212516 (svn r1665) Remove VERBOSE flag, because it was only partially implemented
tron
parents: 1162
diff changeset
  1026
044430212516 (svn r1665) Remove VERBOSE flag, because it was only partially implemented
tron
parents: 1162
diff changeset
  1027
info:
1435
89d0c6a56a9b (svn r1939) Revert part of r1938 which accidently crept in
tron
parents: 1434
diff changeset
  1028
	@echo 'CFLAGS  = $(CFLAGS)'
1163
044430212516 (svn r1665) Remove VERBOSE flag, because it was only partially implemented
tron
parents: 1162
diff changeset
  1029
	@echo 'LDFLAGS = $(LDFLAGS)'
044430212516 (svn r1665) Remove VERBOSE flag, because it was only partially implemented
tron
parents: 1162
diff changeset
  1030
	@echo 'LIBS    = $(LIBS)'
2327
076c79dea490 (svn r2853) Add missing dependencies and flags to the dependency targets and make the info target more informative
tron
parents: 2317
diff changeset
  1031
	@echo 'CDEFS   = $(CDEFS)'