Subversion Repositories eduke32

Rev

Rev 6056 | Rev 6083 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
996 terminx 1
#
5 Plagman 2
# EDuke32 Makefile for GNU Make
996 terminx 3
#
5 Plagman 4
 
6056 hendricks2 5
include Common.mak
996 terminx 6
 
6056 hendricks2 7
source=source
8
DUKE3D=duke3d
9
DUKE3D_ROOT=$(source)/$(DUKE3D)
10
DUKE3D_SRC=$(DUKE3D_ROOT)/src
11
DUKE3D_RSRC=$(DUKE3D_ROOT)/rsrc
12
ENGINE_ROOT=$(source)/$(ENGINE)
4543 hendricks2 13
ENGINE_SRC=$(ENGINE_ROOT)/src
14
ENGINE_INC=$(ENGINE_ROOT)/include
5 Plagman 15
o=o
4543 hendricks2 16
asm=nasm
4553 hendricks2 17
obj=obj
5 Plagman 18
 
5197 hendricks2 19
COMPILERFLAGS += -I$(ENGINE_INC) -I$(MACT_INC) -I$(AUDIOLIB_INC) -I$(ENET_INC)
4543 hendricks2 20
 
4555 hendricks2 21
 
22
# EBacktrace
23
 
24
ifndef EBACKTRACEDLL
25
    EBACKTRACEDLL = ebacktrace1.dll
26
    ifeq ($(findstring x86_64,$(COMPILERTARGET)),x86_64)
27
        EBACKTRACEDLL = ebacktrace1-64.dll
28
    endif
29
endif
30
 
31
 
4543 hendricks2 32
# BUILD Engine
33
 
5747 hendricks2 34
ENGINE=build
35
 
4543 hendricks2 36
ENGINE_CFLAGS=-I$(ENGINE_SRC)
37
 
5748 hendricks2 38
ENGINE_OBJ=$(obj)/$(ENGINE)
4543 hendricks2 39
 
5754 hendricks2 40
ENGINE_OBJS = \
6056 hendricks2 41
    rev \
5754 hendricks2 42
    baselayer \
43
    cache1d \
44
    common \
45
    compat \
46
    crc32 \
47
    defs \
48
    engine \
5801 terminx 49
    tiles \
5792 terminx 50
    clip \
5790 terminx 51
    2d \
5788 terminx 52
    hash \
5789 terminx 53
    palette \
5754 hendricks2 54
    polymost \
55
    texcache \
56
    dxtfilter \
57
    hightile \
58
    textfont \
59
    smalltextfont \
60
    kplib \
61
    lz4 \
62
    osd \
63
    pragmas \
64
    scriptfile \
65
    mmulti_null \
66
    mutex \
67
    xxhash \
68
    md4 \
69
    colmatch \
5792 terminx 70
    screenshot \
6056 hendricks2 71
    mhk \
5754 hendricks2 72
 
73
ENGINE_EDITOR_OBJS = \
74
    build \
75
    config \
76
    defs \
77
 
4543 hendricks2 78
ifeq (0,$(NOASM))
79
  ENGINE_OBJS+= a
80
else
81
  ENGINE_OBJS+= a-c
82
  ifneq (0,$(USE_ASM64))
83
    ENGINE_OBJS+= a64
84
  endif
85
endif
86
ifeq (1,$(USE_OPENGL))
4639 terminx 87
    ENGINE_OBJS+= glbuild voxmodel mdsprite
4543 hendricks2 88
    ifeq (1,$(POLYMER))
89
        ENGINE_OBJS+= polymer
90
    endif
91
endif
4591 helixhorne 92
ifneq (0,$(LUNATIC))
4543 hendricks2 93
    ENGINE_OBJS+= lunatic
94
endif
95
ifeq ($(PLATFORM),DARWIN)
96
    ENGINE_OBJS += osxbits
5941 hendricks2 97
    ifeq ($(STARTUP_WINDOW),1)
4543 hendricks2 98
        ENGINE_EDITOR_OBJS += startosx.editor
99
    endif
5691 hendricks2 100
    ifeq ($(SDL_TARGET),1)
5778 hendricks2 101
        ifneq ($(SDL_FRAMEWORK),0)
5691 hendricks2 102
            ENGINE_OBJS+=SDLMain
103
        endif
4543 hendricks2 104
    endif
105
endif
106
ifeq ($(PLATFORM),WINDOWS)
107
    ENGINE_OBJS+= winbits
5943 hendricks2 108
    ifeq ($(STARTUP_WINDOW),1)
109
        ENGINE_EDITOR_OBJS+= startwin.editor
110
    endif
4543 hendricks2 111
endif
4820 hendricks2 112
ifeq ($(PLATFORM),WII)
113
    ENGINE_OBJS+= wiibits
4821 hendricks2 114
    LINKERFLAGS+= -Wl,-wrap,c_default_exceptionhandler
4820 hendricks2 115
endif
4543 hendricks2 116
ifeq ($(RENDERTYPE),SDL)
117
    ENGINE_OBJS+= sdlayer
118
 
119
    ifeq (1,$(HAVE_GTK2))
120
        ENGINE_OBJS+= gtkbits
121
        ifeq ($(LINKED_GTK),0)
122
            ENGINE_OBJS+= dynamicgtk
123
        endif
5942 hendricks2 124
        ifeq ($(STARTUP_WINDOW),1)
125
            ENGINE_EDITOR_OBJS+= startgtk.editor
126
        endif
4543 hendricks2 127
    endif
128
endif
129
ifeq ($(RENDERTYPE),WIN)
130
    ENGINE_OBJS+= winlayer rawinput
131
endif
132
 
6056 hendricks2 133
ifneq ($(USE_LIBVPX),0)
134
    ENGINE_OBJS+= animvpx
135
endif
136
 
4543 hendricks2 137
ENGINE_OBJS_EXP:=$(addprefix $(ENGINE_OBJ)/,$(addsuffix .$o,$(ENGINE_OBJS)))
138
ENGINE_EDITOR_OBJS_EXP:=$(addprefix $(ENGINE_OBJ)/,$(addsuffix .$o,$(ENGINE_EDITOR_OBJS)))
139
 
140
 
4555 hendricks2 141
# MACT
142
 
5747 hendricks2 143
MACT=mact
144
 
6056 hendricks2 145
MACT_ROOT=$(source)/$(MACT)
146
MACT_SRC=$(MACT_ROOT)/src
147
MACT_INC=$(MACT_ROOT)/include
5748 hendricks2 148
MACT_OBJ=$(obj)/$(MACT)
4555 hendricks2 149
 
5754 hendricks2 150
MACT_OBJS = \
151
    file_lib \
152
    control \
153
    keyboard \
154
    joystick \
155
    scriplib \
156
    animlib \
4555 hendricks2 157
 
5197 hendricks2 158
MACT_OBJS_EXP:=$(addprefix $(MACT_OBJ)/,$(addsuffix .$o,$(MACT_OBJS)))
159
 
160
 
4543 hendricks2 161
# AudioLib
162
 
5747 hendricks2 163
AUDIOLIB=audiolib
164
 
5754 hendricks2 165
AUDIOLIB_OBJS = \
166
    drivers \
167
    fx_man \
168
    multivoc \
169
    mix \
170
    mixst \
171
    pitch \
172
    formats \
173
    vorbis \
174
    flac \
175
    xa \
5927 hendricks2 176
    xmp \
5754 hendricks2 177
    driver_nosound \
4543 hendricks2 178
 
