-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
791 lines (654 loc) · 17.1 KB
/
Makefile
File metadata and controls
791 lines (654 loc) · 17.1 KB
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
# ThreeCore Makefile, GNU Make required
COMPILE_PLATFORM=$(shell uname | sed -e 's/_.*//' | tr '[:upper:]' '[:lower:]' | sed -e 's/\//_/g')
COMPILE_ARCH=$(shell uname -m | sed -e 's/i.86/x86/' | sed -e 's/^arm.*/arm/')
ifeq ($(shell uname -m),arm64)
COMPILE_ARCH=aarch64
endif
BUILD_CLIENT = 1
BUILD_SERVER = 0
# Build
MOUNT_DIR = code
# General
USE_LOCAL_HEADERS = 1
CNAME = sandbox
DNAME = sandbox.ded
ifeq ($(V),1)
echo_cmd=@:
Q=
else
echo_cmd=@echo
Q=@
endif
ifndef PLATFORM
PLATFORM=$(COMPILE_PLATFORM)
endif
export PLATFORM
ifeq ($(PLATFORM),mingw32)
MINGW=1
endif
ifeq ($(PLATFORM),mingw64)
MINGW=1
endif
ifeq ($(COMPILE_ARCH),i86pc)
COMPILE_ARCH=x86
endif
ifeq ($(COMPILE_ARCH),amd64)
COMPILE_ARCH=x86_64
endif
ifeq ($(COMPILE_ARCH),x64)
COMPILE_ARCH=x86_64
endif
ifndef ARCH
ARCH=$(COMPILE_ARCH)
endif
export ARCH
ifneq ($(PLATFORM),$(COMPILE_PLATFORM))
CROSS_COMPILING=1
else
CROSS_COMPILING=0
ifneq ($(ARCH),$(COMPILE_ARCH))
CROSS_COMPILING=1
endif
endif
export CROSS_COMPILING
ifndef DESTDIR
DESTDIR=bin
endif
ifndef BUILD_DIR
BUILD_DIR=build
endif
#############################################################################
BD=$(BUILD_DIR)/debug-$(PLATFORM)-$(ARCH)
BR=$(BUILD_DIR)/release-$(PLATFORM)-$(ARCH)
ADIR=$(MOUNT_DIR)/asm
CDIR=$(MOUNT_DIR)/client
SDIR=$(MOUNT_DIR)/server
RCDIR=$(MOUNT_DIR)/renderercommon
R1DIR=$(MOUNT_DIR)/renderer
SDLDIR=$(MOUNT_DIR)/sdl
SDLHDIR=$(MOUNT_DIR)/libsdl/include/SDL2
CMDIR=$(MOUNT_DIR)/qcommon
UDIR=$(MOUNT_DIR)/unix
W32DIR=$(MOUNT_DIR)/win32
BLIBDIR=$(MOUNT_DIR)/botlib
bin_path=$(shell which $(1) 2> /dev/null)
STRIP ?= strip
PKG_CONFIG ?= pkg-config
INSTALL=install
MKDIR=mkdir -p
ifneq ($(call bin_path, $(PKG_CONFIG)),)
SDL_INCLUDE ?= $(shell $(PKG_CONFIG) --silence-errors --cflags-only-I sdl2)
SDL_LIBS ?= $(shell $(PKG_CONFIG) --silence-errors --libs sdl2)
endif
# supply some reasonable defaults for SDL/X11
ifeq ($(X11_INCLUDE),)
X11_INCLUDE = -I/usr/X11R6/include
endif
ifeq ($(X11_LIBS),)
X11_LIBS = -lX11
endif
ifeq ($(SDL_LIBS),)
SDL_LIBS = -lSDL2
endif
BASE_CFLAGS =
ifeq ($(USE_LOCAL_HEADERS),1)
BASE_CFLAGS += -DUSE_LOCAL_HEADERS=1
endif
BASE_CFLAGS += -DUSE_OPENGL_API
ARCHEXT=
CLIENT_EXTRA_FILES=
#############################################################################
# SETUP AND BUILD -- MINGW32
#############################################################################
ifdef MINGW
ifeq ($(CROSS_COMPILING),1)
# If CC is already set to something generic, we probably want to use
# something more specific
ifneq ($(findstring $(strip $(CC)),cc gcc),)
CC=
endif
# We need to figure out the correct gcc and windres
ifeq ($(ARCH),x86_64)
MINGW_PREFIXES=x86_64-w64-mingw32 amd64-mingw32msvc
STRIP=x86_64-w64-mingw32-strip
endif
ifeq ($(ARCH),x86)
MINGW_PREFIXES=i686-w64-mingw32 i586-mingw32msvc i686-pc-mingw32
endif
ifndef CC
CC=$(firstword $(strip $(foreach MINGW_PREFIX, $(MINGW_PREFIXES), \
$(call bin_path, $(MINGW_PREFIX)-gcc))))
endif
# STRIP=$(MINGW_PREFIX)-strip -g
ifndef WINDRES
WINDRES=$(firstword $(strip $(foreach MINGW_PREFIX, $(MINGW_PREFIXES), \
$(call bin_path, $(MINGW_PREFIX)-windres))))
endif
else
# Some MinGW installations define CC to cc, but don't actually provide cc,
# so check that CC points to a real binary and use gcc if it doesn't
ifeq ($(call bin_path, $(CC)),)
CC=gcc
endif
endif
# using generic windres if specific one is not present
ifeq ($(WINDRES),)
WINDRES=windres
endif
ifeq ($(CC),)
$(error Cannot find a suitable cross compiler for $(PLATFORM))
endif
BASE_CFLAGS += -Wall -Wimplicit -Wstrict-prototypes -DMINGW=1 -DWIN32_LEAN_AND_MEAN
BASE_CFLAGS += -Wno-unused-result -fvisibility=hidden
BASE_CFLAGS += -ffunction-sections -flto
BASE_CFLAGS += -D__inline=inline
ifeq ($(ARCH),x86_64)
ARCHEXT = .x64
BASE_CFLAGS += -m64
OPTIMIZE = -O2
endif
ifeq ($(ARCH),x86)
BASE_CFLAGS += -m32
OPTIMIZE = -O2 -march=i586 -mtune=i686
endif
SHLIBEXT = dll
SHLIBCFLAGS = -fPIC -fvisibility=hidden
SHLIBLDFLAGS = -shared $(LDFLAGS)
BINEXT = .exe
LDFLAGS += -mwindows -Wl,--dynamicbase -Wl,--nxcompat
LDFLAGS += -Wl,--gc-sections -fvisibility=hidden
LDFLAGS += -lwsock32 -lgdi32 -lwinmm -lole32 -lws2_32 -lpsapi -lcomctl32
LDFLAGS += -flto
CLIENT_LDFLAGS=$(LDFLAGS)
BASE_CFLAGS += -DUSE_LOCAL_HEADERS=1 -I$(SDLHDIR)
ifeq ($(ARCH),x86)
CLIENT_LDFLAGS += -L$(MOUNT_DIR)/libsdl/windows/lib32
CLIENT_LDFLAGS += -lSDL2
CLIENT_EXTRA_FILES += $(MOUNT_DIR)/libsdl/windows/lib32/SDL2.dll
else
CLIENT_LDFLAGS += -L$(MOUNT_DIR)/libsdl/windows/lib64
CLIENT_LDFLAGS += -lSDL2
CLIENT_EXTRA_FILES += $(MOUNT_DIR)/libsdl/windows/lib64/SDL2.dll
endif
DEBUG_CFLAGS = $(BASE_CFLAGS) -DDEBUG -D_DEBUG -g -O0
RELEASE_CFLAGS = $(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)
else # !MINGW
ifeq ($(COMPILE_PLATFORM),darwin)
#############################################################################
# SETUP AND BUILD -- MACOS
#############################################################################
BASE_CFLAGS += -Wall -Wimplicit -Wstrict-prototypes -pipe
BASE_CFLAGS += -Wno-unused-result
BASE_CFLAGS += -DMACOS_X
OPTIMIZE = -O2 -fvisibility=hidden
SHLIBEXT = dylib
SHLIBCFLAGS = -fPIC -fvisibility=hidden
SHLIBLDFLAGS = -dynamiclib $(LDFLAGS)
ARCHEXT = .$(ARCH)
LDFLAGS +=
ifeq ($(ARCH),x86_64)
BASE_CFLAGS += -arch x86_64
LDFLAGS += -arch x86_64
endif
ifeq ($(ARCH),aarch64)
BASE_CFLAGS += -arch arm64
LDFLAGS += -arch arm64
endif
ifeq ($(USE_LOCAL_HEADERS),1)
MACLIBSDIR=$(MOUNT_DIR)/libsdl/macos
BASE_CFLAGS += -I$(SDLHDIR)
CLIENT_LDFLAGS += $(MACLIBSDIR)/SDL2.dylib
CLIENT_EXTRA_FILES += $(MACLIBSDIR)/SDL2.dylib
else
ifneq ($(SDL_INCLUDE),)
BASE_CFLAGS += $(SDL_INCLUDE)
CLIENT_LDFLAGS = $(SDL_LIBS)
else
BASE_CFLAGS += -I/Library/Frameworks/SDL2.framework/Headers
CLIENT_LDFLAGS += -F/Library/Frameworks -framework SDL2
endif
endif
DEBUG_CFLAGS = $(BASE_CFLAGS) -DDEBUG -D_DEBUG -g -O0
RELEASE_CFLAGS = $(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)
else
#############################################################################
# SETUP AND BUILD -- *NIX PLATFORMS
#############################################################################
BASE_CFLAGS += -Wall -Wimplicit -Wstrict-prototypes -pipe
BASE_CFLAGS += -Wno-unused-result
BASE_CFLAGS += -I/usr/include -I/usr/local/include
OPTIMIZE = -O2 -fvisibility=hidden
ifeq ($(ARCH),x86_64)
ARCHEXT = .x64
else
ifeq ($(ARCH),x86)
OPTIMIZE += -march=i586 -mtune=i686
endif
endif
ifeq ($(ARCH),arm)
OPTIMIZE += -march=armv7-a
ARCHEXT = .arm
endif
ifeq ($(ARCH),aarch64)
ARCHEXT = .aarch64
endif
SHLIBEXT = so
SHLIBCFLAGS = -fPIC -fvisibility=hidden
SHLIBLDFLAGS = -shared $(LDFLAGS)
LDFLAGS += -lm
LDFLAGS += -Wl,--gc-sections -fvisibility=hidden
BASE_CFLAGS += $(SDL_INCLUDE)
CLIENT_LDFLAGS = $(SDL_LIBS)
ifeq ($(PLATFORM),linux)
LDFLAGS += -ldl -Wl,--hash-style=both
ifeq ($(ARCH),x86)
# linux32 make ...
BASE_CFLAGS += -m32
LDFLAGS += -m32
endif
endif
DEBUG_CFLAGS = $(BASE_CFLAGS) -DDEBUG -D_DEBUG -g -O0
RELEASE_CFLAGS = $(BASE_CFLAGS) -DNDEBUG $(OPTIMIZE)
DEBUG_LDFLAGS = -rdynamic
endif # *NIX platforms
endif # !MINGW
TARGET_CLIENT = $(CNAME)$(BINEXT)
TARGET_SERVER = $(DNAME)$(BINEXT)
TARGETS =
ifneq ($(BUILD_SERVER),0)
TARGETS += $(B)/$(TARGET_SERVER)
endif
ifneq ($(BUILD_CLIENT),0)
TARGETS += $(B)/$(TARGET_CLIENT)
endif
RENDCFLAGS=$(NOTSHLIBCFLAGS)
define DO_CC
$(echo_cmd) "CC $<"
$(Q)$(CC) $(CFLAGS) -o $@ -c $<
endef
define DO_REND_CC
$(echo_cmd) "REND_CC $<"
$(Q)$(CC) $(CFLAGS) $(RENDCFLAGS) -o $@ -c $<
endef
define DO_BOT_CC
$(echo_cmd) "BOT_CC $<"
$(Q)$(CC) $(CFLAGS) $(BOTCFLAGS) -DBOTLIB -o $@ -c $<
endef
define DO_AS
$(echo_cmd) "AS $<"
$(Q)$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
endef
define DO_DED_CC
$(echo_cmd) "DED_CC $<"
$(Q)$(CC) $(CFLAGS) -DDEDICATED -o $@ -c $<
endef
define DO_WINDRES
$(echo_cmd) "WINDRES $<"
$(Q)$(WINDRES) -i $< -o $@
endef
#############################################################################
# MAIN TARGETS
#############################################################################
default: release
all: debug release
debug:
@$(MAKE) targets B=$(BD) CFLAGS="$(CFLAGS) $(DEBUG_CFLAGS)" LDFLAGS="$(LDFLAGS) $(DEBUG_LDFLAGS)" V=$(V)
release:
@$(MAKE) targets B=$(BR) CFLAGS="$(CFLAGS) $(RELEASE_CFLAGS)" V=$(V)
define ADD_COPY_TARGET
TARGETS += $2
$2: $1
$(echo_cmd) "CP $$<"
@cp $1 $2
endef
# These functions allow us to generate rules for copying a list of files
# into the base directory of the build; this is useful for bundling libs,
# README files or whatever else
define GENERATE_COPY_TARGETS
$(foreach FILE,$1, \
$(eval $(call ADD_COPY_TARGET, \
$(FILE), \
$(addprefix $(B)/,$(notdir $(FILE))))))
endef
ifneq ($(BUILD_CLIENT),0)
$(call GENERATE_COPY_TARGETS,$(CLIENT_EXTRA_FILES))
endif
# Create the build directories and tools, print out
# an informational message, then start building
targets: makedirs
@echo ""
@echo "Building ThreeCore in $(B):"
@echo ""
@echo " PLATFORM: $(PLATFORM)"
@echo " ARCH: $(ARCH)"
@echo " COMPILE_PLATFORM: $(COMPILE_PLATFORM)"
@echo " COMPILE_ARCH: $(COMPILE_ARCH)"
ifdef MINGW
@echo " WINDRES: $(WINDRES)"
endif
@echo " CC: $(CC)"
@echo ""
@echo " CFLAGS:"
@for i in $(CFLAGS); \
do \
echo " $$i"; \
done
@echo ""
@echo " Output:"
@for i in $(TARGETS); \
do \
echo " $$i"; \
done
@echo ""
ifneq ($(TARGETS),)
@$(MAKE) $(TARGETS) V=$(V)
endif
makedirs:
@if [ ! -d $(BUILD_DIR) ];then $(MKDIR) $(BUILD_DIR);fi
@if [ ! -d $(B) ];then $(MKDIR) $(B);fi
@if [ ! -d $(B)/client ];then $(MKDIR) $(B)/client;fi
@if [ ! -d $(B)/rend1 ];then $(MKDIR) $(B)/rend1;fi
ifneq ($(BUILD_SERVER),0)
@if [ ! -d $(B)/ded ];then $(MKDIR) $(B)/ded;fi
endif
#############################################################################
# CLIENT/SERVER
#############################################################################
Q3REND1OBJ = \
$(B)/rend1/tr_arb.o \
$(B)/rend1/tr_backend.o \
$(B)/rend1/tr_bsp.o \
$(B)/rend1/tr_cmds.o \
$(B)/rend1/tr_curve.o \
$(B)/rend1/tr_image.o \
$(B)/rend1/tr_image_png.o \
$(B)/rend1/tr_init.o \
$(B)/rend1/tr_light.o \
$(B)/rend1/tr_main.o \
$(B)/rend1/tr_marks.o \
$(B)/rend1/tr_mesh.o \
$(B)/rend1/tr_model.o \
$(B)/rend1/tr_noise.o \
$(B)/rend1/tr_scene.o \
$(B)/rend1/tr_shade.o \
$(B)/rend1/tr_shade_calc.o \
$(B)/rend1/tr_shader.o \
$(B)/rend1/tr_sky.o \
$(B)/rend1/tr_surface.o \
$(B)/rend1/tr_vbo.o \
$(B)/rend1/tr_world.o
Q3OBJ = \
$(B)/client/cl_cgame.o \
$(B)/client/cl_console.o \
$(B)/client/cl_input.o \
$(B)/client/cl_keys.o \
$(B)/client/cl_main.o \
$(B)/client/cl_net_chan.o \
$(B)/client/cl_parse.o \
$(B)/client/cl_scrn.o \
$(B)/client/cl_ui.o \
\
$(B)/client/cm_load.o \
$(B)/client/cm_patch.o \
$(B)/client/cm_polylib.o \
$(B)/client/cm_test.o \
$(B)/client/cm_trace.o \
\
$(B)/client/cmd.o \
$(B)/client/common.o \
$(B)/client/cvar.o \
$(B)/client/files.o \
$(B)/client/history.o \
$(B)/client/keys.o \
$(B)/client/md4.o \
$(B)/client/md5.o \
$(B)/client/msg.o \
$(B)/client/net_chan.o \
$(B)/client/net_ip.o \
$(B)/client/huffman.o \
$(B)/client/huffman_static.o \
\
$(B)/client/snd_adpcm.o \
$(B)/client/snd_dma.o \
$(B)/client/snd_mem.o \
$(B)/client/snd_mix.o \
$(B)/client/snd_wavelet.o \
\
$(B)/client/snd_main.o \
$(B)/client/snd_codec.o \
$(B)/client/snd_codec_wav.o \
\
$(B)/client/sv_bot.o \
$(B)/client/sv_ccmds.o \
$(B)/client/sv_client.o \
$(B)/client/sv_filter.o \
$(B)/client/sv_game.o \
$(B)/client/sv_init.o \
$(B)/client/sv_main.o \
$(B)/client/sv_net_chan.o \
$(B)/client/sv_snapshot.o \
$(B)/client/sv_world.o \
\
$(B)/client/q_math.o \
$(B)/client/q_shared.o \
\
$(B)/client/unzip.o \
$(B)/client/puff.o \
$(B)/client/vm.o \
$(B)/client/vm_interpreted.o \
$(B)/client/duktape.o \
$(B)/client/js_main.o \
\
$(B)/client/be_aas_bspq3.o \
$(B)/client/be_aas_cluster.o \
$(B)/client/be_aas_entity.o \
$(B)/client/be_aas_file.o \
$(B)/client/be_aas_main.o \
$(B)/client/be_aas_move.o \
$(B)/client/be_aas_reach.o \
$(B)/client/be_aas_route.o \
$(B)/client/be_aas_routealt.o \
$(B)/client/be_aas_sample.o \
$(B)/client/be_ai_move.o \
$(B)/client/be_ea.o \
$(B)/client/be_interface.o \
$(B)/client/l_crc.o \
$(B)/client/l_libvar.o \
$(B)/client/l_log.o \
$(B)/client/l_memory.o \
$(B)/client/l_precomp.o \
$(B)/client/l_script.o \
$(B)/client/l_struct.o
ifeq ($(ARCH),x86)
ifndef MINGW
Q3OBJ += \
$(B)/client/snd_mix_mmx.o \
$(B)/client/snd_mix_sse.o
endif
endif
ifeq ($(ARCH),x86_64)
Q3OBJ += \
$(B)/client/snd_mix_x86_64.o
endif
ifeq ($(ARCH),x86)
Q3OBJ += $(B)/client/vm_x86.o
endif
ifeq ($(ARCH),x86_64)
Q3OBJ += $(B)/client/vm_x86.o
endif
ifeq ($(ARCH),arm)
Q3OBJ += $(B)/client/vm_armv7l.o
endif
ifeq ($(ARCH),aarch64)
Q3OBJ += $(B)/client/vm_aarch64.o
endif
ifeq ($(ARCH),arm64)
Q3OBJ += $(B)/client/vm_aarch64.o
endif
ifdef MINGW
Q3OBJ += \
$(B)/client/win_main.o \
$(B)/client/win_shared.o \
$(B)/client/win_resource.o
Q3OBJ += \
$(B)/client/sdl_glimp.o \
$(B)/client/sdl_gamma.o \
$(B)/client/sdl_input.o \
$(B)/client/sdl_snd.o
else # !MINGW
Q3OBJ += \
$(B)/client/unix_main.o \
$(B)/client/unix_shared.o \
$(B)/client/linux_signals.o
Q3OBJ += \
$(B)/client/sdl_glimp.o \
$(B)/client/sdl_gamma.o \
$(B)/client/sdl_input.o \
$(B)/client/sdl_snd.o
endif # !MINGW
# client binary
$(B)/$(TARGET_CLIENT): $(Q3OBJ) $(Q3REND1OBJ)
$(echo_cmd) "LD $@"
$(Q)$(CC) -o $@ $(Q3OBJ) $(Q3REND1OBJ) $(CLIENT_LDFLAGS) \
$(LDFLAGS)
#############################################################################
# DEDICATED SERVER
#############################################################################
Q3DOBJ = \
$(B)/ded/sv_bot.o \
$(B)/ded/sv_client.o \
$(B)/ded/sv_ccmds.o \
$(B)/ded/sv_filter.o \
$(B)/ded/sv_game.o \
$(B)/ded/sv_init.o \
$(B)/ded/sv_main.o \
$(B)/ded/sv_net_chan.o \
$(B)/ded/sv_snapshot.o \
$(B)/ded/sv_world.o \
\
$(B)/ded/cm_load.o \
$(B)/ded/cm_patch.o \
$(B)/ded/cm_polylib.o \
$(B)/ded/cm_test.o \
$(B)/ded/cm_trace.o \
$(B)/ded/cmd.o \
$(B)/ded/common.o \
$(B)/ded/cvar.o \
$(B)/ded/files.o \
$(B)/ded/history.o \
$(B)/ded/keys.o \
$(B)/ded/md4.o \
$(B)/ded/md5.o \
$(B)/ded/msg.o \
$(B)/ded/net_chan.o \
$(B)/ded/net_ip.o \
$(B)/ded/huffman.o \
$(B)/ded/huffman_static.o \
\
$(B)/ded/q_math.o \
$(B)/ded/q_shared.o \
\
$(B)/ded/unzip.o \
$(B)/ded/vm.o \
$(B)/ded/vm_interpreted.o \
$(B)/ded/duktape.o \
$(B)/ded/js_main.o \
\
$(B)/ded/be_aas_bspq3.o \
$(B)/ded/be_aas_cluster.o \
$(B)/ded/be_aas_entity.o \
$(B)/ded/be_aas_file.o \
$(B)/ded/be_aas_main.o \
$(B)/ded/be_aas_move.o \
$(B)/ded/be_aas_reach.o \
$(B)/ded/be_aas_route.o \
$(B)/ded/be_aas_routealt.o \
$(B)/ded/be_aas_sample.o \
$(B)/ded/be_ai_move.o \
$(B)/ded/be_ea.o \
$(B)/ded/be_interface.o \
$(B)/ded/l_crc.o \
$(B)/ded/l_libvar.o \
$(B)/ded/l_log.o \
$(B)/ded/l_memory.o \
$(B)/ded/l_precomp.o \
$(B)/ded/l_script.o \
$(B)/ded/l_struct.o
ifdef MINGW
Q3DOBJ += \
$(B)/ded/win_main.o \
$(B)/client/win_resource.o \
$(B)/ded/win_shared.o \
$(B)/ded/win_syscon.o
else
Q3DOBJ += \
$(B)/ded/linux_signals.o \
$(B)/ded/unix_main.o \
$(B)/ded/unix_shared.o
endif
ifeq ($(ARCH),x86)
Q3DOBJ += $(B)/ded/vm_x86.o
endif
ifeq ($(ARCH),x86_64)
Q3DOBJ += $(B)/ded/vm_x86.o
endif
ifeq ($(ARCH),arm)
Q3DOBJ += $(B)/ded/vm_armv7l.o
endif
ifeq ($(ARCH),aarch64)
Q3DOBJ += $(B)/ded/vm_aarch64.o
endif
ifeq ($(ARCH),arm64)
Q3DOBJ += $(B)/ded/vm_aarch64.o
endif
$(B)/$(TARGET_SERVER): $(Q3DOBJ)
$(echo_cmd) "LD $@"
$(Q)$(CC) -o $@ $(Q3DOBJ) $(LDFLAGS)
#############################################################################
## CLIENT/SERVER RULES
#############################################################################
$(B)/client/%.o: $(ADIR)/%.s
$(DO_AS)
$(B)/client/%.o: $(CDIR)/%.c
$(DO_CC)
$(B)/client/%.o: $(SDIR)/%.c
$(DO_CC)
$(B)/client/%.o: $(CMDIR)/%.c
$(DO_CC)
$(B)/client/%.o: $(BLIBDIR)/%.c
$(DO_BOT_CC)
$(B)/client/%.o: $(SDLDIR)/%.c
$(DO_CC)
$(B)/rend1/%.o: $(R1DIR)/%.c
$(DO_REND_CC)
$(B)/rend1/%.o: $(RCDIR)/%.c
$(DO_REND_CC)
$(B)/rend1/%.o: $(CMDIR)/%.c
$(DO_REND_CC)
$(B)/client/%.o: $(UDIR)/%.c
$(DO_CC)
$(B)/client/%.o: $(W32DIR)/%.c
$(DO_CC)
$(B)/client/%.o: $(W32DIR)/%.rc
$(DO_WINDRES)
$(B)/ded/%.o: $(ADIR)/%.s
$(DO_AS)
$(B)/ded/%.o: $(SDIR)/%.c
$(DO_DED_CC)
$(B)/ded/%.o: $(CMDIR)/%.c
$(DO_DED_CC)
$(B)/ded/%.o: $(BLIBDIR)/%.c
$(DO_BOT_CC)
$(B)/ded/%.o: $(UDIR)/%.c
$(DO_DED_CC)
$(B)/ded/%.o: $(W32DIR)/%.c
$(DO_DED_CC)
$(B)/ded/%.o: $(W32DIR)/%.rc
$(DO_WINDRES)
install: release
@for i in $(TARGETS); do \
if [ -f $(BR)$$i ]; then \
$(INSTALL) -D -m 0755 "$(BR)/$$i" "$(DESTDIR)$$i"; \
$(STRIP) "$(DESTDIR)$$i"; \
fi \
done