This repository has been archived by the owner on Jun 20, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
GNUmakefile
1142 lines (922 loc) · 24.7 KB
/
GNUmakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
# EDuke32 Makefile for GNU Make
#
include Common.mak
### File Extensions
asm := nasm
o := o
### Directories
source := source
obj := obj
### Functions
define parent
$(word 1,$(subst _, ,$1))
endef
define expandobjs
$$(addprefix $$($$(call parent,$1)_obj)/,$$(addsuffix .$$o,$$(basename $$($1_objs) $$($1_rsrc_objs) $$($1_gen_objs))))
endef
define expandsrcs
$(addprefix $($(call parent,$1)_src)/,$($1_objs)) $(addprefix $($(call parent,$1)_rsrc)/,$($1_rsrc_objs)) $(addprefix $($(call parent,$1)_obj)/,$($1_gen_objs))
endef
define expanddeps
$(strip $1 $(foreach j,$1,$(call $0,$($j_deps))))
endef
define getdeps
$(call expanddeps,$1_$2 $(common_$2_deps) engine)
endef
##### External Library Definitions
#### libxmp-lite
libxmplite := libxmp-lite
libxmplite_objs := \
control.c \
dataio.c \
effects.c \
filter.c \
format.c \
hio.c \
lfo.c \
load.c \
load_helpers.c \
memio.c \
mixer.c \
mix_all.c \
period.c \
player.c \
read_event.c \
scan.c \
smix.c \
virtual.c \
common.c \
itsex.c \
it_load.c \
mod_load.c \
mtm_load.c \
s3m_load.c \
sample.c \
xm_load.c \
libxmplite_root := $(source)/$(libxmplite)
libxmplite_src := $(libxmplite_root)/src
libxmplite_inc := $(libxmplite_root)/include
libxmplite_obj := $(obj)/$(libxmplite)
libxmplite_cflags := -DHAVE_ROUND -DLIBXMP_CORE_PLAYER -DBUILDING_STATIC -I$(libxmplite_inc)/libxmp-lite -Wno-unused-parameter -Wno-sign-compare
#### LPeg
lpeg := lpeg
lpeg_objs := \
lpcap.c \
lpcode.c \
lpprint.c \
lptree.c \
lpvm.c \
lpeg_root := $(source)/$(lpeg)
lpeg_src := $(lpeg_root)/src
lpeg_inc := $(lpeg_root)/include
lpeg_obj := $(obj)/$(lpeg)
#### ENet
enet := enet
enet_objs := \
callbacks.c \
host.c \
list.c \
packet.c \
peer.c \
protocol.c \
compress.c \
enet_root := $(source)/$(enet)
enet_src := $(enet_root)/src
enet_inc := $(enet_root)/include
enet_obj := $(obj)/$(enet)
enet_cflags :=
ifeq ($(PLATFORM),WINDOWS)
enet_objs += win32.c
else
enet_objs += unix.c
enet_cflags += -DHAS_SOCKLEN_T
endif
#### glad
glad := glad
glad_objs := \
glad.c \
glad_root := $(source)/$(glad)
glad_src := $(glad_root)/src
glad_inc := $(glad_root)/include
glad_obj := $(obj)/$(glad)
glad_cflags :=
ifeq ($(RENDERTYPE),WIN)
glad_objs += glad_wgl.c
endif
##### Component Definitions
#### EBacktrace
ifndef ebacktrace_dll
ebacktrace_dll := ebacktrace1.dll
ifeq ($(findstring x86_64,$(COMPILERTARGET)),x86_64)
ebacktrace_dll := ebacktrace1-64.dll
endif
endif
#### BUILD Engine
engine := build
engine_root := $(source)/$(engine)
engine_src := $(engine_root)/src
engine_inc := $(engine_root)/include
engine_obj := $(obj)/$(engine)
engine_cflags := -I$(engine_src)
engine_deps :=
engine_objs := \
rev.cpp \
baselayer.cpp \
cache1d.cpp \
klzw.cpp \
common.cpp \
compat.cpp \
crc32.cpp \
defs.cpp \
engine.cpp \
tiles.cpp \
clip.cpp \
2d.cpp \
hash.cpp \
palette.cpp \
polymost.cpp \
texcache.cpp \
dxtfilter.cpp \
hightile.cpp \
textfont.cpp \
smalltextfont.cpp \
kplib.cpp \
lz4.c \
osd.cpp \
pragmas.cpp \
scriptfile.cpp \
softsurface.cpp \
mmulti_null.cpp \
mutex.cpp \
xxhash.c \
md4.cpp \
colmatch.cpp \
screenshot.cpp \
mhk.cpp \
pngwrite.cpp \
miniz.c \
miniz_tinfl.c \
miniz_tdef.c \
fix16.c \
fix16_str.c \
engine_editor_objs := \
build.cpp \
config.cpp \
defs.cpp \
engine_tools_objs := \
compat.cpp \
pragmas.cpp \
kplib.cpp \
cache1d.cpp \
klzw.cpp \
crc32.cpp \
colmatch.cpp \
lz4.cpp \
ifeq (0,$(NOASM))
engine_objs += a.nasm
else
engine_objs += a-c.cpp
ifneq (0,$(USE_ASM64))
engine_objs += a64.yasm
endif
endif
ifeq (1,$(USE_OPENGL))
engine_objs += glsurface.cpp voxmodel.cpp mdsprite.cpp tilepacker.cpp
engine_deps += glad
ifeq (1,$(POLYMER))
engine_objs += glbuild.cpp polymer.cpp
endif
endif
ifneq (0,$(LUNATIC))
engine_objs += lunatic.cpp
endif
ifeq ($(PLATFORM),DARWIN)
engine_objs += osxbits.mm
engine_tools_objs += osxbits.mm
ifeq ($(STARTUP_WINDOW),1)
engine_editor_objs += startosx.editor.mm
endif
ifeq ($(SDL_TARGET),1)
ifneq ($(SDL_FRAMEWORK),0)
engine_objs += SDLMain.mm
endif
endif
endif
ifeq ($(PLATFORM),WINDOWS)
engine_objs += winbits.cpp
ifeq ($(STARTUP_WINDOW),1)
engine_editor_objs += startwin.editor.cpp
endif
endif
ifeq ($(PLATFORM),WII)
engine_objs += wiibits.cpp
LINKERFLAGS += -Wl,-wrap,c_default_exceptionhandler
endif
ifeq ($(RENDERTYPE),SDL)
engine_objs += sdlayer.cpp
ifeq (1,$(HAVE_GTK2))
engine_objs += gtkbits.cpp dynamicgtk.cpp
ifeq ($(STARTUP_WINDOW),1)
engine_editor_objs += startgtk.editor.cpp
endif
endif
endif
ifeq ($(RENDERTYPE),WIN)
engine_objs += winlayer.cpp rawinput.cpp
endif
ifneq ($(USE_LIBVPX),0)
engine_objs += animvpx.cpp
endif
#### mact
mact := mact
mact_root := $(source)/$(mact)
mact_src := $(mact_root)/src
mact_inc := $(mact_root)/include
mact_obj := $(obj)/$(mact)
mact_objs := \
file_lib.cpp \
control.cpp \
keyboard.cpp \
joystick.cpp \
scriplib.cpp \
animlib.cpp \
#### AudioLib
audiolib := audiolib
audiolib_objs := \
drivers.cpp \
fx_man.cpp \
multivoc.cpp \
mix.cpp \
mixst.cpp \
pitch.cpp \
formats.cpp \
vorbis.cpp \
flac.cpp \
xa.cpp \
xmp.cpp \
driver_nosound.cpp \
audiolib_root := $(source)/$(audiolib)
audiolib_src := $(audiolib_root)/src
audiolib_inc := $(audiolib_root)/include
audiolib_obj := $(obj)/$(audiolib)
audiolib_cflags :=
audiolib_deps :=
ifeq ($(PLATFORM),WINDOWS)
ifeq ($(MIXERTYPE),WIN)
audiolib_objs += driver_directsound.cpp
endif
endif
ifeq ($(MIXERTYPE),SDL)
ifeq (,$(filter $(PLATFORM),DARWIN WINDOWS WII))
audiolib_cflags += `$(PKG_CONFIG) --cflags vorbis`
endif
audiolib_objs += driver_sdl.cpp
endif
ifneq (0,$(HAVE_XMP))
audiolib_cflags += -I$(libxmplite_inc)
audiolib_deps += libxmplite
endif
#### Tools
tools := tools
tools_objs := \
compat_tools.cpp \
tools_root := $(source)/$(tools)
tools_src := $(tools_root)/src
tools_obj := $(obj)/$(tools)
tools_cflags := $(engine_cflags)
tools_deps := engine_tools
tools_targets := \
kextract \
kgroup \
transpal \
wad2art \
wad2map \
kmd2tool \
md2tool \
generateicon \
cacheinfo \
arttool \
givedepth \
mkpalette \
unpackssi \
bsuite \
ivfrate \
map2stl \
ifeq ($(PLATFORM),WINDOWS)
tools_targets += enumdisplay getdxdidf
endif
ifeq ($(RENDERTYPE),SDL)
tools_targets += makesdlkeytrans
endif
#### KenBuild (Test Game)
kenbuild := kenbuild
kenbuild_root := $(source)/$(kenbuild)
kenbuild_src := $(kenbuild_root)/src
kenbuild_rsrc := $(kenbuild_root)/rsrc
kenbuild_obj := $(obj)/$(kenbuild)
kenbuild_cflags := -I$(kenbuild_src)
kenbuild_game := ekenbuild
kenbuild_editor := ekenbuild-editor
kenbuild_game_proper := EKenBuild
kenbuild_editor_proper := EKenBuild Editor
kenbuild_game_objs := \
game.cpp \
sound_stub.cpp \
common.cpp \
config.cpp \
kenbuild_editor_objs := \
bstub.cpp \
common.cpp \
kenbuild_game_rsrc_objs :=
kenbuild_editor_rsrc_objs :=
kenbuild_game_gen_objs :=
kenbuild_editor_rsrc_objs :=
ifeq (1,$(HAVE_GTK2))
kenbuild_game_objs += startgtk.game.cpp
kenbuild_game_gen_objs += game_banner.c
kenbuild_editor_gen_objs += build_banner.c
endif
ifeq ($(RENDERTYPE),SDL)
kenbuild_game_rsrc_objs += game_icon.c
kenbuild_editor_rsrc_objs += build_icon.c
endif
ifeq ($(PLATFORM),WINDOWS)
kenbuild_game_objs += startwin.game.cpp
kenbuild_game_rsrc_objs += gameres.rc
kenbuild_editor_rsrc_objs += buildres.rc
endif
ifeq ($(PLATFORM),DARWIN)
ifeq ($(STARTUP_WINDOW),1)
kenbuild_game_objs += StartupWinController.game.mm
endif
endif
#### Duke Nukem 3D
duke3d := duke3d
duke3d_game_ldflags :=
duke3d_editor_ldflags :=
duke3d_game_stripflags :=
duke3d_editor_stripflags :=
duke3d_root := $(source)/$(duke3d)
duke3d_src := $(duke3d_root)/src
duke3d_rsrc := $(duke3d_root)/rsrc
duke3d_obj := $(obj)/$(duke3d)
duke3d_cflags := -I$(duke3d_src)
common_editor_deps := duke3d_common_editor engine_editor
duke3d_game_deps := duke3d_common_midi audiolib mact
duke3d_editor_deps := audiolib
ifneq (0,$(NETCODE))
duke3d_game_deps += enet
endif
ifneq (0,$(LUNATIC))
duke3d_game_deps += lunatic lunatic_game lpeg
duke3d_editor_deps += lunatic lunatic_editor lpeg
endif
duke3d_game := eduke32
duke3d_editor := mapster32
ifneq (,$(APPBASENAME))
duke3d_game := $(APPBASENAME)
endif
duke3d_game_proper := EDuke32
duke3d_editor_proper := Mapster32
duke3d_common_editor_objs := \
m32common.cpp \
m32def.cpp \
m32exec.cpp \
m32vars.cpp \
duke3d_game_objs := \
game.cpp \
global.cpp \
actors.cpp \
gamedef.cpp \
gameexec.cpp \
gamevars.cpp \
player.cpp \
premap.cpp \
sector.cpp \
anim.cpp \
common.cpp \
config.cpp \
demo.cpp \
input.cpp \
menus.cpp \
namesdyn.cpp \
net.cpp \
savegame.cpp \
rts.cpp \
osdfuncs.cpp \
osdcmds.cpp \
grpscan.cpp \
sounds.cpp \
soundsdyn.cpp \
cheats.cpp \
sbar.cpp \
screentext.cpp \
screens.cpp \
cmdline.cpp \
duke3d_editor_objs := \
astub.cpp \
common.cpp \
grpscan.cpp \
sounds_mapster32.cpp \
duke3d_game_rsrc_objs :=
duke3d_editor_rsrc_objs :=
duke3d_game_gen_objs :=
duke3d_editor_gen_objs :=
duke3d_game_miscdeps :=
duke3d_editor_miscdeps :=
duke3d_game_orderonlydeps :=
duke3d_editor_orderonlydeps :=
#### Redneck Rampage
rr := rr
rr_game_ldflags :=
rr_editor_ldflags :=
rr_game_stripflags :=
rr_editor_stripflags :=
rr_root := $(source)/$(rr)
rr_src := $(rr_root)/src
rr_rsrc := $(rr_root)/rsrc
rr_obj := $(obj)/$(rr)
rr_cflags := -I$(rr_src)
common_editor_deps := rr_common_editor engine_editor
rr_game_deps := rr_common_midi audiolib mact
rr_editor_deps := audiolib
ifneq (0,$(NETCODE))
rr_game_deps += enet
endif
ifneq (0,$(LUNATIC))
rr_game_deps += lunatic lunatic_game lpeg
rr_editor_deps += lunatic lunatic_editor lpeg
endif
rr_game := rednukem
rr_editor := rrmapster32
ifneq (,$(APPBASENAME))
rr_game := $(APPBASENAME)
endif
rr_game_proper := Rednukem
rr_editor_proper := RRMapster32
rr_common_editor_objs := \
m32common.cpp \
m32def.cpp \
m32exec.cpp \
m32vars.cpp \
rr_game_objs := \
game.cpp \
global.cpp \
actors.cpp \
gamedef.cpp \
gameexec.cpp \
gamevars.cpp \
player.cpp \
premap.cpp \
sector.cpp \
anim.cpp \
common.cpp \
config.cpp \
demo.cpp \
input.cpp \
menus.cpp \
namesdyn.cpp \
net.cpp \
savegame.cpp \
rts.cpp \
osdfuncs.cpp \
osdcmds.cpp \
grpscan.cpp \
sounds.cpp \
soundsdyn.cpp \
cheats.cpp \
sbar.cpp \
screentext.cpp \
screens.cpp \
cmdline.cpp \
rr_editor_objs := \
astub.cpp \
common.cpp \
grpscan.cpp \
sounds_mapster32.cpp \
rr_game_rsrc_objs :=
rr_editor_rsrc_objs :=
rr_game_gen_objs :=
rr_editor_gen_objs :=
rr_game_miscdeps :=
rr_editor_miscdeps :=
rr_game_orderonlydeps :=
rr_editor_orderonlydeps :=
## Lunatic devel
lunatic := lunatic
lunatic_src := $(duke3d_src)/$(lunatic)
lunatic_obj := $(duke3d_obj)
ifneq (0,$(LUNATIC))
COMPILERFLAGS += -I$(lunatic_src) -DLUNATIC
# Determine size of _defs*.lua bytecode once.
ifndef DEFS_BC_SIZE
DEFS_BC_SIZE := $(shell $(LUAJIT) -bg -t h $(lunatic_src)/_defs_game.lua -)
DEFS_BC_SIZE := $(word 3, $(DEFS_BC_SIZE))
endif
ifndef DEFS_M32_BC_SIZE
DEFS_M32_BC_SIZE := $(shell $(LUAJIT) -bg -t h $(lunatic_src)/_defs_editor.lua -)
DEFS_M32_BC_SIZE := $(word 3, $(DEFS_M32_BC_SIZE))
endif
duke3d_cflags += -DLUNATIC_DEFS_BC_SIZE=$(DEFS_BC_SIZE) -DLUNATIC_DEFS_M32_BC_SIZE=$(DEFS_M32_BC_SIZE)
# Lunatic object base names. These are not used in targets directly.
lunatic_objs := \
defs_common.lua \
engine_maptext.lua \
engine.lua \
bcarray.lua \
bcheck.lua \
bitar.lua \
xmath.lua \
v.lua \
dump.lua \
dis_x86.lua \
dis_x64.lua \
lunatic_game_objs := \
lunatic_game.cpp \
_defs_game.lua \
con_lang.lua \
lunacon.lua \
randgen.lua \
stat.lua \
control.lua \
lunasave.lua \
fs.lua \
lunatic_editor_objs := \
lunatic_editor.cpp \
_defs_editor.lua \
# TODO: remove debugging modules from release build
# now, take care of having the necessary symbols (sector, wall, etc.) in the
# executable no matter what the debugging level
ifeq ($(PLATFORM),DARWIN)
# strip on OSX says: removing global symbols from a final linked no longer supported.
# Use -exported_symbols_list at link time when building
# But, following _their_ directions does not give us the symbols! wtf?
# Instead of using -alias_list and -exported_symbols_list, prevent stripping them.
duke3d_game_stripflags += -s $(duke3d_obj)/lunatic_dynsymlist_game_osx
duke3d_editor_stripflags += -s $(duke3d_obj)/lunatic_dynsymlist_editor_osx
duke3d_game_orderonlydeps += $(duke3d_obj)/lunatic_dynsymlist_game_osx
duke3d_editor_orderonlydeps += $(duke3d_obj)/lunatic_dynsymlist_editor_osx
LINKERFLAGS += -pagezero_size 10000 -image_base 100000000
endif
ifeq ($(PLATFORM),WINDOWS)
override STRIP :=
duke3d_game_miscdeps += $(duke3d_obj)/lunatic_dynsymlist_game.def
duke3d_editor_miscdeps += $(duke3d_obj)/lunatic_dynsymlist_editor.def
endif
ifeq ($(SUBPLATFORM),LINUX)
override STRIP :=
duke3d_game_ldflags += -Wl,--dynamic-list=$(lunatic_src)/dynsymlist_game.lds
duke3d_editor_ldflags += -Wl,--dynamic-list=$(lunatic_src)/dynsymlist_editor.lds
endif
endif
ifeq ($(SUBPLATFORM),LINUX)
LIBS += -lFLAC -lvorbisfile -lvorbis -logg
endif
ifeq ($(PLATFORM),BSD)
LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lexecinfo
endif
ifeq ($(PLATFORM),DARWIN)
LIBS += -lFLAC -lvorbisfile -lvorbis -logg -lm \
-Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,OpenGL \
-Wl,-framework,CoreMIDI -Wl,-framework,AudioUnit \
-Wl,-framework,AudioToolbox -Wl,-framework,IOKit -Wl,-framework,AGL
ifneq (00,$(DARWIN9)$(DARWIN10))
LIBS += -Wl,-framework,QuickTime -lm
endif
ifeq ($(STARTUP_WINDOW),1)
duke3d_game_objs += GrpFile.game.mm GameListSource.game.mm startosx.game.mm
rr_game_objs += GrpFile.game.mm GameListSource.game.mm startosx.game.mm
endif
endif
ifeq ($(PLATFORM),WINDOWS)
LIBS += -lFLAC -lvorbisfile -lvorbis -logg
duke3d_game_objs += winbits.cpp
duke3d_game_rsrc_objs += gameres.rc
duke3d_editor_rsrc_objs += buildres.rc
rr_game_objs += winbits.cpp
rr_game_rsrc_objs += gameres.rc
rr_editor_rsrc_objs += buildres.rc
ifeq ($(STARTUP_WINDOW),1)
duke3d_game_objs += startwin.game.cpp
rr_game_objs += startwin.game.cpp
endif
ifeq ($(MIXERTYPE),WIN)
LIBS += -ldsound
duke3d_common_midi_objs := music.cpp midi.cpp mpu401.cpp
rr_common_midi_objs := music.cpp midi.cpp mpu401.cpp
endif
endif
ifeq ($(PLATFORM),WII)
LIBS += -lvorbisidec
endif
ifeq (11,$(HAVE_GTK2)$(STARTUP_WINDOW))
duke3d_game_objs += startgtk.game.cpp
duke3d_game_gen_objs += game_banner.c
duke3d_editor_gen_objs += build_banner.c
rr_game_objs += startgtk.game.cpp
rr_game_gen_objs += game_banner.c
rr_editor_gen_objs += build_banner.c
endif
ifeq ($(RENDERTYPE),SDL)
duke3d_game_rsrc_objs += game_icon.c
duke3d_editor_rsrc_objs += build_icon.c
rr_game_rsrc_objs += game_icon.c
rr_editor_rsrc_objs += build_icon.c
endif
ifeq ($(MIXERTYPE),SDL)
duke3d_common_midi_objs := sdlmusic.cpp
rr_common_midi_objs := sdlmusic.cpp
endif
#### Shadow Warrior
sw := sw
sw_root := $(source)/$(sw)
sw_src := $(sw_root)/src
sw_rsrc := $(sw_root)/rsrc
sw_obj := $(obj)/$(sw)
sw_cflags := -I$(sw_src)
sw_game_deps := duke3d_common_midi audiolib mact
sw_editor_deps := audiolib
sw_game := voidsw
sw_editor := voidsw-editor
sw_game_proper := VoidSW
sw_editor_proper := VoidSW Editor
sw_game_objs := \
actor.cpp \
ai.cpp \
anim.cpp \
border.cpp \
break.cpp \
bunny.cpp \
cache.cpp \
cheats.cpp \
colormap.cpp \
common.cpp \
config.cpp \
console.cpp \
coolg.cpp \
coolie.cpp \
copysect.cpp \
demo.cpp \
draw.cpp \
eel.cpp \
game.cpp \
girlninj.cpp \
goro.cpp \
grpscan.cpp \
hornet.cpp \
interp.cpp \
interpsh.cpp \
inv.cpp \
jplayer.cpp \
jsector.cpp \
jweapon.cpp \
lava.cpp \
light.cpp \
mclip.cpp \
mdastr.cpp \
menus.cpp \
miscactr.cpp \
morph.cpp \
net.cpp \
ninja.cpp \
panel.cpp \
player.cpp \
predict.cpp \
quake.cpp \
ripper.cpp \
ripper2.cpp \
rooms.cpp \
rotator.cpp \
rts.cpp \
save.cpp \
scrip2.cpp \
sector.cpp \
serp.cpp \
setup.cpp \
skel.cpp \
skull.cpp \
slidor.cpp \
sounds.cpp \
spike.cpp \
sprite.cpp \
sumo.cpp \
swconfig.cpp \
sync.cpp \
text.cpp \
track.cpp \
vator.cpp \
vis.cpp \
wallmove.cpp \
warp.cpp \
weapon.cpp \
zilla.cpp \
zombie.cpp \
saveable.cpp \
sw_editor_objs := \
jnstub.cpp \
brooms.cpp \
bldscript.cpp \
jbhlp.cpp \
colormap.cpp \
grpscan.cpp \
common.cpp \
sw_game_rsrc_objs :=
sw_editor_rsrc_objs :=
sw_game_gen_objs :=
sw_editor_gen_objs :=
ifeq (1,$(HAVE_GTK2))
sw_game_objs += startgtk.game.cpp
sw_game_gen_objs += game_banner.c
sw_editor_gen_objs += build_banner.c
endif
ifeq ($(RENDERTYPE),SDL)
sw_game_rsrc_objs += game_icon.c
sw_editor_rsrc_objs += game_icon.c
endif
ifeq ($(PLATFORM),WINDOWS)
sw_game_objs += startwin.game.cpp
sw_game_rsrc_objs += gameres.rc
sw_editor_rsrc_objs += buildres.rc
endif
#### Final setup
COMPILERFLAGS += -I$(engine_inc) -I$(mact_inc) -I$(audiolib_inc) -I$(enet_inc) -I$(glad_inc)
##### Recipes
games := \
kenbuild \
duke3d \
rr \
sw \
libraries := \
engine \
audiolib \
mact \
enet \
libxmplite \
lpeg \
glad \
components := \
$(games) \
$(libraries) \
tools \
roles := \
game \
editor \
ifeq ($(PRETTY_OUTPUT),1)
.SILENT:
endif
.PHONY: \
all \
start \
$(addprefix clean,$(games) test utils tools) \
veryclean \
clean \
printutils \
printtools \
rev \
$(engine_obj)/rev.$o \
clang-tools \
.SUFFIXES:
.SECONDEXPANSION:
#### Targets
all: rednukem
start:
$(BUILD_STARTED)
tools: $(addsuffix $(EXESUFFIX),$(tools_targets)) | start
@$(call LL,$^)
$(games): $$(foreach i,$(roles),$$($$@_$$i)$(EXESUFFIX)) | start
@$(call LL,$^)
ebacktrace: $(ebacktrace_dll) | start
@$(call LL,$^)
ifeq ($(PLATFORM),WII)
ifneq ($(ELF2DOL),)
%$(DOLSUFFIX): %$(EXESUFFIX)
endif
endif
define BUILDRULE
$$($1_$2)$$(EXESUFFIX): $$(foreach i,$(call getdeps,$1,$2),$$(call expandobjs,$$i)) $$($1_$2_miscdeps) | $$($1_$2_orderonlydeps)
$$(LINK_STATUS)
$$(RECIPE_IF) $$(LINKER) -o $$@ $$^ $$(GUI_LIBS) $$($1_$2_ldflags) $$(LIBDIRS) $$(LIBS) $$(RECIPE_RESULT_LINK)
ifeq ($$(PLATFORM),WII)
ifneq ($$(ELF2DOL),)
$$(ELF2DOL) $$@ $$($1_$2)$$(DOLSUFFIX)
endif
endif
ifneq ($$(STRIP),)
$$(STRIP) $$@ $$($1_$2_stripflags)
endif
ifeq ($$(PLATFORM),DARWIN)
cp -RPf "platform/Apple/bundles/$$($1_$2_proper).app" "./"
$(call MKDIR,"$$($1_$2_proper).app/Contents/MacOS")
cp -f "$$($1_$2)$$(EXESUFFIX)" "$$($1_$2_proper).app/Contents/MacOS/"
endif
endef
$(foreach i,$(games),$(foreach j,$(roles),$(eval $(call BUILDRULE,$i,$j))))
include $(lpeg_root)/Dependencies.mak
include $(engine_root)/Dependencies.mak
include $(duke3d_root)/Dependencies.mak
include $(rr_root)/Dependencies.mak
include $(sw_root)/Dependencies.mak
#### Rules
$(ebacktrace_dll): platform/Windows/src/backtrace.c
$(COMPILE_STATUS)