6056 hendricks2 179
AUDIOLIB_ROOT=$(source)/$(AUDIOLIB)
4543 hendricks2 180
AUDIOLIB_SRC=$(AUDIOLIB_ROOT)/src
181
AUDIOLIB_INC=$(AUDIOLIB_ROOT)/include
5748 hendricks2 182
AUDIOLIB_OBJ=$(obj)/$(AUDIOLIB)
4543 hendricks2 183
 
184
ifeq ($(PLATFORM),WINDOWS)
185
    ifeq ($(MIXERTYPE),WIN)
186
        AUDIOLIB_OBJS+= driver_directsound
187
    endif
188
endif
189
 
190
ifeq ($(MIXERTYPE),SDL)
191
    ifneq ($(PLATFORM),DARWIN)
192
        ifneq ($(PLATFORM),WINDOWS)
193
            ifneq ($(PLATFORM),WII)
5780 hendricks2 194
                AUDIOLIB_CFLAGS+=`$(PKG_CONFIG) --cflags vorbis`
4543 hendricks2 195
            endif
196
        endif
197
    endif
198
    AUDIOLIB_OBJS+= driver_sdl
199
endif
200
 
201
AUDIOLIB_OBJS_EXP:=$(addprefix $(AUDIOLIB_OBJ)/,$(addsuffix .$o,$(AUDIOLIB_OBJS)))
202
 
203
 
204
# ENet
205
 
5747 hendricks2 206
ENET=enet
207
 
5754 hendricks2 208
ENET_OBJS = \
209
    callbacks \
210
    host \
211
    list \
212
    packet \
213
    peer \
214
    protocol \
215
    compress \
4543 hendricks2 216
 
6056 hendricks2 217
ENET_ROOT=$(source)/$(ENET)
4543 hendricks2 218
ENET_SRC=$(ENET_ROOT)/src
219
ENET_INC=$(ENET_ROOT)/include
5748 hendricks2 220
ENET_OBJ=$(obj)/$(ENET)
4553 hendricks2 221
 
4543 hendricks2 222
ENET_CFLAGS=
223
 
224
ifeq ($(PLATFORM),WINDOWS)
225
    ENET_OBJS += win32
226
else
227
    ENET_OBJS += unix
228
    ENET_CFLAGS += -DHAS_SOCKLEN_T
229
endif
230
 
231
ENET_OBJS_EXP:=$(addprefix $(ENET_OBJ)/,$(addsuffix .$o,$(ENET_OBJS)))
232
 
4555 hendricks2 233
ifeq ($(NETCODE),0)
234
    ENET_TARGET=
235
else
236
    ENET_TARGET=$(ENET_OBJS_EXP)
237
endif
4543 hendricks2 238
 
4555 hendricks2 239
 
4543 hendricks2 240
# Tools
241
 
6056 hendricks2 242
TOOLS=tools
243
 
244
TOOLS_OBJS = \
245
    compat_tools \
246
 
247
ENGINE_TOOLS_OBJS = \
5754 hendricks2 248
    compat \
249
    pragmas \
250
    kplib \
251
    cache1d \
252
    crc32 \
253
    colmatch \
4543 hendricks2 254
 
6056 hendricks2 255
TOOLS_ROOT=$(source)/$(TOOLS)
256
TOOLS_SRC=$(TOOLS_ROOT)/src
257
TOOLS_OBJ=$(obj)/$(TOOLS)
258
 
259
TOOLS_TARGETS= \
5754 hendricks2 260
    kextract \
261
    kgroup \
262
    transpal \
263
    wad2art \
264
    wad2map \
265
    kmd2tool \
266
    md2tool \
267
    generateicon \
268
    cacheinfo \
269
    arttool \
270
    givedepth \
271
    mkpalette \
272
    unpackssi \
273
    bsuite \
6056 hendricks2 274
    ivfrate \
6039 hendricks2 275
    map2stl \
5754 hendricks2 276
 
6056 hendricks2 277
DXTOOLS_TARGETS= \
5754 hendricks2 278
    enumdisplay \
279
    getdxdidf \
280
 
6056 hendricks2 281
SDLTOOLS_TARGETS= \
5754 hendricks2 282
    makesdlkeytrans \
283
 
5361 hendricks2 284
ifeq ($(PLATFORM),DARWIN)
6056 hendricks2 285
    TOOLS_OBJS += osxbits
5361 hendricks2 286
endif
287
 
6056 hendricks2 288
TOOLS_OBJS_EXP:=$(addprefix $(TOOLS_OBJ)/,$(addsuffix .$o,$(TOOLS_OBJS))) $(addprefix $(ENGINE_OBJ)/,$(addsuffix .$o,$(ENGINE_TOOLS_OBJS)))
4543 hendricks2 289
 
290
 
4555 hendricks2 291
# KenBuild (Test Game)
4543 hendricks2 292
 
5747 hendricks2 293
KENBUILD=kenbuild
294
 
6056 hendricks2 295
KENBUILD_ROOT=$(source)/$(KENBUILD)
5745 hendricks2 296
KENBUILD_SRC=$(KENBUILD_ROOT)/src
297
KENBUILD_RSRC=$(KENBUILD_ROOT)/rsrc
5748 hendricks2 298
KENBUILD_OBJ=$(obj)/$(KENBUILD)
4555 hendricks2 299
 
5745 hendricks2 300
KENBUILD_CFLAGS=-I$(KENBUILD_SRC)
4555 hendricks2 301
 
6058 hendricks2 302
KENBUILD_GAME ?= ekenbuild
303
KENBUILD_EDITOR ?= ekenbuild-editor
4555 hendricks2 304
 
6058 hendricks2 305
KENBUILD_GAME_PROPER ?= EKenBuild
306
KENBUILD_EDITOR_PROPER ?= EKenBuild Editor
5746 hendricks2 307
 
5754 hendricks2 308
KENBUILD_GAME_OBJS = \
309
    game \
310
    sound_stub \
311
    common \
312
    config \
4555 hendricks2 313
 
5754 hendricks2 314
KENBUILD_EDITOR_OBJS = \
315
    bstub \
316
    common \
317
 
4555 hendricks2 318
ifeq ($(RENDERTYPE),SDL)
5744 hendricks2 319
    ifeq (1,$(HAVE_GTK2))
5745 hendricks2 320
        KENBUILD_GAME_OBJS+= game_banner startgtk.game
321
        KENBUILD_EDITOR_OBJS+= build_banner
5744 hendricks2 322
    endif
4555 hendricks2 323
 
5745 hendricks2 324
    KENBUILD_GAME_OBJS+= game_icon
325
    KENBUILD_EDITOR_OBJS+= build_icon
5 Plagman 326
endif
4555 hendricks2 327
ifeq ($(PLATFORM),WINDOWS)
5745 hendricks2 328
    KENBUILD_GAME_OBJS+= gameres startwin.game
329
    KENBUILD_EDITOR_OBJS+= buildres
4555 hendricks2 330
endif
5 Plagman 331
 
5740 hendricks2 332
ifeq ($(PLATFORM),DARWIN)
5941 hendricks2 333
    ifeq ($(STARTUP_WINDOW),1)
5745 hendricks2 334
        KENBUILD_GAME_OBJS += StartupWinController.game
5740 hendricks2 335
    endif
336
endif
337
 
