1
CONFIG ?= config.default
5
BACKENDS = allegro gdi sdl mixer_sdl x11 posix
7
OSTYPES = amiga beos cygwin freebsd haiku linux mingw mac
9
ifeq ($(findstring $(BACKEND), $(BACKENDS)),)
10
$(error Unkown BACKEND "$(BACKEND)", must be one of "$(BACKENDS)")
13
ifeq ($(findstring $(COLOUR_DEPTH), $(COLOUR_DEPTHS)),)
14
$(error Unkown COLOUR_DEPTH "$(COLOUR_DEPTH)", must be one of "$(COLOUR_DEPTHS)")
17
ifeq ($(findstring $(OSTYPE), $(OSTYPES)),)
18
$(error Unkown OSTYPE "$(OSTYPE)", must be one of "$(OSTYPES)")
22
ifeq ($(BACKEND), x11)
23
$(warning ATTENTION: X11 backend is broken)
27
ifeq ($(OSTYPE),amiga)
28
STD_LIBS ?= -lz -lbz2 -lunix -lpthread -lSDL_mixer -lsmpeg -lvorbisfile -lvorbis -logg
29
CFLAGS += -mcrt=newlib -DUSE_C -DBIG_ENDIAN -gstabs+
30
LDFLAGS += -Bstatic -non_shared
34
LIBS += -lz -lnet -lbz2
37
ifeq ($(OSTYPE),haiku)
38
LIBS += -lz -lnetwork -lbz2
41
ifeq ($(OSTYPE),freebsd)
51
ifeq ($(OSTYPE),linux)
56
ifeq ($(OSTYPE),cygwin)
57
CFLAGS += -I/usr/include/mingw -mwin32
58
LIBS += -lgdi32 -lwinmm -lz -lbz2
61
ifeq ($(OSTYPE),mingw)
63
SOURCES += simsys_w32_png.cc
64
CFLAGS += -mno-cygwin -DPNG_STATIC -DZLIB_STATIC -march=pentium
68
LIBS += -lmingw32 -lgdi32 -lwinmm -lwsock32 -lz -lbz2
71
ifeq ($(OSTYPE),mingw)
72
SOURCES += clipboard_w32.cc
74
SOURCES += clipboard_internal.cc
77
ALLEGRO_CONFIG ?= allegro-config
78
SDL_CONFIG ?= sdl-config
82
CFLAGS += -O3 -fno-schedule-insns
84
ifneq ($(OSTYPE),haiku)
85
CFLAGS += -minline-all-stringops
93
ifeq ($(shell expr $(DEBUG) \>= 1), 1)
96
ifeq ($(shell expr $(DEBUG) \>= 2), 1)
99
ifeq ($(shell expr $(DEBUG) \>= 3), 1)
107
CFLAGS += -pg -DPROFILE -fno-inline -fno-schedule-insns
111
ifneq ($(WITH_REVISION),)
112
REV = $(shell svnversion)
114
CFLAGS += -DREVISION="$(REV)"
118
CFLAGS += -Wall -W -Wcast-qual -Wpointer-arith -Wcast-align $(FLAGS)
119
CCFLAGS += -Wstrict-prototypes
122
SOURCES += bauer/brueckenbauer.cc
123
SOURCES += bauer/fabrikbauer.cc
124
SOURCES += bauer/hausbauer.cc
125
SOURCES += bauer/tunnelbauer.cc
126
SOURCES += bauer/vehikelbauer.cc
127
SOURCES += bauer/warenbauer.cc
128
SOURCES += bauer/wegbauer.cc
129
SOURCES += besch/bild_besch.cc
130
SOURCES += besch/bruecke_besch.cc
131
SOURCES += besch/fabrik_besch.cc
132
SOURCES += besch/grund_besch.cc
133
SOURCES += besch/haus_besch.cc
134
SOURCES += besch/vehikel_besch.cc
135
SOURCES += besch/reader/bridge_reader.cc
136
SOURCES += besch/reader/building_reader.cc
137
SOURCES += besch/reader/citycar_reader.cc
138
SOURCES += besch/reader/crossing_reader.cc
139
SOURCES += besch/reader/factory_reader.cc
140
SOURCES += besch/reader/good_reader.cc
141
SOURCES += besch/reader/ground_reader.cc
142
SOURCES += besch/reader/groundobj_reader.cc
143
SOURCES += besch/reader/image_reader.cc
144
SOURCES += besch/reader/imagelist2d_reader.cc
145
SOURCES += besch/reader/imagelist_reader.cc
146
SOURCES += besch/reader/obj_reader.cc
147
SOURCES += besch/reader/pedestrian_reader.cc
148
SOURCES += besch/reader/roadsign_reader.cc
149
SOURCES += besch/reader/root_reader.cc
150
SOURCES += besch/reader/sim_reader.cc
151
SOURCES += besch/reader/skin_reader.cc
152
SOURCES += besch/reader/sound_reader.cc
153
SOURCES += besch/reader/text_reader.cc
154
SOURCES += besch/reader/tree_reader.cc
155
SOURCES += besch/reader/tunnel_reader.cc
156
SOURCES += besch/reader/vehicle_reader.cc
157
SOURCES += besch/reader/way_obj_reader.cc
158
SOURCES += besch/reader/way_reader.cc
159
SOURCES += besch/reader/xref_reader.cc
160
SOURCES += besch/sound_besch.cc
161
SOURCES += besch/tunnel_besch.cc
162
SOURCES += besch/ware_besch.cc
163
SOURCES += boden/boden.cc
164
SOURCES += boden/brueckenboden.cc
165
SOURCES += boden/fundament.cc
166
SOURCES += boden/grund.cc
167
SOURCES += boden/monorailboden.cc
168
SOURCES += boden/tunnelboden.cc
169
SOURCES += boden/wasser.cc
170
SOURCES += boden/wege/kanal.cc
171
SOURCES += boden/wege/maglev.cc
172
SOURCES += boden/wege/monorail.cc
173
SOURCES += boden/wege/narrowgauge.cc
174
SOURCES += boden/wege/runway.cc
175
SOURCES += boden/wege/schiene.cc
176
SOURCES += boden/wege/strasse.cc
177
SOURCES += boden/wege/weg.cc
178
SOURCES += dataobj/crossing_logic.cc
179
SOURCES += dataobj/dingliste.cc
180
SOURCES += dataobj/einstellungen.cc
181
SOURCES += dataobj/fahrplan.cc
182
SOURCES += dataobj/freelist.cc
183
SOURCES += dataobj/gameinfo.cc
184
SOURCES += dataobj/koord.cc
185
SOURCES += dataobj/koord3d.cc
186
SOURCES += dataobj/loadsave.cc
187
SOURCES += dataobj/marker.cc
188
SOURCES += dataobj/network.cc
189
SOURCES += dataobj/network_cmd.cc
190
SOURCES += dataobj/network_cmp_pakset.cc
191
SOURCES += dataobj/network_packet.cc
192
SOURCES += dataobj/network_socket_list.cc
193
SOURCES += dataobj/pakset_info.cc
194
SOURCES += dataobj/powernet.cc
195
SOURCES += dataobj/ribi.cc
196
SOURCES += dataobj/route.cc
197
SOURCES += dataobj/scenario.cc
198
SOURCES += dataobj/tabfile.cc
199
SOURCES += dataobj/translator.cc
200
SOURCES += dataobj/umgebung.cc
201
SOURCES += dataobj/warenziel.cc
202
SOURCES += dings/baum.cc
203
SOURCES += dings/bruecke.cc
204
SOURCES += dings/crossing.cc
205
SOURCES += dings/field.cc
206
SOURCES += dings/gebaeude.cc
207
SOURCES += dings/groundobj.cc
208
SOURCES += dings/label.cc
209
SOURCES += dings/leitung2.cc
210
SOURCES += dings/pillar.cc
211
SOURCES += dings/roadsign.cc
212
SOURCES += dings/signal.cc
213
SOURCES += dings/tunnel.cc
214
SOURCES += dings/wayobj.cc
215
SOURCES += dings/wolke.cc
216
SOURCES += dings/zeiger.cc
218
SOURCES += freight_list_sorter.cc
219
SOURCES += gui/banner.cc
220
SOURCES += gui/baum_edit.cc
221
SOURCES += gui/citybuilding_edit.cc
222
SOURCES += gui/citylist_frame_t.cc
223
SOURCES += gui/citylist_stats_t.cc
224
SOURCES += gui/climates.cc
225
SOURCES += gui/colors.cc
226
SOURCES += gui/components/gui_button.cc
227
SOURCES += gui/components/gui_chart.cc
228
SOURCES += gui/components/gui_combobox.cc
229
SOURCES += gui/components/gui_fixedwidth_textarea.cc
230
SOURCES += gui/components/gui_flowtext.cc
231
SOURCES += gui/components/gui_image_list.cc
232
SOURCES += gui/components/gui_label.cc
233
SOURCES += gui/components/gui_numberinput.cc
234
SOURCES += gui/components/gui_scrollbar.cc
235
SOURCES += gui/components/gui_scrolled_list.cc
236
SOURCES += gui/components/gui_scrollpane.cc
237
SOURCES += gui/components/gui_speedbar.cc
238
SOURCES += gui/components/gui_tab_panel.cc
239
SOURCES += gui/components/gui_textarea.cc
240
SOURCES += gui/components/gui_textinput.cc
241
SOURCES += gui/components/gui_world_view_t.cc
242
SOURCES += gui/convoi_detail_t.cc
243
SOURCES += gui/convoi_filter_frame.cc
244
SOURCES += gui/convoi_frame.cc
245
SOURCES += gui/convoi_info_t.cc
246
SOURCES += gui/curiosity_edit.cc
247
SOURCES += gui/curiositylist_frame_t.cc
248
SOURCES += gui/curiositylist_stats_t.cc
249
SOURCES += gui/depot_frame.cc
250
SOURCES += gui/enlarge_map_frame_t.cc
251
SOURCES += gui/extend_edit.cc
252
SOURCES += gui/fabrik_info.cc
253
SOURCES += gui/factory_edit.cc
254
SOURCES += gui/factorylist_frame_t.cc
255
SOURCES += gui/factorylist_stats_t.cc
256
SOURCES += gui/fahrplan_gui.cc
257
SOURCES += gui/goods_frame_t.cc
258
SOURCES += gui/goods_stats_t.cc
259
SOURCES += gui/ground_info.cc
260
SOURCES += gui/gui_container.cc
261
SOURCES += gui/gui_convoiinfo.cc
262
SOURCES += gui/gui_frame.cc
263
SOURCES += gui/halt_detail.cc
264
SOURCES += gui/halt_info.cc
265
SOURCES += gui/halt_list_filter_frame.cc
266
SOURCES += gui/halt_list_frame.cc
267
SOURCES += gui/halt_list_stats.cc
268
SOURCES += gui/help_frame.cc
269
SOURCES += gui/jump_frame.cc
270
SOURCES += gui/karte.cc
271
SOURCES += gui/kennfarbe.cc
272
SOURCES += gui/label_info.cc
273
SOURCES += gui/labellist_frame_t.cc
274
SOURCES += gui/labellist_stats_t.cc
275
SOURCES += gui/line_item.cc
276
SOURCES += gui/line_management_gui.cc
277
SOURCES += gui/load_relief_frame.cc
278
SOURCES += gui/loadsave_frame.cc
279
SOURCES += gui/map_frame.cc
280
SOURCES += gui/message_frame_t.cc
281
SOURCES += gui/message_option_t.cc
282
SOURCES += gui/message_stats_t.cc
283
SOURCES += gui/messagebox.cc
284
SOURCES += gui/money_frame.cc
285
SOURCES += gui/optionen.cc
286
SOURCES += gui/pakselector.cc
287
SOURCES += gui/password_frame.cc
288
SOURCES += gui/player_frame_t.cc
289
SOURCES += gui/savegame_frame.cc
290
SOURCES += gui/scenario_frame.cc
291
SOURCES += gui/schedule_list.cc
292
SOURCES += gui/server_frame.cc
293
SOURCES += gui/settings_frame.cc
294
SOURCES += gui/settings_stats.cc
295
SOURCES += gui/signal_spacing.cc
296
SOURCES += gui/sound_frame.cc
297
SOURCES += gui/sprachen.cc
298
SOURCES += gui/stadt_info.cc
299
SOURCES += gui/station_building_select.cc
300
SOURCES += gui/thing_info.cc
301
SOURCES += gui/trafficlight_info.cc
302
SOURCES += gui/welt.cc
303
SOURCES += gui/werkzeug_waehler.cc
304
SOURCES += old_blockmanager.cc
305
SOURCES += player/ai.cc
306
SOURCES += player/ai_goods.cc
307
SOURCES += player/ai_passenger.cc
308
SOURCES += player/simplay.cc
309
SOURCES += simcity.cc
310
SOURCES += simconvoi.cc
311
SOURCES += simdebug.cc
312
SOURCES += simdepot.cc
313
SOURCES += simdings.cc
314
SOURCES += simevent.cc
316
SOURCES += simhalt.cc
317
SOURCES += simintr.cc
319
SOURCES += simline.cc
320
SOURCES += simlinemgmt.cc
321
SOURCES += simmain.cc
323
SOURCES += simmenu.cc
324
SOURCES += simmesg.cc
325
SOURCES += simplan.cc
326
SOURCES += simskin.cc
327
SOURCES += simsound.cc
328
SOURCES += simticker.cc
329
SOURCES += simtools.cc
330
SOURCES += simview.cc
331
SOURCES += simware.cc
332
SOURCES += simwerkz.cc
334
SOURCES += simworld.cc
335
SOURCES += sucher/platzsucher.cc
336
SOURCES += tpl/debug_helper.cc
337
SOURCES += unicode.cc
338
SOURCES += utils/cbuffer_t.cc
339
SOURCES += utils/checksum.cc
340
SOURCES += utils/log.cc
341
SOURCES += utils/memory_rw.cc
342
SOURCES += utils/searchfolder.cc
343
SOURCES += utils/sha1.cc
344
SOURCES += utils/simstring.cc
345
SOURCES += vehicle/movingobj.cc
346
SOURCES += vehicle/simpeople.cc
347
SOURCES += vehicle/simvehikel.cc
348
SOURCES += vehicle/simverkehr.cc
350
SOURCES += simgraph$(COLOUR_DEPTH).cc
353
ifeq ($(BACKEND),allegro)
354
SOURCES += simsys_d.cc
355
SOURCES += sound/allegro_sound.cc
356
SOURCES += music/allegro_midi.cc
357
ifeq ($(ALLEGRO_CONFIG),)
359
ALLEGRO_LDFLAGS := -lalleg
361
ALLEGRO_CFLAGS := $(shell $(ALLEGRO_CONFIG) --cflags)
362
ALLEGRO_LDFLAGS := $(shell $(ALLEGRO_CONFIG) --libs)
364
CFLAGS += $(ALLEGRO_CFLAGS) -DUSE_SOFTPOINTER
365
LIBS += $(ALLEGRO_LDFLAGS)
369
ifeq ($(BACKEND),gdi)
370
SOURCES += simsys_w$(COLOUR_DEPTH).cc
371
SOURCES += music/w32_midi.cc
372
SOURCES += sound/win32_sound.cc
376
ifeq ($(BACKEND),sdl)
377
SOURCES += simsys_s.cc
378
CFLAGS += -DUSE_16BIT_DIB
380
# Core Audio (Quicktime) base sound system routines
381
SOURCES += sound/core-audio_sound.mm
382
SOURCES += music/core-audio_midi.mm
383
LIBS += -framework Foundation -framework QTKit
385
SOURCES += sound/sdl_sound.cc
386
ifeq ($(findstring $(OSTYPE), cygwin mingw),)
387
SOURCES += music/no_midi.cc
389
SOURCES += music/w32_midi.cc
392
ifeq ($(SDL_CONFIG),)
394
SDL_CFLAGS := -I/System/Libraries/Frameworks/SDL/Headers -Dmain=SDL_main
395
SDL_LDFLAGS := -framework SDL -framework Cocoa -I/System/Libraries/Frameworks/SDL/Headers SDLMain.m
397
SDL_CFLAGS := -I$(MINGDIR)/include/SDL -Dmain=SDL_main
398
SDL_LDFLAGS := -lSDLmain -lSDL -mwindows
401
SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
402
SDL_LDFLAGS := $(shell $(SDL_CONFIG) --libs)
405
CFLAGS += $(SDL_CFLAGS)
406
LIBS += $(SDL_LDFLAGS)
410
ifeq ($(BACKEND),mixer_sdl)
411
SOURCES += simsys_s.cc
412
SOURCES += sound/sdl_mixer_sound.cc
413
SOURCES += music/sdl_midi.cc
414
CFLAGS += -DUSE_16BIT_DIB
415
ifeq ($(SDL_CONFIG),)
416
SDL_CFLAGS := -I$(MINGDIR)/include/SDL -Dmain=SDL_main
417
SDL_LDFLAGS := -lmingw32 -lSDLmain -lSDL -mwindows
419
SDL_CFLAGS := $(shell $(SDL_CONFIG) --cflags)
420
SDL_LDFLAGS := $(shell $(SDL_CONFIG) --libs)
422
CFLAGS += $(SDL_CFLAGS)
423
LIBS += $(SDL_LDFLAGS) -lSDL_mixer
426
ifeq ($(BACKEND),x11)
427
SOURCES += simsys_x$(COLOUR_DEPTH).c
428
SOURCES += sound/no_sound.cc
429
SOURCES += music/no_midi.cc
430
CFLAGS += -I/usr/X11R6/include
431
LIBS += -L/usr/X11R6/lib/ -lX11 -lXext
434
ifeq ($(BACKEND),posix)
435
SOURCES += simsys_posix.cc
436
SOURCES += music/no_midi.cc
437
SOURCES += sound/no_sound.cc
440
ifeq ($(COLOUR_DEPTH),0)
441
CFLAGS += -DNO_GRAPHIC
444
ifneq ($(findstring $(OSTYPE), cygwin mingw),)
450
CXXFLAGS += $(CFLAGS)
459
$(Q)$(MAKE) -e -C makeobj FLAGS="$(FLAGS)"