Makefile
author bjarni
Mon, 10 Oct 2005 15:22:47 +0000
changeset 2503 a5d95bb8523a
parent 2500 92bc404b86ca
child 2505 0475d5828af6
permissions -rw-r--r--
(svn r3029) -Change: [OSX] removed the buggy java midi player, which was rendered obsolite by r3022
2185
3df7d9081a29 (svn r2700) Insert Id tag into the Makefile
tron
parents: 2177
diff changeset
     1
# $Id$
3df7d9081a29 (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
a6ef8e441cd6 (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
3dd9b5a439af (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
7a92ca9738e2 (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
7122e759d56c (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
7122e759d56c (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
ffa3d1f9d1be (svn r2712) Overhaul DirectMusic MIDI backend:
tron
parents: 2189
diff changeset
    58
# WITH_DIRECTMUSIC: enable DirectMusic MIDI support
804
3288a1c6d133 (svn r1274) Makefile: networking is not longer experimental
bjarni
parents: 798
diff changeset
    59
# WITH_NETWORK: enable networking
3288a1c6d133 (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
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    61
#
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    62
# Paths:
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    63
# INSTALL: If not set, the game uses the directory of the binary to
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
    64
# store everything (lang, data, gm, save and openttd.cfg), this is the `old' behaviour.
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    65
# In this case, none of the following paths are used, you also should _not_
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    66
# use `make install', but copy the required stuff yourself (or just play out
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    67
# of you source directory, which should work fine).
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    68
# If you want to use `make install' to install the game globally, you should
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    69
# define it _before_ you build the game. If you only define INSTALL when you
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    70
# do `make install', the game won't be able to find it's files (so you should
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    71
# also define all the following paths before building).
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    72
#
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    73
# So, the following paths should be defined if INSTALL is defined.
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    74
# None of these paths have to end with /
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    75
# PREFIX:	Normally /usr/local
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    76
# BINARY_DIR:	The location of the binary, normally games. (Will be prefixed
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    77
#		with $PREFIX)
1865
739183b1243a (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
    78
# DATA_DIR: 	The location of the data (lang, data, gm and scenario), normally
739183b1243a (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
    79
#		share/games/openttd. (Will be prefixed with $PREFIX) Note that scenarios
739183b1243a (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
    80
#		are only put here if USE_HOMEDIR is true, otherwise they are placed in
739183b1243a (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
#		PERSONAL_DIR/scenario
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    82
# PERSONAL_DIR:	The directory where openttd.cfg and the save folder will be
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    83
#		stored. You cannot use ~ here, define USE_HOMEDIR for that.
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    84
# USE_HOMEDIR:	If this variable is set, PERSONAL_DIR will be prefixed with
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    85
#		~/ at runtime (the user's homedir)
561
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
    86
# SECOND_DATA_PATH  Use this data dir if a file is not found in the data dir in the data path
1251
c833ce273512 (svn r1755) Trim trailing whitespace
tron
parents: 1247
diff changeset
    87
# CUSTOM_LANG_PATH  If this is set, it will use the path given to search for lng files
561
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
    88
#		instead of the lang dir in the data path
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
    89
#   NOTE: both SECOND_DATA_PATH and CUSTOM_LANG_PATH uses paths relative to where OTTD is opened
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    90
#
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    91
# DEST_DIR:	make install will use this directory instead of the filesystem
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    92
# 		root to install its files. This should normally not be used by
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    93
# 		ordinary users, currently it is only used for the debian
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    94
# 		packaging. This value should only be set when calling `make
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
    95
# 		install' and is not saved in Makefile.config
1476
c1e4ba7193db (svn r1980) Check $DESTDIR if $DEST_DIR was not set.
pasky
parents: 1435
diff changeset
    96
#               (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
    97
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    98
# STATIC: link statically
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    99
# CYGWIN: build in Cygwin environment
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   100
# MINGW: build with MingW compiler, link with MingW libraries
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   101
#
1411
2ff543ac50a7 (svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents: 1324
diff changeset
   102
# VERBOSE: show full compiler invocations instead of brief progress messages
2ff543ac50a7 (svn r1915) Support for a VERBOSE flag which will make the full compiler invocations to be shown instead of ===> Brief summaries.
pasky
parents: 1324
diff changeset
   103
#
1692
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   104
# Special for crosscompiling there are some commands available:
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   105
#
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   106
# ENDIAN_FORCE: forces the endian-check to give a certain result. Can be either BE or LE.
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   107
# WINDRES: the location of your windres
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   108
# CC_HOST: the gcc of your localhost if you are making a target that produces incompatible executables
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   109
# CFLAGS_HOST: cflags used for CC_HOST. Make it something if you are getting errors when you try to compi
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   110
#		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
   111
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   112
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   113
##############################################################################
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   114
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   115
# Configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   116
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   117
1148
c7ffa9f5adc1 (svn r1649) Makefile: added known-bugs.txt to mac and MorphOS release scripts and made a really dirty hack to force 0.3.6 on binary files compiled with this makefile
bjarni
parents: 1146
diff changeset
   118
180
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   119
# Makefile version tag
1492
311c5770360e (svn r1996) makefile.config -> Makefile.config, that's its name.
pasky
parents: 1491
diff changeset
   120
# it checks if the version tag in Makefile.config is the same and force update outdated config files
1692
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   121
MAKEFILE_VERSION:=7
180
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   122
1146
9561b9668dc6 (svn r1647) Remove stale comment and fix typo
tron
parents: 1119
diff changeset
   123
# 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
   124
CONFIG_WRITER=makefiledir/Makefile.config_writer
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   125
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   126
ifndef MANUAL_CONFIG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   127
# Automatic configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   128
MAKE_CONFIG:=Makefile.config
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   129
MAKEFILE:=Makefile
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   130
LIB_DETECTION=makefiledir/Makefile.libdetection
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   131
CONFIG_WRITER=makefiledir/Makefile.config_writer
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   132
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   133
# Apply automatic configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   134
# 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
   135
# 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
   136
-include $(MAKE_CONFIG)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   137
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   138
CONFIG_INCLUDED:=1
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   139
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   140
1955
793bb2e9f1d3 (svn r2461) -Feature [Makefile] libpng-config can now be called something else in Makefile.config
bjarni
parents: 1952
diff changeset
   141
ifndef LIBPNG-CONFIG
793bb2e9f1d3 (svn r2461) -Feature [Makefile] libpng-config can now be called something else in Makefile.config
bjarni
parents: 1952
diff changeset
   142
LIBPNG-CONFIG :=libpng-config
793bb2e9f1d3 (svn r2461) -Feature [Makefile] libpng-config can now be called something else in Makefile.config
bjarni
parents: 1952
diff changeset
   143
endif
793bb2e9f1d3 (svn r2461) -Feature [Makefile] libpng-config can now be called something else in Makefile.config
bjarni
parents: 1952
diff changeset
   144
1492
311c5770360e (svn r1996) makefile.config -> Makefile.config, that's its name.
pasky
parents: 1491
diff changeset
   145
# 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
   146
ifneq ($(MAKEFILE_VERSION),$(CONFIG_VERSION))
189
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   147
	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
   148
		UPDATECONFIG:=upgradeconf
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   149
		CONFIG_INCLUDED:=
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   150
	else
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   151
		# 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
   152
		ifeq ($(shell uname),FreeBSD)
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   153
			SDL-CONFIG:=sdl11-config
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   154
		else
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   155
			SDL-CONFIG:=sdl-config
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   156
		endif
4d133909845a (svn r190) Makefile: fixed bug, that prevented compilation with MANUAL_CONFIG enabled
bjarni
parents: 180
diff changeset
   157
	endif
1693
463d48b86526 (svn r2197) -fix [Makefile]: SDL_CONFIG from makefile.config is now not always overwritten
bjarni
parents: 1692
diff changeset
   158
endif
463d48b86526 (svn r2197) -fix [Makefile]: SDL_CONFIG from makefile.config is now not always overwritten
bjarni
parents: 1692
diff changeset
   159
463d48b86526 (svn r2197) -fix [Makefile]: SDL_CONFIG from makefile.config is now not always overwritten
bjarni
parents: 1692
diff changeset
   160
ifndef SDL-CONFIG
463d48b86526 (svn r2197) -fix [Makefile]: SDL_CONFIG from makefile.config is now not always overwritten
bjarni
parents: 1692
diff changeset
   161
	UPDATECONFIG:=upgradeconf
463d48b86526 (svn r2197) -fix [Makefile]: SDL_CONFIG from makefile.config is now not always overwritten
bjarni
parents: 1692
diff changeset
   162
	CONFIG_INCLUDED:=
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   163
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   164
1492
311c5770360e (svn r1996) makefile.config -> Makefile.config, that's its name.
pasky
parents: 1491
diff changeset
   165
# 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
   166
ifndef CONFIG_INCLUDED
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   167
# sets network on by default if there aren't any config file
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   168
ENABLE_NETWORK:=1
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   169
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   170
# paths for make install
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   171
# disabled as they would break it for some (many?) people if they were default
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   172
#PREFIX:=/usr/local
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   173
#DATA_DIR:=share/games/openttd
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   174
#BINARY_DIR:=games
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   175
#PERSONAL_DIR:=.openttd
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   176
#USE_HOMEDIR:=1
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   177
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   178
-include $(LIB_DETECTION)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   179
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   180
180
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   181
ifdef SUPRESS_LANG_ERRORS
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   182
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
   183
endif
47ee14fe2b35 (svn r181) Makefile: enabled ability to supress output of missing strings in lng files
bjarni
parents: 164
diff changeset
   184
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   185
ifdef STATIC
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   186
ifndef WIN32
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   187
ifndef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   188
ifndef MORPHOS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   189
ifndef SKIP_STATIC_CHECK
1492
311c5770360e (svn r1996) makefile.config -> Makefile.config, that's its name.
pasky
parents: 1491
diff changeset
   190
$(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
   191
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   192
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   193
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   194
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   195
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   196
580
d3f72568d160 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   197
ifdef RELEASE
d3f72568d160 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   198
ifdef OSX
d3f72568d160 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   199
ifndef STATIC
d3f72568d160 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   200
$(error do not make dynamically linked releases. Most users can't use those)
d3f72568d160 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   201
endif
d3f72568d160 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   202
endif
d3f72568d160 (svn r1000) Makefile: added check for static build releases on mac. Most users can't use a dynamic build
bjarni
parents: 574
diff changeset
   203
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   204
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   205
# Force SDL on UNIX platforms
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   206
ifndef WITH_SDL
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   207
ifdef UNIX
549
e48b65755929 (svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
bjarni
parents: 543
diff changeset
   208
ifndef DEDICATED
e48b65755929 (svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
bjarni
parents: 543
diff changeset
   209
$(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
   210
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   211
endif
549
e48b65755929 (svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
bjarni
parents: 543
diff changeset
   212
endif
e48b65755929 (svn r949) Makefile: added DEDICATED flag to allow complilation of dedicated servers without linking to SDL. Request by Jezral
bjarni
parents: 543
diff changeset
   213
1029
985407cedbbd (svn r1530) Makefilefix: now the binary never links to SDL if DEDICATED is set. Thanks to igor2code for making me aware of this issue even through I fixed it in a different way than his patch did. (I made dedicated never link to sdl, nomatter what makefile.config says)
bjarni
parents: 988
diff changeset
   214
# remove the dependancy for sdl if DEDICALTED is used
1952
ad89ff734571 (svn r2458) -Fix: Quickfix to make dedicated-server compile again. We need a more ellegant way to fix this...
truelight
parents: 1951
diff changeset
   215
# and add -lpthread to LDFLAGS, because SDL normally adds that...
1029
985407cedbbd (svn r1530) Makefilefix: now the binary never links to SDL if DEDICATED is set. Thanks to igor2code for making me aware of this issue even through I fixed it in a different way than his patch did. (I made dedicated never link to sdl, nomatter what makefile.config says)
bjarni
parents: 988
diff changeset
   216
ifdef DEDICATED
985407cedbbd (svn r1530) Makefilefix: now the binary never links to SDL if DEDICATED is set. Thanks to igor2code for making me aware of this issue even through I fixed it in a different way than his patch did. (I made dedicated never link to sdl, nomatter what makefile.config says)
bjarni
parents: 988
diff changeset
   217
WITH_SDL:=
2298
65fe3d67e7fb (svn r2822) -Fix: don't compile pthread for win32 dedicated servers
truelight
parents: 2291
diff changeset
   218
ifndef WIN32
2299
a970fa96dfe2 (svn r2823) -Fix: MorphOS doesn't have pthread either!
truelight
parents: 2298
diff changeset
   219
ifndef MORPHOS
2300
543211f07c9e (svn r2824) -Fix: OSX can now also produce dedicated servers
truelight
parents: 2299
diff changeset
   220
ifndef OSX
1952
ad89ff734571 (svn r2458) -Fix: Quickfix to make dedicated-server compile again. We need a more ellegant way to fix this...
truelight
parents: 1951
diff changeset
   221
LDFLAGS+=-lpthread
1029
985407cedbbd (svn r1530) Makefilefix: now the binary never links to SDL if DEDICATED is set. Thanks to igor2code for making me aware of this issue even through I fixed it in a different way than his patch did. (I made dedicated never link to sdl, nomatter what makefile.config says)
bjarni
parents: 988
diff changeset
   222
endif
2298
65fe3d67e7fb (svn r2822) -Fix: don't compile pthread for win32 dedicated servers
truelight
parents: 2291
diff changeset
   223
endif
2299
a970fa96dfe2 (svn r2823) -Fix: MorphOS doesn't have pthread either!
truelight
parents: 2298
diff changeset
   224
endif
2300
543211f07c9e (svn r2824) -Fix: OSX can now also produce dedicated servers
truelight
parents: 2299
diff changeset
   225
ifdef OSX
543211f07c9e (svn r2824) -Fix: OSX can now also produce dedicated servers
truelight
parents: 2299
diff changeset
   226
LDFLAGS+=-framework Cocoa
543211f07c9e (svn r2824) -Fix: OSX can now also produce dedicated servers
truelight
parents: 2299
diff changeset
   227
endif
543211f07c9e (svn r2824) -Fix: OSX can now also produce dedicated servers
truelight
parents: 2299
diff changeset
   228
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   229
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   230
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   231
##############################################################################
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   232
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   233
# Compiler configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   234
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   235
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   236
# Executable file extension
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   237
ifdef WIN32
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   238
EXE=.exe
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   239
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   240
EXE=
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   241
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   242
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   243
# Set output executable names
32
bc861ea6d23b (svn r33) -Executeable is now openttd(.exe) always
darkvater
parents: 0
diff changeset
   244
TTD=openttd$(EXE)
157
dd017fa3bad8 (svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents: 126
diff changeset
   245
ENDIAN_CHECK=endian_check$(EXE)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   246
STRGEN=strgen/strgen$(EXE)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   247
OSXAPP="OpenTTD.app"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   248
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   249
ifdef RELEASE
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   250
REV:=$(RELEASE)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   251
else
450
a74d2f607217 (svn r660) Fix typo introduced in r655
tron
parents: 446
diff changeset
   252
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
   253
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   254
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   255
# MorphOS needs builddate
1289
2514debc704e (svn r1793) Revert one instance of $(shell) back to ``, because MorphOS does The Wrong Thing(tm) when date is used within $(shell)
tron
parents: 1288
diff changeset
   256
BUILDDATE=`date +%d.%m.%y`
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   257
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   258
# AMD64 needs a little more settings to work
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   259
ifeq ($(shell uname -m), x86_64)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   260
endwarnings:=endwarnings
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   261
64_bit_warnings:=64_bit_warnings
157
dd017fa3bad8 (svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents: 126
diff changeset
   262
BASECFLAGS += -m64
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   263
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   264
1692
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   265
# Check if there is a windres override
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   266
ifndef WINDRES
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   267
WINDRES = windres
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   268
endif
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   269
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   270
# Check if we have a new target
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   271
ifdef CC_TARGET
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   272
CC = $(CC_TARGET)
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   273
endif
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   274
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   275
# Check if CC_HOST is defined. If not, it is CC
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   276
ifndef CC_HOST
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   277
CC_HOST = $(CC)
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   278
endif
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   279
ifndef CFLAGS_HOST
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   280
CFLAGS_HOST = $(BASECFLAGS)
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   281
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   282
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   283
1069
f6b7607231e5 (svn r1570) Make the gcc version test work with old versions of test (i.e. don't use the < operator)
tron
parents: 1052
diff changeset
   284
CC_VERSION = $(shell $(CC) -dumpversion | cut -c 1,3)
1052
f996874f0f16 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   285
f996874f0f16 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   286
# GNU make can only test for (in)equality
f996874f0f16 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   287
# this is a workaround to test for >=
2240
08cab36d20f3 (svn r2760) Remove stale comments, long unused stuff and simplify some checks
tron
parents: 2236
diff changeset
   288
ifeq ($(shell expr $(CC_VERSION) \>= 29), 1)
1093
4fdc46eaf423 (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents: 1069
diff changeset
   289
  CFLAGS += -O -Wall -Wno-multichar -Wsign-compare -Wstrict-prototypes
1324
9295c63a1ce1 (svn r1828) New warning flag especially for truelight (:<
tron
parents: 1317
diff changeset
   290
  CFLAGS += -Wwrite-strings -Wpointer-arith
1052
f996874f0f16 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   291
endif
2240
08cab36d20f3 (svn r2760) Remove stale comments, long unused stuff and simplify some checks
tron
parents: 2236
diff changeset
   292
ifeq ($(shell expr $(CC_VERSION) \>= 30), 1)
1052
f996874f0f16 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   293
  CFLAGS += -W -Wno-unused-parameter
f996874f0f16 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   294
endif
2240
08cab36d20f3 (svn r2760) Remove stale comments, long unused stuff and simplify some checks
tron
parents: 2236
diff changeset
   295
ifeq ($(shell expr $(CC_VERSION) \>= 34), 1)
1093
4fdc46eaf423 (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents: 1069
diff changeset
   296
  CFLAGS += -Wdeclaration-after-statement -Wold-style-definition
1052
f996874f0f16 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   297
endif
f996874f0f16 (svn r1553) Check which gcc version is present and only set availible compiler flags
tron
parents: 1051
diff changeset
   298
1240
7d7f18e0b2c5 (svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents: 1211
diff changeset
   299
ifdef DEBUG
1479
6770c281d22f (svn r1983) Introduce multiple compile time debug levels
tron
parents: 1476
diff changeset
   300
  ifeq ($(shell expr $(DEBUG) \>= 1), 1)
6770c281d22f (svn r1983) Introduce multiple compile time debug levels
tron
parents: 1476
diff changeset
   301
    CFLAGS += -g -D_DEBUG
6770c281d22f (svn r1983) Introduce multiple compile time debug levels
tron
parents: 1476
diff changeset
   302
  endif
6770c281d22f (svn r1983) Introduce multiple compile time debug levels
tron
parents: 1476
diff changeset
   303
  ifeq ($(shell expr $(DEBUG) \>= 2), 1)
6770c281d22f (svn r1983) Introduce multiple compile time debug levels
tron
parents: 1476
diff changeset
   304
    CFLAGS += -fno-inline
6770c281d22f (svn r1983) Introduce multiple compile time debug levels
tron
parents: 1476
diff changeset
   305
  endif
6770c281d22f (svn r1983) Introduce multiple compile time debug levels
tron
parents: 1476
diff changeset
   306
  ifeq ($(shell expr $(DEBUG) \>= 3), 1)
6770c281d22f (svn r1983) Introduce multiple compile time debug levels
tron
parents: 1476
diff changeset
   307
    CFLAGS += -O0
6770c281d22f (svn r1983) Introduce multiple compile time debug levels
tron
parents: 1476
diff changeset
   308
  endif
1240
7d7f18e0b2c5 (svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents: 1211
diff changeset
   309
endif
7d7f18e0b2c5 (svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents: 1211
diff changeset
   310
7d7f18e0b2c5 (svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents: 1211
diff changeset
   311
ifdef PROFILE
7d7f18e0b2c5 (svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents: 1211
diff changeset
   312
  CFLAGS += -pg
7d7f18e0b2c5 (svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents: 1211
diff changeset
   313
  LDFLAGS += -pg
7d7f18e0b2c5 (svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents: 1211
diff changeset
   314
endif
7d7f18e0b2c5 (svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents: 1211
diff changeset
   315
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   316
CDEFS=-DWITH_REV
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   317
1240
7d7f18e0b2c5 (svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents: 1211
diff changeset
   318
ifndef DEBUG
7d7f18e0b2c5 (svn r1744) DEBUG and PROFILE can be used at the same time.
tron
parents: 1211
diff changeset
   319
ifndef PROFILE
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   320
# Release mode
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   321
ifndef MORPHOS
1810
8a574d47872b (svn r2314) - Feature: [ 1187490 ] Patches for building on IRIX (jgilje)
Darkvater
parents: 1722
diff changeset
   322
ifndef IRIX
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   323
# automatical strip breaks under morphos
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   324
BASECFLAGS += -s
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   325
LDFLAGS += -s
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   326
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   327
endif
1810
8a574d47872b (svn r2314) - Feature: [ 1187490 ] Patches for building on IRIX (jgilje)
Darkvater
parents: 1722
diff changeset
   328
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   329
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   330
ifdef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   331
# these compilerflags makes the app run as fast as possible without making the app unstable. It works on G3 or newer
1169
6692150e84cd (svn r1671) Remove WARNING_DISPLAY, because it contained no warning, but an optimization flag
tron
parents: 1168
diff changeset
   332
BASECFLAGS += -O3 -funroll-loops -fsched-interblock -falign-loops=16 -falign-jumps=16 -falign-functions=16 -falign-jumps-max-skip=15 -falign-loops-max-skip=15 -mdynamic-no-pic -mpowerpc-gpopt -force_cpusubtype_ALL
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   333
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   334
ifdef MORPHOS
2356
43d1812406e7 (svn r2882) Some fixes for MorphOS (by tokai)
tron
parents: 2340
diff changeset
   335
BASECFLAGS += -I/gg/os-include -O2 -noixemul -fstrict-aliasing -fexpensive-optimizations
1291
cbb62d2fb544 (svn r1795) Change CFLAGS for MorphOS (tokai)
tron
parents: 1289
diff changeset
   336
BASECFLAGS += -mcpu=604 -fno-inline -mstring -mmultiple
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   337
else
1169
6692150e84cd (svn r1671) Remove WARNING_DISPLAY, because it contained no warning, but an optimization flag
tron
parents: 1168
diff changeset
   338
BASECFLAGS += -O2
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   339
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   340
ifndef PROFILE
1810
8a574d47872b (svn r2314) - Feature: [ 1187490 ] Patches for building on IRIX (jgilje)
Darkvater
parents: 1722
diff changeset
   341
ifndef IRIX
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   342
BASECFLAGS += -fomit-frame-pointer
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   343
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   344
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   345
endif
1810
8a574d47872b (svn r2314) - Feature: [ 1187490 ] Patches for building on IRIX (jgilje)
Darkvater
parents: 1722
diff changeset
   346
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   347
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   348
ifdef STATIC
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   349
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
   350
LDFLAGS += -static
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   351
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   352
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   353
798
8331baea2dc9 (svn r1268) -Fix: some warnings in gfx.c fixed
darkvater
parents: 770
diff changeset
   354
# 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
   355
ifdef WIN32
798
8331baea2dc9 (svn r1268) -Fix: some warnings in gfx.c fixed
darkvater
parents: 770
diff changeset
   356
ifdef CYGWIN
8331baea2dc9 (svn r1268) -Fix: some warnings in gfx.c fixed
darkvater
parents: 770
diff changeset
   357
BASECFLAGS += -mwin32
8331baea2dc9 (svn r1268) -Fix: some warnings in gfx.c fixed
darkvater
parents: 770
diff changeset
   358
LDFLAGS += -mwin32
8331baea2dc9 (svn r1268) -Fix: some warnings in gfx.c fixed
darkvater
parents: 770
diff changeset
   359
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   360
ifdef MINGW
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   361
BASECFLAGS += -mno-cygwin
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   362
LDFLAGS += -mno-cygwin
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   363
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   364
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   365
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   366
CFLAGS += $(BASECFLAGS)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   367
2033
d9ea679ab1fc (svn r2542) -Add: [GPMI] Added GPMI (http://sourceforge.net/projects/libgpmi/)
truelight
parents: 2008
diff changeset
   368
# See if we want to enable GPMI
d9ea679ab1fc (svn r2542) -Add: [GPMI] Added GPMI (http://sourceforge.net/projects/libgpmi/)
truelight
parents: 2008
diff changeset
   369
ifdef GPMI
d9ea679ab1fc (svn r2542) -Add: [GPMI] Added GPMI (http://sourceforge.net/projects/libgpmi/)
truelight
parents: 2008
diff changeset
   370
CFLAGS  += -DGPMI
d9ea679ab1fc (svn r2542) -Add: [GPMI] Added GPMI (http://sourceforge.net/projects/libgpmi/)
truelight
parents: 2008
diff changeset
   371
GPMI_STATIC_PATH = `gpmi-config --static`
d9ea679ab1fc (svn r2542) -Add: [GPMI] Added GPMI (http://sourceforge.net/projects/libgpmi/)
truelight
parents: 2008
diff changeset
   372
LDFLAGS += -rdynamic `gpmi-config --libs`
d9ea679ab1fc (svn r2542) -Add: [GPMI] Added GPMI (http://sourceforge.net/projects/libgpmi/)
truelight
parents: 2008
diff changeset
   373
# Static link paths into the game
d9ea679ab1fc (svn r2542) -Add: [GPMI] Added GPMI (http://sourceforge.net/projects/libgpmi/)
truelight
parents: 2008
diff changeset
   374
LDFLAGS += $(GPMI_STATIC_PATH)/paths-static.o
d9ea679ab1fc (svn r2542) -Add: [GPMI] Added GPMI (http://sourceforge.net/projects/libgpmi/)
truelight
parents: 2008
diff changeset
   375
endif
d9ea679ab1fc (svn r2542) -Add: [GPMI] Added GPMI (http://sourceforge.net/projects/libgpmi/)
truelight
parents: 2008
diff changeset
   376
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   377
ifdef UNIX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   378
CDEFS += -DUNIX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   379
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   380
421
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   381
ifdef BEOS
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   382
CDEFS += -DBEOS
2497
0fe349de34c7 (svn r3023) -Fix [BeOS] fixed compilation on BeOS R5 (MYOB)
bjarni
parents: 2496
diff changeset
   383
LDFLAGS += -lmidi -lbe -lpthread
421
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   384
ifdef WITH_NETWORK
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   385
	ifdef BEOS_NET_SERVER
1051
be278201f830 (svn r1552) Make ottd compile on Zeta
tron
parents: 1029
diff changeset
   386
		CDEFS += -DBEOS_NET_SERVER
2497
0fe349de34c7 (svn r3023) -Fix [BeOS] fixed compilation on BeOS R5 (MYOB)
bjarni
parents: 2496
diff changeset
   387
		LDFLAGS += -lnet
1051
be278201f830 (svn r1552) Make ottd compile on Zeta
tron
parents: 1029
diff changeset
   388
	else
2497
0fe349de34c7 (svn r3023) -Fix [BeOS] fixed compilation on BeOS R5 (MYOB)
bjarni
parents: 2496
diff changeset
   389
		# BONE needs a few more libraries than R5
1051
be278201f830 (svn r1552) Make ottd compile on Zeta
tron
parents: 1029
diff changeset
   390
		LDFLAGS += -lbind -lsocket
421
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   391
	endif
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   392
endif
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   393
endif
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   394
1164
48da7bcf7b7c (svn r1666) Move some MorphOS compile flags to a place where they actually belong
tron
parents: 1163
diff changeset
   395
ifdef MORPHOS
1291
cbb62d2fb544 (svn r1795) Change CFLAGS for MorphOS (tokai)
tron
parents: 1289
diff changeset
   396
# -Wstrict-prototypes generates much noise because of system headers
cbb62d2fb544 (svn r1795) Change CFLAGS for MorphOS (tokai)
tron
parents: 1289
diff changeset
   397
CFLAGS += -Wno-strict-prototypes
1164
48da7bcf7b7c (svn r1666) Move some MorphOS compile flags to a place where they actually belong
tron
parents: 1163
diff changeset
   398
endif
48da7bcf7b7c (svn r1666) Move some MorphOS compile flags to a place where they actually belong
tron
parents: 1163
diff changeset
   399
446
7a92ca9738e2 (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   400
ifdef SUNOS
7a92ca9738e2 (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   401
CDEFS += -DSUNOS
7a92ca9738e2 (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   402
ifdef WITH_NETWORK
7a92ca9738e2 (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   403
LDFLAGS += -lnsl -lsocket
7a92ca9738e2 (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   404
endif
7a92ca9738e2 (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   405
endif
7a92ca9738e2 (svn r655) Add the necessary bits to make building on SunOS/Solaris work
tron
parents: 421
diff changeset
   406
2500
92bc404b86ca (svn r3026) -Fix: [OSX] fixed bug that prevented dedicated servers from compiling (introduced in r3022)
bjarni
parents: 2497
diff changeset
   407
# tell the source that we are building a dedicated server
92bc404b86ca (svn r3026) -Fix: [OSX] fixed bug that prevented dedicated servers from compiling (introduced in r3022)
bjarni
parents: 2497
diff changeset
   408
ifdef DEDICATED
92bc404b86ca (svn r3026) -Fix: [OSX] fixed bug that prevented dedicated servers from compiling (introduced in r3022)
bjarni
parents: 2497
diff changeset
   409
CDEFS += -DDEDICATED
92bc404b86ca (svn r3026) -Fix: [OSX] fixed bug that prevented dedicated servers from compiling (introduced in r3022)
bjarni
parents: 2497
diff changeset
   410
endif
92bc404b86ca (svn r3026) -Fix: [OSX] fixed bug that prevented dedicated servers from compiling (introduced in r3022)
bjarni
parents: 2497
diff changeset
   411
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   412
# SDL config
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   413
ifdef WITH_SDL
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   414
CDEFS += -DWITH_SDL
1254
b25f77484174 (svn r1758) Replace `` with $(shell), because the latter is only evaluated once instead of over and over again
tron
parents: 1251
diff changeset
   415
CFLAGS += $(shell $(SDL-CONFIG) --cflags)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   416
ifdef STATIC
1254
b25f77484174 (svn r1758) Replace `` with $(shell), because the latter is only evaluated once instead of over and over again
tron
parents: 1251
diff changeset
   417
LIBS += $(shell $(SDL-CONFIG) --static-libs)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   418
else
1254
b25f77484174 (svn r1758) Replace `` with $(shell), because the latter is only evaluated once instead of over and over again
tron
parents: 1251
diff changeset
   419
LIBS += $(shell $(SDL-CONFIG) --libs)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   420
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   421
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   422
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   423
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   424
# zlib config
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   425
ifdef WITH_ZLIB
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   426
	CDEFS +=  -DWITH_ZLIB
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   427
	ifdef STATIC
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   428
		ifdef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   429
# 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
   430
			LIBS += -lz
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   431
		else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   432
			ifndef STATIC_ZLIB_PATH
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   433
				ifndef MANUAL_CONFIG
1492
311c5770360e (svn r1996) makefile.config -> Makefile.config, that's its name.
pasky
parents: 1491
diff changeset
   434
					# updates Makefile.config with the zlib path
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   435
					UPDATECONFIG:=upgradeconf
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   436
				endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   437
				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
   438
				ifdef TEMP
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   439
					STATIC_ZLIB_PATH:=/lib/$(TEMP)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   440
				else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   441
					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
   442
					ifdef TEMP
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   443
						STATIC_ZLIB_PATH:=/usr/lib/$(TEMP)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   444
					else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   445
						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
   446
						ifdef TEMP
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   447
							STATIC_ZLIB_PATH:=/usr/local/lib/$(TEMP)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   448
						endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   449
					endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   450
				endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   451
			endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   452
			LIBS += $(STATIC_ZLIB_PATH)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   453
		endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   454
	else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   455
		LIBS += -lz
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   456
	endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   457
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   458
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   459
# libpng config
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   460
ifdef WITH_PNG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   461
CDEFS += -DWITH_PNG
2315
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
   462
CFLAGS += $(shell $(LIBPNG-CONFIG) --cppflags --I_opts)
551
f69b4fc48d19 (svn r951) Makefile: fixed missing flag for libpng, which prevented lib detection if SDL was not used
bjarni
parents: 549
diff changeset
   463
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   464
# 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
   465
PNGCONFIG_FLAGS = --ldflags --libs
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   466
ifdef STATIC
583
3762db489bb4 (svn r1003) Mac: reintroduced the static libpng hack in makefile since it appears to be needed in the nightly builds
bjarni
parents: 580
diff changeset
   467
ifdef OSX
3762db489bb4 (svn r1003) Mac: reintroduced the static libpng hack in makefile since it appears to be needed in the nightly builds
bjarni
parents: 580
diff changeset
   468
# Seems like we need a tiny hack for OSX static to work
1955
793bb2e9f1d3 (svn r2461) -Feature [Makefile] libpng-config can now be called something else in Makefile.config
bjarni
parents: 1952
diff changeset
   469
LIBS += $(shell $(LIBPNG-CONFIG) --prefix)/lib/libpng.a
583
3762db489bb4 (svn r1003) Mac: reintroduced the static libpng hack in makefile since it appears to be needed in the nightly builds
bjarni
parents: 580
diff changeset
   470
else
1955
793bb2e9f1d3 (svn r2461) -Feature [Makefile] libpng-config can now be called something else in Makefile.config
bjarni
parents: 1952
diff changeset
   471
LIBS += $(shell $(LIBPNG-CONFIG) --static $(PNGCONFIG_FLAGS))
583
3762db489bb4 (svn r1003) Mac: reintroduced the static libpng hack in makefile since it appears to be needed in the nightly builds
bjarni
parents: 580
diff changeset
   472
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   473
else
1955
793bb2e9f1d3 (svn r2461) -Feature [Makefile] libpng-config can now be called something else in Makefile.config
bjarni
parents: 1952
diff changeset
   474
LIBS += $(shell $(LIBPNG-CONFIG)  --L_opts $(PNGCONFIG_FLAGS))
0
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
347
8b6874b7ed27 (svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents: 285
diff changeset
   478
# enables/disables assert()
348
3345a78d37e4 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   479
ifdef DISABLE_ASSERTS
3345a78d37e4 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   480
CFLAGS += -DNDEBUG
3345a78d37e4 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   481
endif
3345a78d37e4 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   482
3345a78d37e4 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   483
# automatically disables asserts for release
3345a78d37e4 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   484
ifdef RELEASE
347
8b6874b7ed27 (svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents: 285
diff changeset
   485
ifndef ENABLE_ASSERTS
8b6874b7ed27 (svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents: 285
diff changeset
   486
CFLAGS += -DNDEBUG
8b6874b7ed27 (svn r530) Makefile: added ability to switch asserts on and off
bjarni
parents: 285
diff changeset
   487
endif
348
3345a78d37e4 (svn r531) Makefile: made asserts enabled by default
bjarni
parents: 347
diff changeset
   488
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   489
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   490
ifdef TRANSLATOR
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   491
STRGEN_FLAGS=-t
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   492
else
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   493
STRGEN_FLAGS=
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   494
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   495
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   496
2503
a5d95bb8523a (svn r3029) -Change: [OSX] removed the buggy java midi player, which was rendered obsolite by r3022
bjarni
parents: 2500
diff changeset
   497
# OSX path setup
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   498
ifdef OSX
561
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   499
ifndef SECOND_DATA_PATH
1720
8f64ceed5778 (svn r2224) -Fix: capital-correctness for OSX-dir-names
truelight
parents: 1694
diff changeset
   500
SECOND_DATA_PATH:="$(OSXAPP)/Contents/Data/"
561
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   501
endif
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   502
ifndef CUSTOM_LANG_DIR
2500
92bc404b86ca (svn r3026) -Fix: [OSX] fixed bug that prevented dedicated servers from compiling (introduced in r3022)
bjarni
parents: 2497
diff changeset
   503
ifndef DEDICATED
1720
8f64ceed5778 (svn r2224) -Fix: capital-correctness for OSX-dir-names
truelight
parents: 1694
diff changeset
   504
CUSTOM_LANG_DIR:="$(OSXAPP)/Contents/Lang/"
561
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   505
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   506
endif
2500
92bc404b86ca (svn r3026) -Fix: [OSX] fixed bug that prevented dedicated servers from compiling (introduced in r3022)
bjarni
parents: 2497
diff changeset
   507
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   508
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   509
ifdef MIDI
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   510
CDEFS += -DEXTERNAL_PLAYER=\"$(MIDI)\"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   511
ifdef MIDI_ARG
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   512
CDEFS += -DMIDI_ARG=\"$(MIDI_ARG)\"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   513
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   514
endif
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 WITH_NETWORK
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   517
CDEFS += -DENABLE_NETWORK
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   518
ifdef QNX
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   519
LIBS += -lsocket
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   520
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   521
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   522
561
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   523
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   524
ifdef SECOND_DATA_PATH
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   525
CDEFS += -DSECOND_DATA_DIR=\"$(SECOND_DATA_PATH)/\"
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   526
endif
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   527
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   528
ifdef CUSTOM_LANG_DIR
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   529
CDEFS += -DCUSTOM_LANG_DIR=\"$(CUSTOM_LANG_DIR)/\"
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   530
endif
9a0c469a251c (svn r970) Added 2nd data path for all non-windows OSes
bjarni
parents: 551
diff changeset
   531
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   532
ifdef WITH_DIRECTMUSIC
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   533
CDEFS += -DWIN32_ENABLE_DIRECTMUSIC_SUPPORT
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   534
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   535
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   536
ifdef WIN32
1692
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   537
LIBS += -lws2_32 -lwinmm -lgdi32 -ldxguid -lole32
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   538
ifdef WITH_DIRECTMUSIC
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   539
LIBS += -lstdc++
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   540
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   541
TTDLDFLAGS += -Wl,--subsystem,windows
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   542
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   543
1476
c1e4ba7193db (svn r1980) Check $DESTDIR if $DEST_DIR was not set.
pasky
parents: 1435
diff changeset
   544
ifndef DEST_DIR
c1e4ba7193db (svn r1980) Check $DESTDIR if $DEST_DIR was not set.
pasky
parents: 1435
diff changeset
   545
DEST_DIR = $(DESTDIR)
c1e4ba7193db (svn r1980) Check $DESTDIR if $DEST_DIR was not set.
pasky
parents: 1435
diff changeset
   546
endif
c1e4ba7193db (svn r1980) Check $DESTDIR if $DEST_DIR was not set.
pasky
parents: 1435
diff changeset
   547
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   548
# sets up the paths for use for make install
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   549
ifdef INSTALL
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   550
# We use _PREFIXED vars here, so the paths are recalculated every time, and
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   551
# the prefix is not prepended in the makefile config
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   552
BINARY_DIR_PREFIXED:=$(PREFIX)/$(BINARY_DIR)
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   553
DATA_DIR_PREFIXED:=$(PREFIX)/$(DATA_DIR)
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   554
# We use _INSTALL vars here, these vars are the locations where the files will
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   555
# be installed
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   556
DATA_DIR_INSTALL=$(DEST_DIR)/$(DATA_DIR_PREFIXED)
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   557
BINARY_DIR_INSTALL=$(DEST_DIR)/$(BINARY_DIR_PREFIXED)
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   558
# Let the code know where to find stuff
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   559
ifdef DATA_DIR_PREFIXED
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   560
CDEFS += -DGAME_DATA_DIR=\"$(DATA_DIR_PREFIXED)/\"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   561
endif
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   562
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   563
ifdef PERSONAL_DIR
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   564
CDEFS += -DPERSONAL_DIR=\"$(PERSONAL_DIR)/\"
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   565
endif
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   566
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   567
ifdef USE_HOMEDIR
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   568
CDEFS += -DUSE_HOMEDIR
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   569
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   570
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   571
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   572
##############################################################################
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   573
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   574
# What to compile
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   575
# (users do not want to modify anything below)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   576
#
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
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   579
### Sources
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   580
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   581
C_SOURCES += aircraft_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   582
C_SOURCES += aircraft_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   583
C_SOURCES += airport.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   584
C_SOURCES += airport_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   585
C_SOURCES += aystar.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   586
C_SOURCES += bridge_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   587
C_SOURCES += callback_table.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   588
C_SOURCES += clear_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   589
C_SOURCES += command.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   590
C_SOURCES += console.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   591
C_SOURCES += console_cmds.c
2291
c142846954ee (svn r2815) Store the currency information in one central place instead of scattering it in several unrelated files
tron
parents: 2285
diff changeset
   592
C_SOURCES += currency.c
1299
39c06aba09aa (svn r1803) Move debugging stuff into files of it's own
tron
parents: 1292
diff changeset
   593
C_SOURCES += debug.c
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   594
C_SOURCES += dedicated.c
1313
f1013ec3d318 (svn r1817) -Codechange: Moved depot-functions to depot.c
truelight
parents: 1299
diff changeset
   595
C_SOURCES += depot.c
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   596
C_SOURCES += disaster_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   597
C_SOURCES += dock_gui.c
2171
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents: 2106
diff changeset
   598
C_SOURCES += driver.c
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   599
C_SOURCES += dummy_land.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   600
C_SOURCES += economy.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   601
C_SOURCES += engine.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   602
C_SOURCES += engine_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   603
C_SOURCES += fileio.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   604
C_SOURCES += gfx.c
2340
e18ef06bc59a (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
   605
C_SOURCES += gfxinit.c
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   606
C_SOURCES += graph_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   607
C_SOURCES += newgrf.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   608
C_SOURCES += industry_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   609
C_SOURCES += industry_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   610
C_SOURCES += intro_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   611
C_SOURCES += landscape.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   612
C_SOURCES += main_gui.c
679
04ca2cd69420 (svn r1117) Move map arrays and some related macros into their own files map.c and map.h
tron
parents: 677
diff changeset
   613
C_SOURCES += map.c
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   614
C_SOURCES += md5.c
2075
21d2986569d1 (svn r2585) - Fix [Makefile]: some small cleanups, remove warnings, and add mersenne to makefile (Luca)
Darkvater
parents: 2033
diff changeset
   615
C_SOURCES += mersenne.c
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   616
C_SOURCES += minilzo.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   617
C_SOURCES += misc.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   618
C_SOURCES += misc_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   619
C_SOURCES += misc_gui.c
1496
15d859a626e8 (svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
tron
parents: 1492
diff changeset
   620
C_SOURCES += mixer.c
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   621
C_SOURCES += music_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   622
C_SOURCES += namegen.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   623
C_SOURCES += network.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   624
C_SOURCES += network_client.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   625
C_SOURCES += network_data.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   626
C_SOURCES += network_gamelist.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   627
C_SOURCES += network_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   628
C_SOURCES += network_server.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   629
C_SOURCES += network_udp.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   630
C_SOURCES += news_gui.c
1247
3851739bfd09 (svn r1751) - Feature: New PathFinder (NPF).
matthijs
parents: 1241
diff changeset
   631
C_SOURCES += npf.c
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   632
C_SOURCES += oldloader.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   633
C_SOURCES += order_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   634
C_SOURCES += order_gui.c
1985
46d2f03f66e4 (svn r2491) -Fix: Solved a performance problem introduced in r2467. While busy
celestar
parents: 1955
diff changeset
   635
C_SOURCES += openttd.c
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   636
C_SOURCES += pathfind.c
2008
cdb444f6d43c (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
   637
C_SOURCES += pbs.c
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   638
C_SOURCES += player_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   639
C_SOURCES += players.c
1259
8d8515e3da29 (svn r1763) -Add: pool.c / pool.h: generalized routines for dynamic arrays (MemoryPools)
truelight
parents: 1257
diff changeset
   640
C_SOURCES += pool.c
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   641
C_SOURCES += queue.c
1942
c5d5cf5b0263 (svn r2448) General cleanup of rail related code, more to follow.
matthijs
parents: 1891
diff changeset
   642
C_SOURCES += rail.c
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   643
C_SOURCES += rail_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   644
C_SOURCES += rail_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   645
C_SOURCES += rev.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   646
C_SOURCES += road_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   647
C_SOURCES += road_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   648
C_SOURCES += roadveh_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   649
C_SOURCES += roadveh_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   650
C_SOURCES += saveload.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   651
C_SOURCES += screenshot.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   652
C_SOURCES += settings.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   653
C_SOURCES += settings_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   654
C_SOURCES += ship_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   655
C_SOURCES += ship_gui.c
988
4304525d1b8b (svn r1486) -Codechange: moved all 'signs' stuff to signs.c/h and prepared it for
truelight
parents: 978
diff changeset
   656
C_SOURCES += signs.c
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   657
C_SOURCES += smallmap_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   658
C_SOURCES += sound.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   659
C_SOURCES += sprite.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   660
C_SOURCES += spritecache.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   661
C_SOURCES += station_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   662
C_SOURCES += station_gui.c
1317
3c90086ff34f (svn r1821) Move generic string handling functions to string.[ch] and introduce stre{cpy,cat}, see string.h for their semantics
tron
parents: 1313
diff changeset
   663
C_SOURCES += string.c
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   664
C_SOURCES += strings.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   665
C_SOURCES += subsidy_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   666
C_SOURCES += terraform_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   667
C_SOURCES += texteff.c
2285
410dedcf46d1 (svn r2809) Implement more generic threading functions, which allow more than one thread
tron
parents: 2240
diff changeset
   668
C_SOURCES += thread.c
1211
43ae74415fdd (svn r1715) Move [GS]etMapExtraBits to tile.[ch]
tron
parents: 1170
diff changeset
   669
C_SOURCES += tile.c
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   670
C_SOURCES += town_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   671
C_SOURCES += town_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   672
C_SOURCES += train_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   673
C_SOURCES += train_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   674
C_SOURCES += tree_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   675
C_SOURCES += tunnelbridge_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   676
C_SOURCES += unmovable_cmd.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   677
C_SOURCES += vehicle.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   678
C_SOURCES += vehicle_gui.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   679
C_SOURCES += viewport.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   680
C_SOURCES += water_cmd.c
1542
62a03537ad0b (svn r2046) -Codechange: moved all waypoint code to waypoint.c/waypoint.h
truelight
parents: 1496
diff changeset
   681
C_SOURCES += waypoint.c
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   682
C_SOURCES += widget.c
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   683
C_SOURCES += window.c
2174
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents: 2171
diff changeset
   684
C_SOURCES += music/null_m.c
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents: 2171
diff changeset
   685
C_SOURCES += sound/null_s.c
2177
b0f207d47f8e (svn r2691) Separate dedicated video driver and fix bemidi declarations
tron
parents: 2174
diff changeset
   686
C_SOURCES += video/dedicated_v.c
2174
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents: 2171
diff changeset
   687
C_SOURCES += video/null_v.c
677
e3c1348781b1 (svn r1115) Put every source file on an extra line
tron
parents: 615
diff changeset
   688
2395
d1629f64d157 (svn r2921) -Codechange: moved all AI-code to 1 central place (ai/ai.c)
truelight
parents: 2381
diff changeset
   689
# AI related files
d1629f64d157 (svn r2921) -Codechange: moved all AI-code to 1 central place (ai/ai.c)
truelight
parents: 2381
diff changeset
   690
C_SOURCES += ai/ai.c
2381
9a5ed6c0a2e6 (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
   691
C_SOURCES += ai/default/default.c
9a5ed6c0a2e6 (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
   692
C_SOURCES += ai/trolly/trolly.c
9a5ed6c0a2e6 (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
   693
C_SOURCES += ai/trolly/build.c
9a5ed6c0a2e6 (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
   694
C_SOURCES += ai/trolly/pathfinder.c
9a5ed6c0a2e6 (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
   695
C_SOURCES += ai/trolly/shared.c
9a5ed6c0a2e6 (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
   696
421
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   697
CXX_SOURCES =
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   698
2188
640a0a5f77ea (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
   699
OBJC_SOURCES =
640a0a5f77ea (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
   700
1829
e90fe433fa7d (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
   701
ifdef WITH_SDL
e90fe433fa7d (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
   702
C_SOURCES += sdl.c
2174
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents: 2171
diff changeset
   703
C_SOURCES += sound/sdl_s.c
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents: 2171
diff changeset
   704
C_SOURCES += video/sdl_v.c
1829
e90fe433fa7d (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
   705
endif
e90fe433fa7d (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
   706
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   707
ifdef WIN32
2171
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents: 2106
diff changeset
   708
C_SOURCES += win32.c
2174
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents: 2171
diff changeset
   709
C_SOURCES += music/win32_m.c
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents: 2171
diff changeset
   710
C_SOURCES += sound/win32_s.c
24d868f1c576 (svn r2688) MSVC and Watcom can't handle identical file names in different directories, oh my...
tron
parents: 2171
diff changeset
   711
C_SOURCES += video/win32_v.c
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   712
else
2171
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents: 2106
diff changeset
   713
C_SOURCES += unix.c
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents: 2106
diff changeset
   714
C_SOURCES += music/extmidi.c
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   715
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   716
2188
640a0a5f77ea (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
   717
ifdef OSX
640a0a5f77ea (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
   718
OBJC_SOURCES += os/macosx/macos.m
2500
92bc404b86ca (svn r3026) -Fix: [OSX] fixed bug that prevented dedicated servers from compiling (introduced in r3022)
bjarni
parents: 2497
diff changeset
   719
ifndef DEDICATED
2496
74c42595f8e8 (svn r3022) -feature: [OSX] OSX now uses quicktime to play midi files
bjarni
parents: 2395
diff changeset
   720
C_SOURCES    += music/qtmidi.c
2188
640a0a5f77ea (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
   721
endif
2500
92bc404b86ca (svn r3026) -Fix: [OSX] fixed bug that prevented dedicated servers from compiling (introduced in r3022)
bjarni
parents: 2497
diff changeset
   722
endif
2188
640a0a5f77ea (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
   723
640a0a5f77ea (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
   724
OBJS = $(C_SOURCES:%.c=%.o) $(CXX_SOURCES:%.cpp=%.o) $(OBJC_SOURCES:%.m=%.o)
421
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   725
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   726
ifdef BEOS
2171
60334c9ca477 (svn r2685) -Codechange: Split the music/sound/video drivers into separate files and move them into subfolders.
tron
parents: 2106
diff changeset
   727
CXX_SOURCES += music/bemidi.cpp
421
3dd9b5a439af (svn r619) Add the necessary bits to make building under BeOS using GNU Make work
tron
parents: 413
diff changeset
   728
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   729
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   730
ifdef WIN32
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   731
# Resource file
1167
507a33e75007 (svn r1669) Rename all ttd_XXX to just XXX, because we already know who we are (;
tron
parents: 1164
diff changeset
   732
OBJS += winres.o
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   733
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   734
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   735
ifdef WITH_DIRECTMUSIC
2197
ffa3d1f9d1be (svn r2712) Overhaul DirectMusic MIDI backend:
tron
parents: 2189
diff changeset
   736
CXX_SOURCES += music/dmusic.cpp
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   737
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   738
1170
f55fbc6b3fce (svn r1672) Simplify dependency tracking and actually implement it for C++ files, too.
tron
parents: 1169
diff changeset
   739
DEPS = $(OBJS:%.o=.deps/%.d)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   740
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   741
LANG_TXT = $(filter-out %.unfinished.txt,$(wildcard lang/*.txt))
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   742
LANGS = $(LANG_TXT:%.txt=%.lng)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   743
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
   744
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   745
##############################################################################
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   746
#
1413
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   747
# Build commands
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   748
#
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   749
2369
80ca2ba71384 (svn r2895) Remove unused variables and bring a comment closer to reality
tron
parents: 2356
diff changeset
   750
# If we are verbose, we will show commands prefixed by $(Q).
80ca2ba71384 (svn r2895) Remove unused variables and bring a comment closer to reality
tron
parents: 2356
diff changeset
   751
# The $(Q)s get replaced by @ in non-verbose mode.
1413
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   752
# Inspired by the Linux kernel build system.
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   753
ifdef VERBOSE
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   754
	Q =
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   755
else
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   756
	Q = @
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   757
endif
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   758
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   759
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   760
##############################################################################
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   761
#
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   762
# Targets
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   763
#
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   764
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   765
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   766
### Normal build rules
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   767
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   768
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   769
ifdef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   770
OSX:=OSX
1822
ea9966b94491 (svn r2327) -fix [MacOSX] default path for midi player on mac is now correct again
bjarni
parents: 1810
diff changeset
   771
OSX_MIDI_PLAYER_FILE:=os/macos/OpenTTDMidi.class
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   772
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   773
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   774
1721
e2887b445ac0 (svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents: 1720
diff changeset
   775
all: endian_target.h endian_host.h $(UPDATECONFIG) $(LANGS) $(TTD) $(OSX) $(endwarnings)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   776
1721
e2887b445ac0 (svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents: 1720
diff changeset
   777
endian_host.h: $(ENDIAN_CHECK)
e2887b445ac0 (svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents: 1720
diff changeset
   778
	@echo '===> Testing endianness for host'
e2887b445ac0 (svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents: 1720
diff changeset
   779
	$(Q)./$(ENDIAN_CHECK) > $@
e2887b445ac0 (svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents: 1720
diff changeset
   780
e2887b445ac0 (svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents: 1720
diff changeset
   781
endian_target.h: $(ENDIAN_CHECK)
e2887b445ac0 (svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents: 1720
diff changeset
   782
	@echo '===> Testing endianness for target'
1692
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   783
	$(Q)./$(ENDIAN_CHECK) $(ENDIAN_FORCE) > $@
157
dd017fa3bad8 (svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents: 126
diff changeset
   784
dd017fa3bad8 (svn r158) -Fix: make endianess check 100% accurate (hopefully ;))
truelight
parents: 126
diff changeset
   785
$(ENDIAN_CHECK): endian_check.c
2315
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
   786
	@echo '===> Compiling and Linking $@'
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
   787
	$(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
   788
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   789
2315
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
   790
$(TTD): $(OBJS) $(MAKE_CONFIG)
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
   791
	@echo '===> Linking $@'
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
   792
	$(Q)$(CC) $(LDFLAGS) $(TTDLDFLAGS) $(OBJS) $(LIBS) -o $@
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   793
728
ed05a60c01de (svn r1180) Makefile: fixed dependancies so the flag -j can be used. It makes the compilation process into more than one job which makes it able to benefit from multiple CPUs. Using -j without setting a limit of jobs (like -j2) is not a great idea (thanks to ln-- for reporting the need for this one)
bjarni
parents: 679
diff changeset
   794
$(OSX): $(TTD)
1413
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   795
	$(Q)rm -fr "$(OSXAPP)"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   796
	$(Q)mkdir -p "$(OSXAPP)"/Contents/MacOS
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   797
	$(Q)mkdir -p "$(OSXAPP)"/Contents/Resources
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   798
	$(Q)mkdir -p "$(OSXAPP)"/Contents/Data
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   799
	$(Q)mkdir -p "$(OSXAPP)"/Contents/Lang
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   800
	$(Q)echo "APPL????" > "$(OSXAPP)"/Contents/PkgInfo
1694
98b0f81cb999 (svn r2198) renamed MacOS to MacOSX where it was written wrong. Made myself MacOSX porter as well as coder
bjarni
parents: 1693
diff changeset
   801
	$(Q)cp os/macosx/openttd.icns "$(OSXAPP)"/Contents/Resources/openttd.icns
98b0f81cb999 (svn r2198) renamed MacOS to MacOSX where it was written wrong. Made myself MacOSX porter as well as coder
bjarni
parents: 1693
diff changeset
   802
	$(Q)os/macosx/plistgen.sh "$(OSXAPP)" "$(REV)"
1722
f0ca3514f746 (svn r2226) -Fix: 2 other capital problems for the OSX part of the Makefile
truelight
parents: 1721
diff changeset
   803
	$(Q)cp os/macosx/track_starter "$(OSXAPP)"/Contents/MacOS
f0ca3514f746 (svn r2226) -Fix: 2 other capital problems for the OSX part of the Makefile
truelight
parents: 1721
diff changeset
   804
	$(Q)cp os/macosx/OpenTTDMidi.class "$(OSXAPP)"/Contents/MacOS
1720
8f64ceed5778 (svn r2224) -Fix: capital-correctness for OSX-dir-names
truelight
parents: 1694
diff changeset
   805
	$(Q)cp data/* "$(OSXAPP)"/Contents/Data/
8f64ceed5778 (svn r2224) -Fix: capital-correctness for OSX-dir-names
truelight
parents: 1694
diff changeset
   806
	$(Q)cp lang/*.lng "$(OSXAPP)"/Contents/Lang/
1413
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   807
	$(Q)cp $(TTD) "$(OSXAPP)"/Contents/MacOS/$(TTD)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   808
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   809
$(endwarnings): $(64_bit_warnings)
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
$(64_bit_warnings):
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   812
	$(warning 64 bit CPUs will get some 64 bit specific bugs!)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   813
	$(warning If you see any bugs, include in your bug report that you use a 64 bit CPU)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   814
1721
e2887b445ac0 (svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents: 1720
diff changeset
   815
$(STRGEN): strgen/strgen.c endian_host.h
2315
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
   816
	@echo '===> Compiling and Linking $@'
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
   817
	$(Q)$(CC_HOST) $(CFLAGS_HOST) $(CDEFS) $< -o $@
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   818
474
211d24b41a53 (svn r725) Fix language file dependencies
tron
parents: 462
diff changeset
   819
table/strings.h: lang/english.txt $(STRGEN)
1118
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   820
	@echo '===> Generating $@'
1413
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   821
	$(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
   822
476
68e6469a3c91 (svn r727) The langauge files depend on english.txt, not strings.h
tron
parents: 475
diff changeset
   823
lang/%.lng: lang/%.txt $(STRGEN) lang/english.txt
1118
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   824
	@echo '===> Compiling language $(*F)'
2106
a3060fdb94c4 (svn r2616) Don't stop when compiling a language fails, just delete the defective .lng
tron
parents: 2096
diff changeset
   825
	$(Q)$(STRGEN) $(STRGEN_FLAGS) $< $(LANG_ERRORS) || rm -f $@
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   826
1891
862800791170 (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.
Darkvater
parents: 1865
diff changeset
   827
winres.o: openttd.rc
1118
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   828
	@echo '===> Compiling resource $<'
1692
0b52df38cabc (svn r2196) -Change: updated the Makefile, now it works for crossplatform compiling
TrueLight
parents: 1629
diff changeset
   829
	$(Q)$(WINDRES) -o $@ $<
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   830
770
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   831
ifdef MORPHOS
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   832
release: all
1413
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   833
	$(Q)rm -fr "/t/openttd-$(RELEASE)-morphos.lha"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   834
	$(Q)mkdir -p "/t/"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   835
	$(Q)mkdir -p "/t/openttd-$(RELEASE)-morphos"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   836
	$(Q)mkdir -p "/t/openttd-$(RELEASE)-morphos/docs"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   837
	$(Q)mkdir -p "/t/openttd-$(RELEASE)-morphos/data"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   838
	$(Q)mkdir -p "/t/openttd-$(RELEASE)-morphos/lang"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   839
	$(Q)mkdir -p "/t/openttd-$(RELEASE)-morphos/scenario"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   840
	$(Q)cp -R $(TTD)                      "/t/openttd-$(RELEASE)-morphos/"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   841
	$(Q)cp data/*                         "/t/openttd-$(RELEASE)-morphos/data/"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   842
	$(Q)cp lang/*.lng                     "/t/openttd-$(RELEASE)-morphos/lang/"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   843
	$(Q)cp scenario/*                     "/t/openttd-$(RELEASE)-morphos/scenario/"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   844
	$(Q)cp readme.txt                     "/t/openttd-$(RELEASE)-morphos/docs/ReadMe"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   845
	$(Q)cp docs/console.txt               "/t/openttd-$(RELEASE)-morphos/docs/Console"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   846
	$(Q)cp COPYING                        "/t/openttd-$(RELEASE)-morphos/docs/"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   847
	$(Q)cp changelog.txt                  "/t/openttd-$(RELEASE)-morphos/docs/ChangeLog"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   848
	$(Q)cp known-bugs.txt				   "/t/openttd-$(RELEASE)-morphos/docs/known-bugs.txt"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   849
	$(Q)cp os/morphos/icons/openttd.info  "/t/openttd-$(RELEASE)-morphos/$(TTD).info"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   850
	$(Q)cp os/morphos/icons/docs.info     "/t/openttd-$(RELEASE)-morphos/docs.info"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   851
	$(Q)cp os/morphos/icons/drawer.info   "/t/openttd-$(RELEASE)-morphos.info"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   852
	$(Q)cp os/morphos/icons/document.info "/t/openttd-$(RELEASE)-morphos/docs/ReadMe.info"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   853
	$(Q)cp os/morphos/icons/document.info "/t/openttd-$(RELEASE)-morphos/docs/Console.info"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   854
	$(Q)cp os/morphos/icons/document.info "/t/openttd-$(RELEASE)-morphos/docs/COPYING.info"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   855
	$(Q)cp os/morphos/icons/document.info "/t/openttd-$(RELEASE)-morphos/docs/ChangeLog.info"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   856
	$(Q)strip --strip-all --strip-unneeded --remove-section .comment "/t/openttd-$(RELEASE)-morphos/$(TTD)"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   857
	$(Q)lha a -r "t:openttd-$(RELEASE)-morphos.lha" "t:openttd-$(RELEASE)-morphos"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   858
	$(Q)lha a    "t:openttd-$(RELEASE)-morphos.lha" "t:openttd-$(RELEASE)-morphos.info"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   859
	$(Q)rm -fr "/t/openttd-$(RELEASE)-morphos"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   860
	$(Q)rm -fr "/t/openttd-$(RELEASE)-morphos.info"
770
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   861
	@echo "Release archive can be found in RAM:t/ now."
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   862
1251
c833ce273512 (svn r1755) Trim trailing whitespace
tron
parents: 1247
diff changeset
   863
.PHONY: release
770
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   864
endif
c2eacca29601 (svn r1236) MorphOS: added make release like in OSX (tokai)
bjarni
parents: 730
diff changeset
   865
563
a6ef8e441cd6 (svn r972) Makefile: added make release (currently only works on mac)
bjarni
parents: 561
diff changeset
   866
ifdef OSX
a6ef8e441cd6 (svn r972) Makefile: added make release (currently only works on mac)
bjarni
parents: 561
diff changeset
   867
release: all
1413
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   868
	$(Q)mkdir -p "OpenTTD $(RELEASE)"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   869
	$(Q)mkdir -p "OpenTTD $(RELEASE)"/docs
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   870
	$(Q)mkdir -p "OpenTTD $(RELEASE)"/scenario
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   871
	$(Q)cp -R $(OSXAPP) "OpenTTD $(RELEASE)"/
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   872
	$(Q)cp docs/OSX_where_did_the_package_go.txt "OpenTTD $(RELEASE)"/Where\ did\ the\ package\ go.txt
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   873
	$(Q)cp readme.txt "OpenTTD $(RELEASE)"/docs/
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   874
	$(Q)cp docs/README_if_game_crashed_on_OSX.txt "OpenTTD $(RELEASE)"/docs/readme\ if\ crashed\ on\ OSX.txt
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   875
	$(Q)cp docs/console.txt "OpenTTD $(RELEASE)"/docs/
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   876
	$(Q)cp COPYING "OpenTTD $(RELEASE)"/docs/
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   877
	$(Q)cp changelog.txt "OpenTTD $(RELEASE)"/docs/
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   878
	$(Q)cp docs/README_if_game_crashed_on_OSX.txt "OpenTTD $(RELEASE)"/docs/
1694
98b0f81cb999 (svn r2198) renamed MacOS to MacOSX where it was written wrong. Made myself MacOSX porter as well as coder
bjarni
parents: 1693
diff changeset
   879
	$(Q)cp os/macosx/*.webloc "OpenTTD $(RELEASE)"
1413
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   880
	$(Q)cp known-bugs.txt "OpenTTD $(RELEASE)"/known-bugs.txt
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   881
	$(Q)cp scenario/* "OpenTTD $(RELEASE)"/scenario/
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   882
	$(Q)/usr/bin/hdiutil create -ov -format UDZO -srcfolder "OpenTTD $(RELEASE)" openttd-"$(RELEASE)"-osx.dmg
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   883
	$(Q)rm -fr "OpenTTD $(RELEASE)"
563
a6ef8e441cd6 (svn r972) Makefile: added make release (currently only works on mac)
bjarni
parents: 561
diff changeset
   884
564
86d7afd68af8 (svn r973) Makefile: added make nightly_build (only on mac)
bjarni
parents: 563
diff changeset
   885
nightly_build: all
1413
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   886
	$(Q)mkdir -p "OpenTTD_nightly_$(DATE)"
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   887
	$(Q)mkdir -p "OpenTTD_nightly_$(DATE)"/docs
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   888
	$(Q)cp -R $(OSXAPP) "OpenTTD_nightly_$(DATE)"/
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   889
	$(Q)cp docs/OSX_where_did_the_package_go.txt "OpenTTD_nightly_$(DATE)"/Where\ did\ the\ package\ go.txt
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   890
	$(Q)cp readme.txt "OpenTTD_nightly_$(DATE)"/docs/
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   891
	$(Q)cp docs/README_if_game_crashed_on_OSX.txt "OpenTTD_nightly_$(DATE)"/docs/readme\ if\ crashed\ on\ OSX.txt
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   892
	$(Q)cp docs/console.txt "OpenTTD_nightly_$(DATE)"/docs/
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   893
	$(Q)cp COPYING "OpenTTD_nightly_$(DATE)"/docs/
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   894
	$(Q)cp revisionlog.txt "OpenTTD_nightly_$(DATE)"/revisionlog.txt
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   895
	$(Q)cp docs/README_if_game_crashed_on_OSX.txt "OpenTTD_nightly_$(DATE)"/docs/
1694
98b0f81cb999 (svn r2198) renamed MacOS to MacOSX where it was written wrong. Made myself MacOSX porter as well as coder
bjarni
parents: 1693
diff changeset
   896
	$(Q)cp os/macosx/*.webloc "OpenTTD_nightly_$(DATE)"/
1413
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   897
	$(Q)/usr/bin/hdiutil create -ov -format UDZO -srcfolder "OpenTTD_nightly_$(DATE)" openttd-nightly-"$(DATE)".dmg
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   898
	$(Q)rm -fr "OpenTTD_nightly_$(DATE)"
564
86d7afd68af8 (svn r973) Makefile: added make nightly_build (only on mac)
bjarni
parents: 563
diff changeset
   899
86d7afd68af8 (svn r973) Makefile: added make nightly_build (only on mac)
bjarni
parents: 563
diff changeset
   900
.PHONY: release nightly_build
563
a6ef8e441cd6 (svn r972) Makefile: added make release (currently only works on mac)
bjarni
parents: 561
diff changeset
   901
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   902
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   903
rev.c: FORCE
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   904
	@# setting the revision number in a place, there the binary can read it
615
fc0771d6a26c (svn r1039) Makefile: now RELEASE flag can contain () too
bjarni
parents: 610
diff changeset
   905
	@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
   906
	@# some additions for MorphOS versions tag
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   907
	@echo '#ifdef __MORPHOS__'  >>rev.c.new
2378
708a7d1c653d (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
   908
	@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
   909
	@echo '#endif' >>rev.c.new
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   910
	@# 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
   911
	@# useless rebuilds.
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   912
	@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
   913
	@rm -f rev.c.new
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
FORCE:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   916
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
clean:
1118
9156318143d5 (svn r1619) Fight bit rot in the Makefile:
tron
parents: 1115
diff changeset
   919
	@echo '===> Cleaning up'
1721
e2887b445ac0 (svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents: 1720
diff changeset
   920
# endian.h is out-dated and no longer in use, so it can be removed soon
e2887b445ac0 (svn r2225) -Fix: split the endian-detection to target/host. Now cross-compiling
truelight
parents: 1720
diff changeset
   921
	$(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
   922
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   923
mrproper: clean
1413
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   924
	$(Q)rm -rf $(MAKE_CONFIG)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   925
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   926
ifndef OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   927
ifndef MORPHOS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   928
install:
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   929
ifeq ($(INSTALL),)
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   930
	$(error make install is highly experimental at his state and not\
1492
311c5770360e (svn r1996) makefile.config -> Makefile.config, that's its name.
pasky
parents: 1491
diff changeset
   931
	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
   932
	is set correctly up - run \"make upgradeconf\")
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   933
endif
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   934
543
946badd71033 (svn r942) -Merged branch/network back into the trunk
truelight
parents: 532
diff changeset
   935
ifeq ($(PREFIX), )
1492
311c5770360e (svn r1996) makefile.config -> Makefile.config, that's its name.
pasky
parents: 1491
diff changeset
   936
	$(error no prefix set - check Makefile.config)
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   937
endif
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   938
#	We compare against the non prefixed version here, so we won't install
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   939
#	if only the prefix has been set
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   940
ifeq ($(DATA_DIR),)
1492
311c5770360e (svn r1996) makefile.config -> Makefile.config, that's its name.
pasky
parents: 1491
diff changeset
   941
	$(error no data path set - check Makefile.config)
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   942
endif
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   943
ifeq ($(BINARY_DIR),)
1492
311c5770360e (svn r1996) makefile.config -> Makefile.config, that's its name.
pasky
parents: 1491
diff changeset
   944
	$(error no binary path set - check Makefile.config)
285
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   945
endif
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   946
# We'll install in $DEST_DIR instead of root if it is set (we don't
cf5213c8a919 (svn r291) Minor fix to english.txt
bjarni
parents: 222
diff changeset
   947
# care about extra /'s
1491
72850e1c2ca4 (svn r1995) Makefile: Use the install tool instead of mkdir+cp for installing the system-wide stuff, more secure. Based on Peter Brett's patch 1152428.
pasky
parents: 1479
diff changeset
   948
	install -d $(DATA_DIR_INSTALL)/lang \
72850e1c2ca4 (svn r1995) Makefile: Use the install tool instead of mkdir+cp for installing the system-wide stuff, more secure. Based on Peter Brett's patch 1152428.
pasky
parents: 1479
diff changeset
   949
	           $(DATA_DIR_INSTALL)/data \
72850e1c2ca4 (svn r1995) Makefile: Use the install tool instead of mkdir+cp for installing the system-wide stuff, more secure. Based on Peter Brett's patch 1152428.
pasky
parents: 1479
diff changeset
   950
	           $(DATA_DIR_INSTALL)/gm \
72850e1c2ca4 (svn r1995) Makefile: Use the install tool instead of mkdir+cp for installing the system-wide stuff, more secure. Based on Peter Brett's patch 1152428.
pasky
parents: 1479
diff changeset
   951
	           $(BINARY_DIR_INSTALL)
1865
739183b1243a (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
   952
ifndef USE_HOMEDIR
739183b1243a (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
   953
	mkdir -p $(PERSONAL_DIR)/scenario
739183b1243a (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
else
739183b1243a (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
	mkdir -p $(DATA_DIR_INSTALL)/scenario
739183b1243a (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
   956
endif
1491
72850e1c2ca4 (svn r1995) Makefile: Use the install tool instead of mkdir+cp for installing the system-wide stuff, more secure. Based on Peter Brett's patch 1152428.
pasky
parents: 1479
diff changeset
   957
	install $(TTD) $(BINARY_DIR_INSTALL)
72850e1c2ca4 (svn r1995) Makefile: Use the install tool instead of mkdir+cp for installing the system-wide stuff, more secure. Based on Peter Brett's patch 1152428.
pasky
parents: 1479
diff changeset
   958
	install -m 644 lang/*.lng $(DATA_DIR_INSTALL)/lang
72850e1c2ca4 (svn r1995) Makefile: Use the install tool instead of mkdir+cp for installing the system-wide stuff, more secure. Based on Peter Brett's patch 1152428.
pasky
parents: 1479
diff changeset
   959
	install -m 644 data/*.grf $(DATA_DIR_INSTALL)/data
72850e1c2ca4 (svn r1995) Makefile: Use the install tool instead of mkdir+cp for installing the system-wide stuff, more secure. Based on Peter Brett's patch 1152428.
pasky
parents: 1479
diff changeset
   960
	install -m 644 data/opntitle.dat $(DATA_DIR_INSTALL)/data
72850e1c2ca4 (svn r1995) Makefile: Use the install tool instead of mkdir+cp for installing the system-wide stuff, more secure. Based on Peter Brett's patch 1152428.
pasky
parents: 1479
diff changeset
   961
	install -m 644 media/openttd.64.png $(DATA_DIR_INSTALL)
1865
739183b1243a (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
   962
	install -m 644 media/openttd.32.xpm $(DATA_DIR_INSTALL)
739183b1243a (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
   963
ifndef USE_HOMEDIR
1160
23945308a1fd (svn r1661) Makefile: added scenario to make install
bjarni
parents: 1158
diff changeset
   964
	cp scenario/* $(PERSONAL_DIR)/scenario/
1865
739183b1243a (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
   965
else
739183b1243a (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
   966
	cp scenario/* $(DATA_DIR_INSTALL)/scenario/
739183b1243a (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
   967
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   968
else	#MorphOS
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   969
install:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   970
	$(error make install is not supported on MorphOS)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   971
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   972
else	# OSX
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   973
install:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   974
	$(error make install is not supported on MacOSX)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   975
endif
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   976
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   977
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   978
love:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   979
	@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
   980
730
95ef392e5db0 (svn r1182) -Fix: Makefile had a small glitch, making it impossible to compile the game (Oskar_)
truelight
parents: 728
diff changeset
   981
.PHONY: clean all $(OSX) install $(64_bit_warnings) $(endwarnings) love
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   982
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   983
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   984
### Automatic configuration
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   985
-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
   986
0
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
# Export all variables set to subprocesses (a bit dirty)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   989
.EXPORT_ALL_VARIABLES:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   990
upgradeconf: $(MAKE_CONFIG)
1413
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   991
	$(Q)rm $(MAKE_CONFIG)
5b907273606d (svn r1917) - Makefile: Revamped VERBOSE support, build mechanics changed.
pasky
parents: 1411
diff changeset
   992
	$(Q)$(MAKE) $(MAKE_CONFIG)
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
.PHONY: upgradeconf
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   995
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   996
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   997
### Internal build rules
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   998
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   999
# This makes sure the .deps dir is always around.
2381
9a5ed6c0a2e6 (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
  1000
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
  1001
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
  1002
# Introduce the dependencies
2315
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1003
ifneq ($(MAKECMDGOALS), clean)
1167
507a33e75007 (svn r1669) Rename all ttd_XXX to just XXX, because we already know who we are (;
tron
parents: 1164
diff changeset
  1004
-include $(DEPS)
2315
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1005
endif
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
  1006
2315
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1007
%.o: .deps/%.d
1170
f55fbc6b3fce (svn r1672) Simplify dependency tracking and actually implement it for C++ files, too.
tron
parents: 1169
diff changeset
  1008
2327
69493bdce1ae (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: %.c $(MAKE_CONFIG) table/strings.h endian_target.h
2315
63124f563f89 (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
43d1812406e7 (svn r2882) Some fixes for MorphOS (by tokai)
tron
parents: 2340
diff changeset
  1011
	$(Q)$(CC) $(CFLAGS) $(CDEFS) -MM $< > $@
2188
640a0a5f77ea (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
  1012
2327
69493bdce1ae (svn r2853) Add missing dependencies and flags to the dependency targets and make the info target more informative
tron
parents: 2317
diff changeset
  1013
.deps/%.d: %.cpp $(MAKE_CONFIG) table/strings.h endian_target.h
2315
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1014
	@echo '===> Determining dependencies of $<'
2356
43d1812406e7 (svn r2882) Some fixes for MorphOS (by tokai)
tron
parents: 2340
diff changeset
  1015
	$(Q)$(CXX) $(CFLAGS) $(CDEFS) -MM $< > $@
2315
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1016
2327
69493bdce1ae (svn r2853) Add missing dependencies and flags to the dependency targets and make the info target more informative
tron
parents: 2317
diff changeset
  1017
.deps/%.d: %.m $(MAKE_CONFIG) table/strings.h endian_target.h
2315
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1018
	@echo '===> Determining dependencies of $<'
2356
43d1812406e7 (svn r2882) Some fixes for MorphOS (by tokai)
tron
parents: 2340
diff changeset
  1019
	$(Q)$(CC) $(CFLAGS) $(CDEFS) -MM $< > $@
2315
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1020
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1021
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1022
%.o: %.c $(MAKE_CONFIG)
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1023
	@echo '===> Compiling $<'
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1024
	$(Q)$(CC) $(CFLAGS) $(CDEFS) -c -o $@ $<
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1025
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1026
%.o: %.cpp  $(MAKE_CONFIG)
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1027
	@echo '===> Compiling $<'
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1028
	$(Q)$(CXX) $(CFLAGS) $(CDEFS) -c -o $@ $<
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1029
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1030
%.o: %.m  $(MAKE_CONFIG)
63124f563f89 (svn r2841) Pimp the Makefile: Determining the header dependencies is now a separate step.
tron
parents: 2302
diff changeset
  1031
	@echo '===> Compiling $<'
2317
bbb1b4731bc3 (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
  1032
	$(Q)$(CC) $(CFLAGS) $(CDEFS) -c -o $@ $<
1163
66ce158ef5ed (svn r1665) Remove VERBOSE flag, because it was only partially implemented
tron
parents: 1162
diff changeset
  1033
66ce158ef5ed (svn r1665) Remove VERBOSE flag, because it was only partially implemented
tron
parents: 1162
diff changeset
  1034
66ce158ef5ed (svn r1665) Remove VERBOSE flag, because it was only partially implemented
tron
parents: 1162
diff changeset
  1035
info:
1435
16111425d676 (svn r1939) Revert part of r1938 which accidently crept in
tron
parents: 1434
diff changeset
  1036
	@echo 'CFLAGS  = $(CFLAGS)'
1163
66ce158ef5ed (svn r1665) Remove VERBOSE flag, because it was only partially implemented
tron
parents: 1162
diff changeset
  1037
	@echo 'LDFLAGS = $(LDFLAGS)'
66ce158ef5ed (svn r1665) Remove VERBOSE flag, because it was only partially implemented
tron
parents: 1162
diff changeset
  1038
	@echo 'LIBS    = $(LIBS)'
2327
69493bdce1ae (svn r2853) Add missing dependencies and flags to the dependency targets and make the info target more informative
tron
parents: 2317
diff changeset
  1039
	@echo 'CDEFS   = $(CDEFS)'