5745 hendricks2 338
KENBUILD_GAME_OBJS_EXP:=$(addprefix $(KENBUILD_OBJ)/,$(addsuffix .$o,$(KENBUILD_GAME_OBJS)))
339
KENBUILD_EDITOR_OBJS_EXP:=$(addprefix $(KENBUILD_OBJ)/,$(addsuffix .$o,$(KENBUILD_EDITOR_OBJS)))
1739 helixhorne 340
 
4555 hendricks2 341
 
342
# Duke Nukem 3D
343
 
5747 hendricks2 344
DUKE3D=duke3d
345
 
6056 hendricks2 346
DUKE3D_CFLAGS=-I$(DUKE3D_SRC)
4555 hendricks2 347
 
5745 hendricks2 348
DUKE3D_GAME_LDFLAGS=
349
DUKE3D_EDITOR_LDFLAGS=
1739 helixhorne 350
 
5749 hendricks2 351
DUKE3D_GAME_STRIPFLAGS=
352
DUKE3D_EDITOR_STRIPFLAGS=
353
 
5748 hendricks2 354
DUKE3D_OBJ=$(obj)/$(DUKE3D)
3219 hendricks2 355
 
5745 hendricks2 356
DUKE3D_GAME ?= eduke32
357
DUKE3D_EDITOR ?= mapster32
3096 hendricks2 358
 
5746 hendricks2 359
DUKE3D_GAME_PROPER ?= EDuke32
360
DUKE3D_EDITOR_PROPER ?= Mapster32
361
 
5754 hendricks2 362
COMMON_EDITOR_OBJS = \
363
    m32common \
364
    m32def \
365
    m32exec \
366
    m32vars \
5 Plagman 367
 
5754 hendricks2 368
DUKE3D_GAME_OBJS = \
369
    game \
370
    global \
371
    actors \
372
    gamedef \
373
    gameexec \
374
    gamevars \
375
    player \
376
    premap \
377
    sector \
378
    anim \
379
    animsounds \
380
    common \
381
    config \
382
    demo \
383
    input \
384
    menus \
385
    namesdyn \
386
    net \
387
    savegame \
388
    rts \
389
    osdfuncs \
390
    osdcmds \
391
    grpscan \
392
    sounds \
393
    soundsdyn \
394
    cheats \
395
    sbar \
396
    screentext \
397
    screens \
398
    cmdline \
399
 
400
DUKE3D_EDITOR_OBJS = \
401
    astub \
402
    common \
403
    grpscan \
404
    sounds_mapster32 \
405
 
5745 hendricks2 406
DUKE3D_GAME_MISCDEPS=
4543 hendricks2 407
DUKE3D_EDITOR_MISCDEPS=
2143 helixhorne 408
 
4591 helixhorne 409
# Lunatic object base names. These are not used in targets directly.
5754 hendricks2 410
LUNATIC_OBJS = \
411
    luaJIT_BC_defs_common \
412
    luaJIT_BC_engine_maptext \
413
    luaJIT_BC_engine \
414
    luaJIT_BC_bcarray \
415
    luaJIT_BC_bcheck \
416
    luaJIT_BC_bitar \
417
    luaJIT_BC_xmath \
418
    luaJIT_BC_v \
419
    luaJIT_BC_dump \
420
    luaJIT_BC_dis_x86 \
421
    luaJIT_BC_dis_x64 \
2148 helixhorne 422
 
5754 hendricks2 423
LUNATIC_GAME_OBJS = \
6056 hendricks2 424
    luaJIT_BC__defs_game \
5754 hendricks2 425
    luaJIT_BC_con_lang \
426
    luaJIT_BC_lunacon \
427
    luaJIT_BC_randgen \
428
    luaJIT_BC_stat \
429
    luaJIT_BC_control \
430
    luaJIT_BC_savegame \
431
    luaJIT_BC_fs \
432
 
2143 helixhorne 433
## Lunatic devel
2034 helixhorne 434
ifneq (0,$(LUNATIC))
4237 helixhorne 435
    # TODO: remove debugging modules from release build
436
 
6056 hendricks2 437
    DUKE3D_EDITOR_OBJS+= lunatic_editor $(LUNATIC_OBJS)
5745 hendricks2 438
    DUKE3D_GAME_OBJS+= lunatic_game $(LUNATIC_OBJS)
2143 helixhorne 439
 
6056 hendricks2 440
    DUKE3D_EDITOR_OBJS+= luaJIT_BC__defs_editor
4237 helixhorne 441
 
3938 helixhorne 442
    ifneq ($(PLATFORM),WINDOWS)
443
        # On non-Windows, we expect to have liblpeg.a (or a symlink to it) in source/.
4319 hendricks2 444
        # On Windows, it will reside in platform/Windows/lib/32/ or lib/64/.
6056 hendricks2 445
        LIBDIRS+= -L$(source)
446
        ifeq ($(realpath $(source)/liblpeg.a),)
3938 helixhorne 447
            # XXX: This cripples "make clean" etc. too, but IMO it's better than warning.
6056 hendricks2 448
            $(error "liblpeg.a not found in $(realpath $(source))")
3938 helixhorne 449
        endif
450
    endif
451
    LIBS+= -llpeg
5745 hendricks2 452
    DUKE3D_GAME_OBJS+= $(LUNATIC_GAME_OBJS)
2650 helixhorne 453
 
2143 helixhorne 454
    # now, take care of having the necessary symbols (sector, wall, etc.) in the
455
    # executable no matter what the debugging level
456
 
2074 helixhorne 457
    ifeq ($(PLATFORM),DARWIN)
2143 helixhorne 458
        # strip on OSX says: removing global symbols from a final linked no longer supported.
459
        #                    Use -exported_symbols_list at link time when building
460
        # But, following _their_ directions does not give us the symbols! wtf?
6056 hendricks2 461
        # Instead of using -alias_list and -exported_symbols_list, prevent stripping them.
462
        DUKE3D_GAME_STRIPFLAGS+= -s $(DUKE3D_OBJ)/lunatic_dynsymlist_game_osx
463
        DUKE3D_EDITOR_STRIPFLAGS+= -s $(DUKE3D_OBJ)/lunatic_dynsymlist_editor_osx
2143 helixhorne 464
 
6056 hendricks2 465
        DUKE3D_GAME_MISCDEPS+= $(DUKE3D_OBJ)/lunatic_dynsymlist_game_osx
466
        DUKE3D_EDITOR_MISCDEPS+= $(DUKE3D_OBJ)/lunatic_dynsymlist_editor_osx
5749 hendricks2 467
        LINKERFLAGS+= -pagezero_size 10000 -image_base 100000000
2143 helixhorne 468
    endif
469
    ifeq ($(PLATFORM),WINDOWS)
3423 helixhorne 470
        override STRIP=
6056 hendricks2 471
        DUKE3D_GAME_MISCDEPS+= $(DUKE3D_OBJ)/lunatic_dynsymlist_game.def
472
        DUKE3D_EDITOR_MISCDEPS+= $(DUKE3D_OBJ)/lunatic_dynsymlist_editor.def
2143 helixhorne 473
    endif
3272 hendricks2 474
    ifeq ($(SUBPLATFORM),LINUX)
3423 helixhorne 475
        override STRIP=
6056 hendricks2 476
        DUKE3D_GAME_LDFLAGS+= -Wl,--dynamic-list=$(DUKE3D_SRC)/lunatic/dynsymlist_game.lds
477
        DUKE3D_EDITOR_LDFLAGS+= -Wl,--dynamic-list=$(DUKE3D_SRC)/lunatic/dynsymlist_editor.lds
2074 helixhorne 478
    endif
2034 helixhorne 479
endif
480
 
3272 hendricks2 481
ifeq ($(SUBPLATFORM),LINUX)
5927 hendricks2 482
    ifneq (0,$(HAVE_XMP))
483
        LIBS += -lxmp-lite
484
    endif
5037 hendricks2 485
    LIBS += -lFLAC -lvorbisfile -lvorbis -logg
996 terminx 486
endif
487
 
5037 hendricks2 488
ifeq ($(PLATFORM),BSD)
5927 hendricks2 489
    ifneq (0,$(HAVE_XMP))
490
        LIBS += -lxmp-lite
491
    endif
5037 hendricks2 492
    LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lexecinfo
493
endif
494
 
996 terminx 495
ifeq ($(PLATFORM),DARWIN)
5927 hendricks2 496
    ifneq (0,$(HAVE_XMP))
497
        LIBS += -lxmp-lite
498
    endif
4543 hendricks2 499
    LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lm \
500
            -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,OpenGL \
5078 terminx 501
            -Wl,-framework,CoreMIDI -Wl,-framework,AudioUnit \
4548 hendricks2 502
            -Wl,-framework,AudioToolbox -Wl,-framework,IOKit -Wl,-framework,AGL
503
    ifneq (00,$(DARWIN9)$(DARWIN10))
504
        LIBS += -Wl,-framework,QuickTime -lm
505
    endif
2537 hendricks2 506
 
5941 hendricks2 507
    ifeq ($(STARTUP_WINDOW),1)
5745 hendricks2 508
        DUKE3D_GAME_OBJS += GrpFile.game GameListSource.game startosx.game
2426 hendricks2 509
    endif
996 terminx 510
endif
511
 
5 Plagman 512
ifeq ($(PLATFORM),WINDOWS)
5927 hendricks2 513
    ifneq (0,$(HAVE_XMP))
514
        LIBS += -lxmp-lite
515
    endif
5341 hendricks2 516
    LIBS += -lFLAC -lvorbisfile -lvorbis -logg
5943 hendricks2 517
    DUKE3D_GAME_OBJS+= gameres winbits
518
    DUKE3D_EDITOR_OBJS+= buildres
5928 terminx 519
    ifeq ($(STARTUP_WINDOW),1)
5943 hendricks2 520
        DUKE3D_GAME_OBJS+= startwin.game
5928 terminx 521
    endif
4084 hendricks2 522
    ifeq ($(MIXERTYPE),WIN)
3219 hendricks2 523
        LIBS+= -ldsound
5213 hendricks2 524
        MIDI_OBJS=music midi mpu401
3219 hendricks2 525
    endif
526
endif
4543 hendricks2 527
 
528
ifeq ($(PLATFORM),WII)
529
    LIBS += -lvorbisidec
530
endif
531
 
3219 hendricks2 532
ifeq ($(RENDERTYPE),SDL)
5942 hendricks2 533
    ifeq (11,$(HAVE_GTK2)$(STARTUP_WINDOW))
5745 hendricks2 534
        DUKE3D_GAME_OBJS+= game_banner startgtk.game
4770 hendricks2 535
        DUKE3D_EDITOR_OBJS+= build_banner
4084 hendricks2 536
    endif
537
 
5745 hendricks2 538
    DUKE3D_GAME_OBJS+= game_icon
5253 hendricks2 539
    DUKE3D_EDITOR_OBJS+= build_icon
4084 hendricks2 540
endif
541
ifeq ($(MIXERTYPE),SDL)
5213 hendricks2 542
    MIDI_OBJS=sdlmusic
5 Plagman 543
endif
544
 
4591 helixhorne 545
## Construct file names of object files
1473 terminx 546
 
4555 hendricks2 547
COMMON_EDITOR_OBJS_EXP:=$(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(COMMON_EDITOR_OBJS)))
548
 
5213 hendricks2 549
MIDI_OBJS_EXP:=$(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(MIDI_OBJS)))
550
 
5745 hendricks2 551
DUKE3D_GAME_OBJS_EXP:=$(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(DUKE3D_GAME_OBJS)))
4543 hendricks2 552
DUKE3D_EDITOR_OBJS_EXP:=$(addprefix $(DUKE3D_OBJ)/,$(addsuffix .$o,$(DUKE3D_EDITOR_OBJS)))
5 Plagman 553
 
1595 helixhorne 554
 
5197 hendricks2 555
# Shadow Warrior
556
 
5747 hendricks2 557
SW=sw
558
 
6056 hendricks2 559
SW_ROOT=$(source)/$(SW)
5197 hendricks2 560
SW_SRC=$(SW_ROOT)/src
561
SW_RSRC=$(SW_ROOT)/rsrc
5748 hendricks2 562
SW_OBJ=$(obj)/$(SW)
5197 hendricks2 563
 
6056 hendricks2 564
SW_CFLAGS=-I$(SW_SRC)
5197 hendricks2 565
 
5745 hendricks2 566
SW_GAME ?= voidsw
5197 hendricks2 567
SW_EDITOR ?= voidsw-editor
568
 
5746 hendricks2 569
SW_GAME_PROPER ?= VoidSW
570
SW_EDITOR_PROPER ?= VoidSW Editor
571
 
5754 hendricks2 572
SW_GAME_OBJS = \
573
    actor \
574
    ai \
575
    anim \
576
    border \
577
    break \
578
    bunny \
579
    cache \
580
    cheats \
581
    colormap \
582
    common \
583
    config \
584
    console \
585
    coolg \
586
    coolie \
587
    copysect \
588
    demo \
589
    draw \
590
    eel \
591
    game \
592
    girlninj \
593
    goro \
594
    grpscan \
595
    hornet \
596
    interp \
597
    interpsh \
598
    inv \
599
    jplayer \
600
    jsector \
601
    jweapon \
602
    lava \
603
    light \
604
    mclip \
605
    mdastr \
606
    menus \
607
    miscactr \
608
    morph \
609
    net \
610
    ninja \
611
    panel \
612
    player \
613
    predict \
614
    quake \
615
    ripper \
616
    ripper2 \
617
    rooms \
618
    rotator \
619
    rts \
620
    save \
621
    scrip2 \
622
    sector \
623
    serp \
624
    setup \
625
    skel \
626
    skull \
627
    slidor \
628
    sounds \
629
    spike \
630
    sprite \
631
    sumo \
632
    swconfig \
633
    sync \
634
    text \
635
    track \
636
    vator \
637
    vis \
638
    wallmove \
639
    warp \
640
    weapon \
641
    zilla \
642
    zombie \
643
    saveable \
5197 hendricks2 644
 
5754 hendricks2 645
SW_EDITOR_OBJS = \
646
    jnstub \
647
    brooms \
648
    bldscript \
649
    jbhlp \
650
    colormap \
651
    grpscan \
652
    common \
653
 
5197 hendricks2 654
ifeq ($(RENDERTYPE),SDL)
655
    ifeq (1,$(HAVE_GTK2))
5745 hendricks2 656
        SW_GAME_OBJS+= game_banner startgtk.game
5197 hendricks2 657
        SW_EDITOR_OBJS+= build_banner
658
    endif
659
 
5745 hendricks2 660
    SW_GAME_OBJS+= game_icon
5197 hendricks2 661
    SW_EDITOR_OBJS+= game_icon
662
endif
663
ifeq ($(PLATFORM),WINDOWS)
5745 hendricks2 664
    SW_GAME_OBJS+= gameres startwin.game
5744 hendricks2 665
    SW_EDITOR_OBJS+= buildres
5197 hendricks2 666
endif
667
 
5745 hendricks2 668
SW_GAME_OBJS_EXP:=$(addprefix $(SW_OBJ)/,$(addsuffix .$o,$(SW_GAME_OBJS)))
5197 hendricks2 669
SW_EDITOR_OBJS_EXP:=$(addprefix $(SW_OBJ)/,$(addsuffix .$o,$(SW_EDITOR_OBJS)))
670
 
671
 
1103 terminx 672
ifeq ($(PRETTY_OUTPUT),1)
1101 terminx 673
.SILENT:
1103 terminx 674
endif
6056 hendricks2 675
.PHONY: all duke3d test kenbuild sw veryclean clean cleanduke3d cleantest cleansw cleanutils utils dxutils sdlutils printutils printsdlutils printdxutils cleantools tools dxtools sdltools printtools printsdltools printdxtools rev $(ENGINE_OBJ)/rev.$o
6052 hendricks2 676
.SUFFIXES:
5 Plagman 677
 
678
# TARGETS
679
 
5197 hendricks2 680
all: duke3d
681
 
5745 hendricks2 682
duke3d: start $(DUKE3D_GAME)$(EXESUFFIX) $(DUKE3D_EDITOR)$(EXESUFFIX)
683
	@ls -l $(DUKE3D_GAME)$(EXESUFFIX)
684
	@ls -l $(DUKE3D_EDITOR)$(EXESUFFIX)
3236 hendricks2 685
 
6056 hendricks2 686
kenbuild: start $(KENBUILD_GAME)$(EXESUFFIX) $(KENBUILD_EDITOR)$(EXESUFFIX)
5745 hendricks2 687
	@ls -l $(KENBUILD_GAME)$(EXESUFFIX)
688
	@ls -l $(KENBUILD_EDITOR)$(EXESUFFIX)
4555 hendricks2 689
 
5745 hendricks2 690
sw: start $(SW_GAME)$(EXESUFFIX) $(SW_EDITOR)$(EXESUFFIX)
691
	@ls -l $(SW_GAME)$(EXESUFFIX)
5197 hendricks2 692
	@ls -l $(SW_EDITOR)$(EXESUFFIX)
693
 
5742 hendricks2 694
ebacktrace: start $(EBACKTRACEDLL)
3163 hendricks2 695
	@ls -l $(EBACKTRACEDLL)
1101 terminx 696
 
3163 hendricks2 697
start:
1102 terminx 698
	$(BUILD_STARTED)
1595 helixhorne 699
 
6056 hendricks2 700
tools: $(addsuffix $(EXESUFFIX),$(TOOLS_TARGETS))
4543 hendricks2 701
	@ls -l $^
3163 hendricks2 702
 
6056 hendricks2 703
dxtools: $(addsuffix $(EXESUFFIX),$(DXTOOLS_TARGETS))
4543 hendricks2 704
	@ls -l $^
705
 
6056 hendricks2 706
sdltools: $(addsuffix $(EXESUFFIX),$(SDLTOOLS_TARGETS))
4543 hendricks2 707
	@ls -l $^
708
 
4824 hendricks2 709
ifeq ($(PLATFORM),WII)
710
ifneq ($(ELF2DOL),)
5745 hendricks2 711
$(KENBUILD_GAME)$(DOLSUFFIX): $(KENBUILD_GAME)$(EXESUFFIX)
712
$(KENBUILD_EDITOR)$(DOLSUFFIX): $(KENBUILD_EDITOR)$(EXESUFFIX)
713
$(DUKE3D_GAME)$(DOLSUFFIX): $(DUKE3D_GAME)$(EXESUFFIX)
714
$(DUKE3D_EDITOR)$(DOLSUFFIX): $(DUKE3D_EDITOR)$(EXESUFFIX)
715
$(SW_GAME)$(DOLSUFFIX): $(SW_GAME)$(EXESUFFIX)
5197 hendricks2 716
$(SW_EDITOR)$(DOLSUFFIX): $(SW_EDITOR)$(EXESUFFIX)
4824 hendricks2 717
endif
718
endif
719
 
6056 hendricks2 720
$(KENBUILD_GAME)$(EXESUFFIX): $(KENBUILD_GAME_OBJS_EXP) $(ENGINE_OBJS_EXP)
1102 terminx 721
	$(LINK_STATUS)
5751 hendricks2 722
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(GUI_LIBS) $(LIBDIRS) $(LIBS) $(RECIPE_RESULT_LINK)
4824 hendricks2 723
ifeq ($(PLATFORM),WII)
724
ifneq ($(ELF2DOL),)
5745 hendricks2 725
	$(ELF2DOL) $(KENBUILD_GAME)$(EXESUFFIX) $(KENBUILD_GAME)$(DOLSUFFIX)
4824 hendricks2 726
endif
727
endif
4555 hendricks2 728
ifneq ($(STRIP),)
5197 hendricks2 729
	$(STRIP) $@
4555 hendricks2 730
endif
731
 
5745 hendricks2 732
$(KENBUILD_EDITOR)$(EXESUFFIX): $(KENBUILD_EDITOR_OBJS_EXP) $(COMMON_EDITOR_OBJS_EXP) $(ENGINE_EDITOR_OBJS_EXP) $(ENGINE_OBJS_EXP)
4555 hendricks2 733
	$(LINK_STATUS)
5751 hendricks2 734
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(GUI_LIBS) $(LIBDIRS) $(LIBS) $(RECIPE_RESULT_LINK)
4824 hendricks2 735
ifeq ($(PLATFORM),WII)
736
ifneq ($(ELF2DOL),)
5745 hendricks2 737
	$(ELF2DOL) $(KENBUILD_EDITOR)$(EXESUFFIX) $(KENBUILD_EDITOR)$(DOLSUFFIX)
4824 hendricks2 738
endif
739
endif
4555 hendricks2 740
ifneq ($(STRIP),)
5197 hendricks2 741
	$(STRIP) $@
4555 hendricks2 742
endif
743
 
6056 hendricks2 744
$(DUKE3D_GAME)$(EXESUFFIX): $(DUKE3D_GAME_OBJS_EXP) $(MIDI_OBJS_EXP) $(ENGINE_OBJS_EXP) $(MACT_OBJS_EXP) $(AUDIOLIB_OBJS_EXP) $(ENET_TARGET) $(DUKE3D_GAME_MISCDEPS)
4555 hendricks2 745
	$(LINK_STATUS)
5751 hendricks2 746
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(GUI_LIBS) $(DUKE3D_GAME_LDFLAGS) $(LIBDIRS) $(LIBS) $(RECIPE_RESULT_LINK)
4824 hendricks2 747
ifeq ($(PLATFORM),WII)
748
ifneq ($(ELF2DOL),)
5745 hendricks2 749
	$(ELF2DOL) $(DUKE3D_GAME)$(EXESUFFIX) $(DUKE3D_GAME)$(DOLSUFFIX)
4824 hendricks2 750
endif
751
endif
3422 helixhorne 752
ifneq ($(STRIP),)
5749 hendricks2 753
	$(STRIP) $@ $(DUKE3D_GAME_STRIPFLAGS)
1101 terminx 754
endif
2385 hendricks2 755
ifeq ($(PLATFORM),DARWIN)
5746 hendricks2 756
	cp -RPf "platform/Apple/bundles/$(DUKE3D_GAME_PROPER).app" "./"
757
	mkdir -p "$(DUKE3D_GAME_PROPER).app/Contents/MacOS"
758
	cp -f "$(DUKE3D_GAME)$(EXESUFFIX)" "$(DUKE3D_GAME_PROPER).app/Contents/MacOS/"
2385 hendricks2 759
endif
1595 helixhorne 760
 
5745 hendricks2 761
$(DUKE3D_EDITOR)$(EXESUFFIX): $(DUKE3D_EDITOR_OBJS_EXP) $(COMMON_EDITOR_OBJS_EXP) $(ENGINE_EDITOR_OBJS_EXP) $(ENGINE_OBJS_EXP) $(AUDIOLIB_OBJS_EXP) $(DUKE3D_EDITOR_MISCDEPS)
1102 terminx 762
	$(LINK_STATUS)
5751 hendricks2 763
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(GUI_LIBS) $(DUKE3D_EDITOR_LDFLAGS) $(LIBDIRS) $(LIBS) $(RECIPE_RESULT_LINK)
4824 hendricks2 764
ifeq ($(PLATFORM),WII)
765
ifneq ($(ELF2DOL),)
5745 hendricks2 766
	$(ELF2DOL) $(DUKE3D_EDITOR)$(EXESUFFIX) $(DUKE3D_EDITOR)$(DOLSUFFIX)
4824 hendricks2 767
endif
768
endif
3422 helixhorne 769
ifneq ($(STRIP),)
5749 hendricks2 770
	$(STRIP) $@ $(DUKE3D_EDITOR_STRIPFLAGS)
1693 helixhorne 771
endif
2385 hendricks2 772
ifeq ($(PLATFORM),DARWIN)
5746 hendricks2 773
	cp -RPf "platform/Apple/bundles/$(DUKE3D_EDITOR_PROPER).app" "./"
774
	mkdir -p "$(DUKE3D_EDITOR_PROPER).app/Contents/MacOS"
775
	cp -f "$(DUKE3D_EDITOR)$(EXESUFFIX)" "$(DUKE3D_EDITOR_PROPER).app/Contents/MacOS/"
2385 hendricks2 776
endif
5 Plagman 777
 
6056 hendricks2 778
$(SW_GAME)$(EXESUFFIX): $(SW_GAME_OBJS_EXP) $(MIDI_OBJS_EXP) $(ENGINE_OBJS_EXP) $(MACT_OBJS_EXP) $(AUDIOLIB_OBJS_EXP)
5197 hendricks2 779
	$(LINK_STATUS)
5751 hendricks2 780
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(GUI_LIBS) $(LIBDIRS) $(LIBS) $(RECIPE_RESULT_LINK)
5197 hendricks2 781
ifeq ($(PLATFORM),WII)
782
ifneq ($(ELF2DOL),)
5745 hendricks2 783
	$(ELF2DOL) $(SW_GAME)$(EXESUFFIX) $(SW_GAME)$(DOLSUFFIX)
5197 hendricks2 784
endif
785
endif
786
ifneq ($(STRIP),)
787
	$(STRIP) $@
788
endif
789
 
790
$(SW_EDITOR)$(EXESUFFIX): $(SW_EDITOR_OBJS_EXP) $(COMMON_EDITOR_OBJS_EXP) $(ENGINE_EDITOR_OBJS_EXP) $(ENGINE_OBJS_EXP)
791
	$(LINK_STATUS)
5751 hendricks2 792
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(GUI_LIBS) $(LIBDIRS) $(LIBS) $(RECIPE_RESULT_LINK)
5197 hendricks2 793
ifeq ($(PLATFORM),WII)
794
ifneq ($(ELF2DOL),)
795
	$(ELF2DOL) $(SW_EDITOR)$(EXESUFFIX) $(SW_EDITOR)$(DOLSUFFIX)
796
endif
797
endif
798
ifneq ($(STRIP),)
799
	$(STRIP) $@
800
endif
801
 
6056 hendricks2 802
include $(ENGINE_ROOT)/Dependencies.mak
803
include $(DUKE3D_ROOT)/Dependencies.mak
804
include $(SW_ROOT)/Dependencies.mak
5 Plagman 805
 
806
# RULES
3057 helixhorne 807
 
3551 terminx 808
$(EBACKTRACEDLL): platform/Windows/src/backtrace.c
3163 hendricks2 809
	$(COMPILE_STATUS)
4543 hendricks2 810
	$(RECIPE_IF) $(CC) $(CONLYFLAGS) -O2 -ggdb -shared -Wall -Wextra -static-libgcc -I$(ENGINE_INC) -o $@ $^ -lbfd -liberty -limagehlp $(RECIPE_RESULT_COMPILE)
2037 helixhorne 811
 
6056 hendricks2 812
libcache1d$(DLLSUFFIX): $(ENGINE_SRC)/cache1d.cpp
1102 terminx 813
	$(COMPILE_STATUS)
6056 hendricks2 814
	$(RECIPE_IF) $(COMPILER_C) -Wall -Wextra -DCACHE1D_COMPRESS_ONLY -shared -fPIC $< -o $@ $(RECIPE_RESULT_COMPILE)
1693 helixhorne 815
 
6056 hendricks2 816
%$(EXESUFFIX): $(TOOLS_OBJ)/%.$o $(TOOLS_OBJS_EXP)
4543 hendricks2 817
	$(ONESTEP_STATUS)
5360 hendricks2 818
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(LIBDIRS) $(LIBS) $(RECIPE_RESULT_ONESTEP)
1101 terminx 819
 
6056 hendricks2 820
enumdisplay$(EXESUFFIX): $(TOOLS_OBJ)/enumdisplay.$o
4543 hendricks2 821
	$(ONESTEP_STATUS)
5360 hendricks2 822
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(LIBDIRS) $(LIBS) -lgdi32 $(RECIPE_RESULT_ONESTEP)
6056 hendricks2 823
getdxdidf$(EXESUFFIX): $(TOOLS_OBJ)/getdxdidf.$o
4543 hendricks2 824
	$(ONESTEP_STATUS)
5360 hendricks2 825
	$(RECIPE_IF) $(LINKER) -o $@ $^ $(COMMONFLAGS) $(LINKERFLAGS) $(LIBDIRS) $(LIBS) -ldinput $(RECIPE_RESULT_ONESTEP)
4194 helixhorne 826
 
3057 helixhorne 827
#### Lunatic
828
 
2650 helixhorne 829
# Create object files directly with luajit
6056 hendricks2 830
$(DUKE3D_OBJ)/luaJIT_BC_%.$o: $(DUKE3D_SRC)/lunatic/%.lua | $(DUKE3D_OBJ)
2650 helixhorne 831
	$(COMPILE_STATUS)
4543 hendricks2 832
	$(RECIPE_IF) $(LUAJIT) -bg $(LUAJIT_BCOPTS) $< $@ $(RECIPE_RESULT_COMPILE)
2650 helixhorne 833
 
6056 hendricks2 834
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/lunatic/%.cpp | $(DUKE3D_OBJ)
2034 helixhorne 835
	$(COMPILE_STATUS)
6056 hendricks2 836
	$(RECIPE_IF) $(COMPILER_CXX) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
2034 helixhorne 837
 
3057 helixhorne 838
# List of exported symbols, OS X
6056 hendricks2 839
$(DUKE3D_OBJ)/lunatic_%_osx: $(DUKE3D_SRC)/lunatic/%.lds | $(DUKE3D_OBJ)
2074 helixhorne 840
	sed 's/[{};]//g;s/[A-Za-z_][A-Za-z_0-9]*/_&/g' $< > $@
841
 
3057 helixhorne 842
# List of exported symbols, Windows
6056 hendricks2 843
$(DUKE3D_OBJ)/lunatic_%.def: $(DUKE3D_SRC)/lunatic/%.lds | $(DUKE3D_OBJ)
2143 helixhorne 844
	echo EXPORTS > $@
845
	sed 's/[{};]//g' $< >> $@
846
 
3057 helixhorne 847
####
848
 
4553 hendricks2 849
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.nasm | $(ENGINE_OBJ)
1905 helixhorne 850
	$(COMPILE_STATUS)
4543 hendricks2 851
	$(RECIPE_IF) $(AS) $(ASFLAGS) $< -o $@ $(RECIPE_RESULT_COMPILE)
1905 helixhorne 852
 
4553 hendricks2 853
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.yasm | $(ENGINE_OBJ)
3334 hendricks2 854
	$(COMPILE_STATUS)
4543 hendricks2 855
	$(RECIPE_IF) $(AS) $(ASFLAGS) $< -o $@ $(RECIPE_RESULT_COMPILE)
3334 hendricks2 856
 
4543 hendricks2 857
# Comment out the following rule to debug a-c.o
6056 hendricks2 858
$(ENGINE_OBJ)/a-c.$o: $(ENGINE_SRC)/a-c.cpp | $(ENGINE_OBJ)
2458 hendricks2 859
	$(COMPILE_STATUS)
6056 hendricks2 860
	$(RECIPE_IF) $(COMPILER_CXX) $(subst -O$(OPTLEVEL),-O2,$(subst $(CLANG_DEBUG_FLAGS),,$(COMMONFLAGS) $(COMPILERFLAGS))) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
2458 hendricks2 861
 
4553 hendricks2 862
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.c | $(ENGINE_OBJ)
1102 terminx 863
	$(COMPILE_STATUS)
6056 hendricks2 864
	$(RECIPE_IF) $(COMPILER_C) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
1101 terminx 865
 
4553 hendricks2 866
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.cpp | $(ENGINE_OBJ)
1102 terminx 867
	$(COMPILE_STATUS)
6056 hendricks2 868
	$(RECIPE_IF) $(COMPILER_CXX) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
220 terminx 869
 
6056 hendricks2 870
$(ENGINE_OBJ)/rev.$o: $(ENGINE_SRC)/rev.cpp | $(ENGINE_OBJ)
1102 terminx 871
	$(COMPILE_STATUS)
6056 hendricks2 872
	$(RECIPE_IF) $(COMPILER_CXX) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) $(REVFLAG) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
1595 helixhorne 873
 
6056 hendricks2 874
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.mm | $(ENGINE_OBJ)
1765 plagman 875
	$(COMPILE_STATUS)
6056 hendricks2 876
	$(RECIPE_IF) $(COMPILER_OBJCXX) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
1765 plagman 877
 
6056 hendricks2 878
$(ENGINE_OBJ)/%.$o: $(ENGINE_SRC)/%.cpp | $(ENGINE_OBJ)
4543 hendricks2 879
	$(COMPILE_STATUS)
5750 hendricks2 880
	$(RECIPE_IF) $(CXX) $(CXXONLYFLAGS) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
4543 hendricks2 881
 
6056 hendricks2 882
$(TOOLS_OBJ)/%.$o: $(TOOLS_SRC)/%.cpp | $(TOOLS_OBJ)
4543 hendricks2 883
	$(COMPILE_STATUS)
6056 hendricks2 884
	$(RECIPE_IF) $(COMPILER_CXX) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENGINE_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
4543 hendricks2 885
 
6056 hendricks2 886
$(MACT_OBJ)/%.$o: $(MACT_SRC)/%.cpp | $(MACT_OBJ)
4543 hendricks2 887
	$(COMPILE_STATUS)
6056 hendricks2 888
	$(RECIPE_IF) $(COMPILER_CXX) $(COMMONFLAGS) $(COMPILERFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
4543 hendricks2 889
 
6056 hendricks2 890
$(AUDIOLIB_OBJ)/%.o: $(AUDIOLIB_SRC)/%.cpp | $(AUDIOLIB_OBJ)
5197 hendricks2 891
	$(COMPILE_STATUS)
6056 hendricks2 892
	$(RECIPE_IF) $(COMPILER_CXX) $(COMMONFLAGS) $(COMPILERFLAGS) $(AUDIOLIB_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
5197 hendricks2 893
 
4543 hendricks2 894
$(ENET_OBJ)/%.o: $(ENET_SRC)/%.c $(ENET_INC)/enet/*.h | $(ENET_OBJ)
895
	$(COMPILE_STATUS)
6056 hendricks2 896
	$(RECIPE_IF) $(COMPILER_C) $(COMMONFLAGS) $(COMPILERFLAGS) $(ENET_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
4543 hendricks2 897
 
6056 hendricks2 898
$(KENBUILD_OBJ)/%.$o: $(KENBUILD_SRC)/%.cpp | $(KENBUILD_OBJ)
4555 hendricks2 899
	$(COMPILE_STATUS)
6056 hendricks2 900
	$(RECIPE_IF) $(COMPILER_CXX) $(COMMONFLAGS) $(COMPILERFLAGS) $(KENBUILD_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
4555 hendricks2 901
 
5765 hendricks2 902
$(KENBUILD_OBJ)/%.$o: $(KENBUILD_OBJ)/%.c
903
	$(COMPILE_STATUS)
6056 hendricks2 904
	$(RECIPE_IF) $(COMPILER_C) $(COMMONFLAGS) $(COMPILERFLAGS) $(KENBUILD_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
5765 hendricks2 905
 
6056 hendricks2 906
$(KENBUILD_OBJ)/%.$o: $(KENBUILD_SRC)/%.mm | $(KENBUILD_OBJ)
5197 hendricks2 907
	$(COMPILE_STATUS)
6056 hendricks2 908
	$(RECIPE_IF) $(COMPILER_OBJCXX) $(COMMONFLAGS) $(COMPILERFLAGS) $(KENBUILD_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
5197 hendricks2 909
 
5745 hendricks2 910
$(KENBUILD_OBJ)/%.$o: $(KENBUILD_RSRC)/%.rc | $(KENBUILD_OBJ)
4555 hendricks2 911
	$(COMPILE_STATUS)
5745 hendricks2 912
	$(RECIPE_IF) $(RC) -i $< -o $@ --include-dir=$(ENGINE_INC) --include-dir=$(KENBUILD_SRC) --include-dir=$(KENBUILD_RSRC) $(RECIPE_RESULT_COMPILE)
4555 hendricks2 913
 
5745 hendricks2 914
$(KENBUILD_OBJ)/%.$o: $(KENBUILD_RSRC)/%.c | $(KENBUILD_OBJ)
4555 hendricks2 915
	$(COMPILE_STATUS)
6056 hendricks2 916
	$(RECIPE_IF) $(COMPILER_C) $(COMMONFLAGS) $(COMPILERFLAGS) $(KENBUILD_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
4555 hendricks2 917
 
5765 hendricks2 918
$(KENBUILD_OBJ)/%_banner.c: $(KENBUILD_RSRC)/%.bmp | $(KENBUILD_OBJ)
5197 hendricks2 919
	echo "#include \"gtkpixdata_shim.h\"" > $@
920
	gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
921
 
6056 hendricks2 922
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/%.cpp | $(DUKE3D_OBJ)
4555 hendricks2 923
	$(COMPILE_STATUS)
6056 hendricks2 924
	$(RECIPE_IF) $(COMPILER_CXX) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
4555 hendricks2 925
 
5765 hendricks2 926
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_OBJ)/%.c
927
	$(COMPILE_STATUS)
6056 hendricks2 928
	$(RECIPE_IF) $(COMPILER_C) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
5765 hendricks2 929
 
6056 hendricks2 930
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_SRC)/%.mm | $(DUKE3D_OBJ)
4565 hendricks2 931
	$(COMPILE_STATUS)
6056 hendricks2 932
	$(RECIPE_IF) $(COMPILER_OBJCXX) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
4565 hendricks2 933
 
6056 hendricks2 934
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_RSRC)/%.rc | $(DUKE3D_OBJ)
4555 hendricks2 935
	$(COMPILE_STATUS)
936
	$(RECIPE_IF) $(RC) -i $< -o $@ --include-dir=$(ENGINE_INC) --include-dir=$(DUKE3D_SRC) --include-dir=$(DUKE3D_RSRC) -DPOLYMER=$(POLYMER) $(RECIPE_RESULT_COMPILE)
4543 hendricks2 937
 
4553 hendricks2 938
$(DUKE3D_OBJ)/%.$o: $(DUKE3D_RSRC)/%.c | $(DUKE3D_OBJ)
4543 hendricks2 939
	$(COMPILE_STATUS)
6056 hendricks2 940
	$(RECIPE_IF) $(COMPILER_C) $(COMMONFLAGS) $(COMPILERFLAGS) $(DUKE3D_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
4543 hendricks2 941
 
5765 hendricks2 942
$(DUKE3D_OBJ)/%_banner.c: $(DUKE3D_RSRC)/%.bmp | $(DUKE3D_OBJ)
4770 hendricks2 943
	echo "#include \"gtkpixdata_shim.h\"" > $@
5333 hendricks2 944
	gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
4770 hendricks2 945
 
6056 hendricks2 946
$(SW_OBJ)/%.$o: $(SW_SRC)/%.cpp | $(SW_OBJ)
5197 hendricks2 947
	$(COMPILE_STATUS)
6056 hendricks2 948
	$(RECIPE_IF) $(COMPILER_CXX) $(COMMONFLAGS) $(COMPILERFLAGS) $(SW_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
5197 hendricks2 949
 
5765 hendricks2 950
$(SW_OBJ)/%.$o: $(SW_OBJ)/%.c
951
	$(COMPILE_STATUS)
6056 hendricks2 952
	$(RECIPE_IF) $(COMPILER_C) $(COMMONFLAGS) $(COMPILERFLAGS) $(SW_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
5765 hendricks2 953
 
6056 hendricks2 954
$(SW_OBJ)/%.$o: $(SW_SRC)/%.mm | $(SW_OBJ)
5197 hendricks2 955
	$(COMPILE_STATUS)
6056 hendricks2 956
	$(RECIPE_IF) $(COMPILER_OBJCXX) $(COMMONFLAGS) $(COMPILERFLAGS) $(SW_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
5197 hendricks2 957
 
958
$(SW_OBJ)/%.$o: $(SW_RSRC)/%.rc | $(SW_OBJ)
959
	$(COMPILE_STATUS)
960
	$(RECIPE_IF) $(RC) -i $< -o $@ --include-dir=$(ENGINE_INC) --include-dir=$(SW_SRC) --include-dir=$(SW_RSRC) $(RECIPE_RESULT_COMPILE)
961
 
962
$(SW_OBJ)/%.$o: $(SW_RSRC)/%.c | $(SW_OBJ)
963
	$(COMPILE_STATUS)
6056 hendricks2 964
	$(RECIPE_IF) $(COMPILER_C) $(COMMONFLAGS) $(COMPILERFLAGS) $(SW_CFLAGS) -c $< -o $@ $(RECIPE_RESULT_COMPILE)
5197 hendricks2 965
 
5765 hendricks2 966
$(SW_OBJ)/%_banner.c: $(SW_RSRC)/%.bmp | $(SW_OBJ)
4770 hendricks2 967
	echo "#include \"gtkpixdata_shim.h\"" > $@
5 Plagman 968
	gdk-pixbuf-csource --extern --struct --raw --name=startbanner_pixdata $^ | sed 's/load_inc//' >> $@
969
 
5748 hendricks2 970
$(obj):
4807 hendricks2 971
	-mkdir $@ $(DONT_PRINT) $(DONT_FAIL)
4553 hendricks2 972
 
6056 hendricks2 973
$(ENGINE_OBJ) $(TOOLS_OBJ) $(KENBUILD_OBJ) $(AUDIOLIB_OBJ) $(MACT_OBJ) $(DUKE3D_OBJ) $(SW_OBJ) $(ENET_OBJ): | $(obj)
5748 hendricks2 974
	-mkdir $@ $(DONT_PRINT) $(DONT_FAIL)
975
 
4756 helixhorne 976
## PHONIES
996 terminx 977
 
5197 hendricks2 978
cleanduke3d:
5749 hendricks2 979
	-rm -f $(DUKE3D_GAME)$(EXESUFFIX) $(DUKE3D_EDITOR)$(EXESUFFIX)
2388 helixhorne 980
ifeq ($(PLATFORM),DARWIN)
5746 hendricks2 981
	-rm -rf "$(DUKE3D_GAME_PROPER).app" "$(DUKE3D_EDITOR_PROPER).app"
2388 helixhorne 982
endif
5 Plagman 983
 
4555 hendricks2 984
cleantest:
5748 hendricks2 985
	-rm -f $(KENBUILD_GAME)$(EXESUFFIX) $(KENBUILD_EDITOR)$(EXESUFFIX)
4555 hendricks2 986
 
5197 hendricks2 987
cleansw:
5748 hendricks2 988
	-rm -f $(SW_GAME)$(EXESUFFIX) $(SW_EDITOR)$(EXESUFFIX)
5197 hendricks2 989
 
6056 hendricks2 990
cleantools:
991
	-rm -f $(addsuffix $(EXESUFFIX),$(TOOLS_TARGETS) $(DXTOOLS_TARGETS) $(SDLTOOLS_TARGETS))
3163 hendricks2 992
 
6056 hendricks2 993
clean: cleanduke3d cleantools
5748 hendricks2 994
	-rm -rf $(obj)/
995
	-rm -f $(EBACKTRACEDLL)
3163 hendricks2 996
 
6056 hendricks2 997
printtools:
998
	echo "$(addsuffix $(EXESUFFIX),$(TOOLS_TARGETS))"
4343 hendricks2 999
 
6056 hendricks2 1000
printdxtools:
1001
	echo "$(addsuffix $(EXESUFFIX),$(DXTOOLS_TARGETS))"
4543 hendricks2 1002
 
6056 hendricks2 1003
printsdltools:
1004
	echo "$(addsuffix $(EXESUFFIX),$(SDLTOOLS_TARGETS))"
4543 hendricks2 1005
 
6056 hendricks2 1006
rev: $(ENGINE_OBJ)/rev.$o
1007
 
1008
 
1009
# Compatibility
1010
 
1011
test: kenbuild
1012
utils: tools
1013
dxutils: dxtools
1014
sdlutils: sdltools
1015
printutils: printtools
1016
printdxutils: printdxtools
1017
printsdlutils: printsdltools
1018
veryclean: clean
1019
cleanutils: cleantools