forked from dGr8LookinSparky/planet_quake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.q3lite
547 lines (513 loc) · 22.1 KB
/
Makefile.q3lite
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
#
# Q3lite Makefile
#
#===========================================================================
# Copyright (C) 2016-2017 cdev-tux github.com/cdev-tux
#
# This file is part of Q3lite Source Code. https://github.com/cdev-tux/q3lite
#
# Q3lite Source Code is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the License,
# or (at your option) any later version.
#
# Q3lite Source Code is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Q3lite Source Code. If not, see <http://www.gnu.org/licenses/>.
#
# In addition, Q3lite Source Code is also subject to certain additional terms.
# You should have received a copy of these additional terms immediately following
# the terms and conditions of the GNU General Public License. If not, please
# request a copy in writing from id Software at the address below.
# If you have questions concerning this license or the applicable additional
# terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc.,
# Suite 120, Rockville, Maryland 20850 USA.
#===========================================================================
#
#############################################################################
# If PLATFORM_TYPE is set then it's a supported platform.
#############################################################################
ifneq ($(PLATFORM_TYPE),)
ifeq ($(shell uname -m),armv7l)
override ARCH=armv7l
else
override ARCH=arm
endif
echo_cmd=@echo
Q=@
ifndef MOUNT_DIR
MOUNT_DIR=code
endif
SDLHDIR=$(MOUNT_DIR)/SDL2
ifndef Q3LITE_LIB_PATH
Q3LITE_LIB_PATH=/usr/local/lib/q3lite
endif
override COMPILE_ARCH=$(ARCH)
override RENDERER_LIBS=$(SDL_LIBS)
override GIT_REV=
override USE_RENDERER_DLOPEN=1
ifndef BASEGAME
BASEGAME=baseq3
endif
ifndef BR
BR=build/release-linux-$(ARCH)
endif
ifndef CLIENTBIN
CLIENTBIN=quake3
endif
ifndef FULLBINEXT
FULLBINEXT=.$(ARCH)
endif
ifndef Q3LITE_USER
Q3LITE_USER=pi
endif
ifndef CMDIR
CMDIR=$(MOUNT_DIR)/qcommon
endif
ifneq ($(MKDIR),mkdir -p)
override MKDIR=mkdir -p
endif
ifndef MISSIONPACK
MISSIONPACK=missionpack
endif
ifndef SHLIBNAME
SHLIBNAME=$(ARCH).$(SHLIBEXT)
endif
ifndef SHLIBEXT
SHLIBEXT=so
endif
INSTALL=/usr/bin/install
# Add local headers or not
ifeq ($(USE_LOCAL_HEADERS),0)
SDL_CFLAGS += -I/usr/local/include/SDL2
else
SDL_CFLAGS += -I$(SDLHDIR)/include
endif
ifneq ($(call bin_path, pkg-config),)
CURL_CFLAGS ?= $(shell pkg-config --silence-errors --cflags libcurl)
CURL_LIBS ?= $(shell pkg-config --silence-errors --libs libcurl)
SDL_CFLAGS += $(shell pkg-config --silence-errors --cflags sdl2|sed 's/-Dmain=SDL_main//')
FREETYPE_CFLAGS ?= $(shell pkg-config --silence-errors --cflags freetype2)
else
# assume they're in the system default paths (no -I or -L needed)
CURL_LIBS ?= -lcurl
endif
# Use sdl2-config if all else fails
ifneq ($(call bin_path, sdl2-config),)
SDL_CFLAGS += $(shell sdl2-config --cflags)
else
SDL_CFLAGS += -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -D_REENTRANT
endif
SDL_CFLAGS += -Wno-strict-prototypes -Wno-unused -Wno-uninitialized
ifeq ($(USE_VOIP),1)
USE_CODEC_OPUS=1
USE_CODEC_VORBIS=1
else
USE_CODEC_OPUS=0
USE_CODEC_VORBIS=0
endif
ifeq ($(Q3LITE_INSTALL_SDL),1)
override SDL_LIBS=-L/usr/local/lib/q3lite -L/usr/local/lib -L$(Q3LITE_SRC_SDL_PATH) -Wl,-rpath,/usr/local/lib/q3lite:/usr/local/lib -lSDL2 -lpthread
else
override SDL_LIBS=-L/usr/local/lib/q3lite -L/usr/local/lib -Wl,-rpath,/usr/local/lib/q3lite:/usr/local/lib -lSDL2 -lpthread
endif
ifeq ($(PLATFORM_TYPE),raspberrypi) # Pi 1, Zero, Zero W
PI_CFLAGS=-march=armv6zk -mfpu=vfp -mtune=arm1176jzf-s
endif
ifeq ($(PLATFORM_TYPE),raspberrypi2) # Pi 2
PI_CFLAGS=-march=armv7-a -mfpu=vfpv4 -mtune=cortex-a7
endif
ifeq ($(PLATFORM_TYPE),raspberrypi3) # Pi 3
PI_CFLAGS=-march=armv8-a+crc -mfpu=vfpv4 -mtune=cortex-a53
endif
CFLAGS += -DHAVE_GLES $(PI_CFLAGS) -mfloat-abi=hard -Ofast -I/opt/vc/include
ifneq ($(wildcard /opt/vc/lib/libbrcmEGL.so),)
ifneq ($(wildcard /opt/vc/lib/libbrcmGLESv2.so),)
LDFLAGS += -L/opt/vc/lib -lbrcmEGL -lbrcmGLESv2
else
LDFLAGS += -L/opt/vc/lib -lEGL -lGLESv2
endif
else
LDFLAGS += -L/opt/vc/lib -lEGL -lGLESv2
endif
endif #ifneq ($(PLATFORM_TYPE),)
GIT_REVISION=$(shell git show -s --pretty=format:%h)
ifneq ($(GIT_REVISION),)
VERSION=$(shell git tag --contains $(GIT_REVISION) | grep -v [^0-9.v])
ifeq ($(VERSION),)
VERSION=$(shell git tag | grep -v [^0-9.v] | sort -r --version-sort | head -n1)
ifneq ($(VERSION),)
VERSION:=$(VERSION)+$(GIT_REVISION)
override USE_GIT=1
else
VERSION=$(GIT_REVISION)
endif
endif
else
@echo "Unable to determine GIT_REVISION."
endif
#############################################################################
# TARGETS
#############################################################################
q3lite_install: q3lite_makedirs
ifneq ($(BUILD_CLIENT),0)
# Install client binary file.
ifneq ($(wildcard $(BR)/$(CLIENTBIN)$(FULLBINEXT)),)
$(INSTALL) -m 0755 -o root -g root -p $(STRIP_FLAG) $(BR)/$(CLIENTBIN)$(FULLBINEXT) $(Q3LITE_BASEPATH)/$(CLIENTBIN)$(FULLBINEXT)
else
@echo "***Source file $(BR)/$(CLIENTBIN)$(FULLBINEXT) not found, unable to install."
endif
ifneq ($(USE_RENDERER_DLOPEN),0)
ifneq ($(wildcard $(BR)/renderer_opengles1_$(SHLIBNAME)),)
$(INSTALL) -m 0755 -o root -g root -p $(STRIP_FLAG) $(BR)/renderer_opengles1_$(SHLIBNAME) $(Q3LITE_BASEPATH)/renderer_opengles1_$(SHLIBNAME)
else
@echo "***Source file $(BR)/renderer_opengles1_$(SHLIBNAME) not found, unable to install."
endif
ifneq ($(wildcard $(BR)/renderer_opengl1_$(SHLIBNAME)),)
$(INSTALL) -m 0755 -o root -g root -p $(STRIP_FLAG) $(BR)/renderer_opengl1_$(SHLIBNAME) $(Q3LITE_BASEPATH)/renderer_opengl1_$(SHLIBNAME)
else
@echo "***Source file $(BR)/renderer_opengl1_$(SHLIBNAME) not found, unable to install."
endif
ifneq ($(BUILD_RENDERER_OPENGL2),0)
ifneq ($(wildcard $(BR)/renderer_opengl2_$(SHLIBNAME)),)
$(INSTALL) -m 0755 -o root -g root -p $(STRIP_FLAG) $(BR)/renderer_opengl2_$(SHLIBNAME) $(Q3LITE_BASEPATH)/renderer_opengl2_$(SHLIBNAME)
else
@echo "***Source file $(BR)/renderer_opengl2_$(SHLIBNAME) not found, unable to install."
endif
endif
endif
endif
ifneq ($(BUILD_SERVER),0)
# Install server binary file.
ifneq ($(wildcard $(BR)/$(SERVERBIN)$(FULLBINEXT)),)
$(INSTALL) -m 0755 -o root -g root -p $(STRIP_FLAG) $(BR)/$(SERVERBIN)$(FULLBINEXT) $(Q3LITE_BASEPATH)/$(SERVERBIN)$(FULLBINEXT)
else
@echo "***Source file $(BR)/$(SERVERBIN)$(FULLBINEXT) not found, unable to install."
endif
endif
ifneq ($(BUILD_GAME_QVM),0)
ifneq ($(BUILD_BASEGAME),0)
ifneq ($(wildcard $(BR)/$(BASEGAME)/vm/cgame.qvm),)
$(INSTALL) -m 0755 -o root -g root -p $(BR)/$(BASEGAME)/vm/cgame.qvm $(Q3LITE_BASEPATH)/$(BASEGAME)/vm/.
else
@echo "***Source file $(BR)/$(BASEGAME)/vm/cgame.qvm not found, unable to install."
endif
ifneq ($(wildcard $(BR)/$(BASEGAME)/vm/qagame.qvm),)
$(INSTALL) -m 0755 -o root -g root -p $(BR)/$(BASEGAME)/vm/qagame.qvm $(Q3LITE_BASEPATH)/$(BASEGAME)/vm/.
else
@echo "***Source file $(BR)/$(BASEGAME)/vm/qagame.qvm not found, unable to install."
endif
ifneq ($(wildcard $(BR)/$(BASEGAME)/vm/ui.qvm),)
$(INSTALL) -m 0755 -o root -g root -p $(BR)/$(BASEGAME)/vm/ui.qvm $(Q3LITE_BASEPATH)/$(BASEGAME)/vm/.
else
@echo "***Source file $(BR)/$(BASEGAME)/vm/ui.qvm not found, unable to install."
endif
endif
endif
ifneq ($(BUILD_MISSIONPACK),0)
ifneq ($(wildcard $(BR)/$(MISSIONPACK)/vm/cgame.qvm),)
$(INSTALL) -m 0755 -o root -g root -p $(BR)/$(MISSIONPACK)/vm/cgame.qvm $(Q3LITE_BASEPATH)/$(MISSIONPACK)/vm/.
else
@echo "***Source file $(BR)/$(MISSIONPACK)/vm/cgame.qvm not found, unable to install."
endif
ifneq ($(wildcard $(BR)/$(MISSIONPACK)/vm/qagame.qvm),)
$(INSTALL) -m 0755 -o root -g root -p $(BR)/$(MISSIONPACK)/vm/qagame.qvm $(Q3LITE_BASEPATH)/$(MISSIONPACK)/vm/.
else
@echo "***Source file $(BR)/$(MISSIONPACK)/vm/qagame.qvm not found, unable to install."
endif
ifneq ($(wildcard $(BR)/$(MISSIONPACK)/vm/ui.qvm),)
$(INSTALL) -m 0755 -o root -g root -p $(BR)/$(MISSIONPACK)/vm/ui.qvm $(Q3LITE_BASEPATH)/$(MISSIONPACK)/vm/.
else
@echo "***Source file $(BR)/$(MISSIONPACK)/vm/ui.qvm not found, unable to install."
endif
endif
ifneq ($(BUILD_GAME_SO),0)
ifneq ($(BUILD_BASEGAME),0)
ifneq ($(wildcard $(BR)/$(BASEGAME)/cgame$(SHLIBNAME)),)
$(INSTALL) -m 0755 -o root -g root -p $(STRIP_FLAG) $(BR)/$(BASEGAME)/cgame$(SHLIBNAME) $(Q3LITE_BASEPATH)/$(BASEGAME)/.
else
@echo "***Source file $(BR)/$(BASEGAME)/cgame$(SHLIBNAME) not found, unable to install."
endif
ifneq ($(wildcard $(BR)/$(BASEGAME)/qagame$(SHLIBNAME)),)
$(INSTALL) -m 0755 -o root -g root -p $(STRIP_FLAG) $(BR)/$(BASEGAME)/qagame$(SHLIBNAME) $(Q3LITE_BASEPATH)/$(BASEGAME)/.
else
@echo "***Source file $(BR)/$(BASEGAME)/qagame$(SHLIBNAME) not found, unable to install."
endif
ifneq ($(wildcard $(BR)/$(BASEGAME)/ui$(SHLIBNAME)),)
$(INSTALL) -m 0755 -o root -g root -p $(STRIP_FLAG) $(BR)/$(BASEGAME)/ui$(SHLIBNAME) $(Q3LITE_BASEPATH)/$(BASEGAME)/.
else
@echo "***Source file $(BR)/$(BASEGAME)/ui$(SHLIBNAME) not found, unable to install."
endif
endif
ifneq ($(BUILD_MISSIONPACK),0)
ifneq ($(wildcard $(BR)/$(MISSIONPACK)/cgame$(SHLIBNAME)),)
$(INSTALL) -m 0755 -o root -g root -p $(STRIP_FLAG) $(BR)/$(MISSIONPACK)/cgame$(SHLIBNAME) $(Q3LITE_BASEPATH)/$(MISSIONPACK)/.
else
@echo "***Source file $(BR)/$(MISSIONPACK)/cgame$(SHLIBNAME) not found, unable to install."
endif
ifneq ($(wildcard $(BR)/$(MISSIONPACK)/qagame$(SHLIBNAME)),)
$(INSTALL) -m 0755 -o root -g root -p $(STRIP_FLAG) $(BR)/$(MISSIONPACK)/qagame$(SHLIBNAME) $(Q3LITE_BASEPATH)/$(MISSIONPACK)/.
else
@echo "***Source file $(BR)/$(MISSIONPACK)/qagame$(SHLIBNAME) not found, unable to install."
endif
ifneq ($(wildcard $(BR)/$(MISSIONPACK)/ui$(SHLIBNAME)),)
$(INSTALL) -m 0755 -o root -g root -p $(STRIP_FLAG) $(BR)/$(MISSIONPACK)/ui$(SHLIBNAME) $(Q3LITE_BASEPATH)/$(MISSIONPACK)/.
else
@echo "***Source file $(BR)/$(MISSIONPACK)/ui$(SHLIBNAME) not found, unable to install."
endif
endif
endif
# Install updated pak files if available and the user agreed to the EULA.
ifeq ($(Q3LITE_UPDATE),yes)
ifneq ($(wildcard $(Q3LITE_TMP_DIR)/$(BASEGAME)/*.pk3),)
$(INSTALL) -m 0644 -o root -g root -p $(Q3LITE_TMP_DIR)/$(BASEGAME)/*.pk3 $(Q3LITE_BASEPATH)/$(BASEGAME)
else
@echo "***Source files $(Q3LITE_TMP_DIR)/$(BASEGAME)/*.pk3 not found, unable to install."
endif
endif
# Install updated missionpack pak files if available and the user agreed to the EULA.
ifeq ($(Q3LITE_UPDATE),yes)
ifneq ($(BUILD_MISSIONPACK),0)
ifneq ($(wildcard $(Q3LITE_TMP_DIR)/$(MISSIONPACK)/*.pk3),)
$(INSTALL) -m 0644 -o root -g root -p $(Q3LITE_TMP_DIR)/$(MISSIONPACK)/*.pk3 $(Q3LITE_BASEPATH)/$(MISSIONPACK)
else
@echo "***Source files $(Q3LITE_TMP_DIR)/$(MISSIONPACK)/*.pk3 not found, unable to install."
endif
endif
endif
# Install q3lite.png icon.
ifneq ($(wildcard $(Q3LITE_SRC_HOME)/q3lite.png),)
$(INSTALL) -m 0644 -o root -g root -p $(Q3LITE_SRC_HOME)/q3lite.png $(Q3LITE_IMG_DIR)/q3lite.png
else
@echo "***Source file $(Q3LITE_SRC_HOME)/q3lite.png not found, unable to install."
endif
# Install q3lite-server.png icon.
ifneq ($(wildcard $(Q3LITE_SRC_HOME)/q3lite_server.png),)
$(INSTALL) -m 0644 -o root -g root -p $(Q3LITE_SRC_HOME)/q3lite_server.png $(Q3LITE_IMG_DIR)/q3lite_server.png
else
@echo "***Source file $(Q3LITE_SRC_HOME)/q3lite_server.png not found, unable to install."
endif
# Install q3lite_timedemo.png icon.
ifneq ($(wildcard $(Q3LITE_SRC_HOME)/q3lite_timedemo.png),)
$(INSTALL) -m 0644 -o root -g root -p $(Q3LITE_SRC_HOME)/q3lite_timedemo.png $(Q3LITE_IMG_DIR)/q3lite_timedemo.png
else
@echo "***Source file $(Q3LITE_SRC_HOME)/q3lite_timedemo.png not found, unable to install."
endif
# Install q3lite_rcon.png icon.
ifneq ($(wildcard $(Q3LITE_SRC_HOME)/q3lite_rcon.png),)
$(INSTALL) -m 0644 -o root -g root -p $(Q3LITE_SRC_HOME)/q3lite_rcon.png $(Q3LITE_IMG_DIR)/q3lite_rcon.png
else
@echo "***Source file $(Q3LITE_SRC_HOME)/q3lite_timedemo.png not found, unable to install."
endif
# Install q3lite.desktop app menu file.
ifneq ($(wildcard $(Q3LITE_SRC_PLATFORM)/q3lite.desktop),)
$(INSTALL) -m 0644 -o root -g root -p $(Q3LITE_SRC_PLATFORM)/q3lite.desktop $(Q3LITE_LOCAL_APP_DIR)/q3lite.desktop
else
@echo "***Source file $(Q3LITE_SRC_PLATFORM)/q3lite.desktop not found, unable to install."
endif
# Install q3lite_ded.desktop app menu file.
ifneq ($(wildcard $(Q3LITE_SRC_PLATFORM)/q3lite_ded.desktop),)
$(INSTALL) -m 0644 -o root -g root -p $(Q3LITE_SRC_PLATFORM)/q3lite_ded.desktop $(Q3LITE_LOCAL_APP_DIR)/q3lite_ded.desktop
else
@echo "***Source file $(Q3LITE_SRC_PLATFORM)/q3lite_ded.desktop not found, unable to install."
endif
# Install q3lite_timedemo.desktop app menu file.
ifneq ($(wildcard $(Q3LITE_SRC_PLATFORM)/q3lite_timedemo.desktop),)
$(INSTALL) -m 0644 -o root -g root -p $(Q3LITE_SRC_PLATFORM)/q3lite_timedemo.desktop $(Q3LITE_LOCAL_APP_DIR)/q3lite_timedemo.desktop
else
@echo "***Source file $(Q3LITE_SRC_PLATFORM)/q3lite_timedemo.desktop not found, unable to install."
endif
# Install q3lite_rcon.desktop app menu file.
ifneq ($(wildcard $(Q3LITE_SRC_PLATFORM)/q3lite_rcon.desktop),)
$(INSTALL) -m 0644 -o root -g root -p $(Q3LITE_SRC_PLATFORM)/q3lite_rcon.desktop $(Q3LITE_LOCAL_APP_DIR)/q3lite_rcon.desktop
else
@echo "***Source file $(Q3LITE_SRC_PLATFORM)/q3lite_timedemo.desktop not found, unable to install."
endif
# Install q3lite.directory submenu file.
ifneq ($(wildcard $(Q3LITE_SRC_PLATFORM)/q3lite.directory),)
$(INSTALL) -m 0644 -o root -g root -p $(Q3LITE_SRC_PLATFORM)/q3lite.directory $(Q3LITE_DIR_DIR)/q3lite.directory
else
@echo "***Source file $(Q3LITE_SRC_PLATFORM)/q3lite.directory not found, unable to install."
endif
# Install lxde-pi-applications.menu file.
ifneq ($(wildcard $(Q3LITE_SRC_PLATFORM)/lxde-pi-applications.menu),)
$(INSTALL) -m 0644 -o root -g root -p $(Q3LITE_SRC_PLATFORM)/lxde-pi-applications.menu $(Q3LITE_MENU_DIR)/lxde-pi-applications.menu
else
@echo "***Source file $(Q3LITE_SRC_PLATFORM)/lxde-pi-applications.menu not found, unable to install."
endif
# Install q3lite_ded.service systemd service file.
ifneq ($(wildcard $(Q3LITE_SRC_PLATFORM)/q3lite_ded.service),)
$(INSTALL) -m 0644 -o root -g root -p $(Q3LITE_SRC_PLATFORM)/q3lite_ded.service $(Q3LITE_SYSTEMD_DIR)/q3lite_ded.service
else
@echo "***Source file $(Q3LITE_SRC_PLATFORM)/q3lite_ded.service not found, unable to install."
endif
# Install q3admin background server script.
ifneq ($(wildcard $(Q3LITE_SRC_PLATFORM)/q3admin),)
$(INSTALL) -m 0755 -o root -g root -p $(Q3LITE_SRC_PLATFORM)/q3admin $(Q3LITE_BIN_DIR)/q3admin
else
@echo "***Source file $(Q3LITE_SRC_PLATFORM)/q3admin not found, unable to install."
endif
# Install q3lite launch script.
ifneq ($(wildcard $(Q3LITE_SRC_PLATFORM)/q3lite),)
$(INSTALL) -m 0755 -o root -g root -p $(Q3LITE_SRC_PLATFORM)/q3lite $(Q3LITE_BIN_DIR)/q3lite
else
@echo "***Source file $(Q3LITE_SRC_PLATFORM)/q3lite not found, unable to install."
endif
# Install q3lite-ded dedicated server launch script.
ifneq ($(wildcard $(Q3LITE_SRC_PLATFORM)/q3lite-ded),)
$(INSTALL) -m 0755 -o root -g root -p $(Q3LITE_SRC_PLATFORM)/q3lite-ded $(Q3LITE_BIN_DIR)/q3lite-ded
else
@echo "***Source file $(Q3LITE_SRC_PLATFORM)/q3lite-ded not found, unable to install."
endif
# Install rcon command script.
ifneq ($(wildcard $(Q3LITE_SRC_PLATFORM)/rcon),)
$(INSTALL) -m 0755 -o root -g root -p $(Q3LITE_SRC_PLATFORM)/rcon $(Q3LITE_BIN_DIR)/rcon
else
@echo "***Source file $(Q3LITE_SRC_PLATFORM)/rcon not found, unable to install."
endif
# Install rcmd.sh command script.
ifneq ($(wildcard $(Q3LITE_SRC_PLATFORM)/rcmd.sh),)
$(INSTALL) -m 0755 -o root -g root -p $(Q3LITE_SRC_PLATFORM)/rcmd.sh $(Q3LITE_BIN_DIR)/rcmd.sh
else
@echo "***Source file $(Q3LITE_SRC_PLATFORM)/rcmd.sh not found, unable to install."
endif
# Install autoexec.cfg file if it doesn't exist in ~/.q3a/baseq3 (don't overwrite existing file).
ifneq ($(wildcard $(Q3LITE_SRC_HOME)/autoexec.cfg),)
ifneq ($(wildcard $(Q3LITE_HOMEPATH)/$(BASEGAME)/autoexec.cfg),)
@echo "$(Q3LITE_HOMEPATH)/$(BASEGAME)/autoexec.cfg file already exists, skipping file overwrite."
else
$(INSTALL) -m 0644 -o $(Q3LITE_USER) -g $(Q3LITE_USER) -p $(Q3LITE_SRC_HOME)/autoexec.cfg $(Q3LITE_HOMEPATH)/$(BASEGAME)/autoexec.cfg
endif
else
@echo "***Source file $(Q3LITE_SRC_HOME)/autoexec.cfg not found, unable to install."
endif
# Install server.cfg file if it doesn't exist in ~/.q3a/baseq3 (don't overwrite existing file).
ifneq ($(wildcard $(Q3LITE_SRC_HOME)/server.cfg),)
ifneq ($(wildcard $(Q3LITE_HOMEPATH)/$(BASEGAME)/server.cfg),)
@echo "$(Q3LITE_HOMEPATH)/$(BASEGAME)/server.cfg file already exists, skipping file overwrite."
else
$(INSTALL) -m 0644 -o $(Q3LITE_USER) -g $(Q3LITE_USER) -p $(Q3LITE_SRC_HOME)/server.cfg $(Q3LITE_HOMEPATH)/$(BASEGAME)/server.cfg
endif
else
@echo "***Source file $(Q3LITE_SRC_HOME)/server.cfg not found, unable to install."
endif
# Install compatible SDL2 dynamic libs if Q3LITE_INSTALL_SDL=1 and files are available in the source directory.
# If Q3LITE_INSTALL_SDL!=1 then remove the $(Q3LITE_LIB_PATH) folder and files.
ifeq ($(Q3LITE_INSTALL_SDL),1)
ifneq ($(wildcard $(Q3LITE_SRC_SDL_PATH)/libSDL2-2.0.so.0.9.0),)
$(INSTALL) -m 0755 -o root -g root -p $(STRIP_FLAG) $(Q3LITE_SRC_SDL_PATH)/libSDL2-2.0.so.0.9.0 $(Q3LITE_LIB_PATH)/libSDL2-2.0.so.0.9.0
else
@echo "***Source file $(Q3LITE_SRC_SDL_PATH)/libSDL2-2.0.so.0.9.0 not found, unable to install."
endif
ifneq ($(wildcard $(Q3LITE_SRC_SDL_PATH)/libSDL2-2.0.so.0),)
cp -Ppf $(Q3LITE_SRC_SDL_PATH)/libSDL2-2.0.so.0 $(Q3LITE_LIB_PATH)/libSDL2-2.0.so.0
else
@echo "***Source file $(Q3LITE_SRC_SDL_PATH)/libSDL2-2.0.so.0 not found, unable to install."
endif
ifneq ($(wildcard $(Q3LITE_SRC_SDL_PATH)/libSDL2.so),)
cp -Ppf $(Q3LITE_SRC_SDL_PATH)/libSDL2.so $(Q3LITE_LIB_PATH)/libSDL2.so
else
@echo "***Source file $(Q3LITE_SRC_SDL_PATH)/libSDL2.so not found, unable to install."
endif
else
rm -f -r $(Q3LITE_LIB_PATH)
endif
@echo ""
q3lite_uninstall: q3lite_rmdirs
# Uninstall q3lite.png icon.
rm -f $(Q3LITE_IMG_DIR)/q3lite.png
# Uninstall q3lite-server.png icon.
rm -f $(Q3LITE_IMG_DIR)/q3lite_server.png
# Uninstall q3lite_timedemo.png icon.
rm -f $(Q3LITE_IMG_DIR)/q3lite_timedemo.png
# Uninstall q3lite-rcon.png icon.
rm -f $(Q3LITE_IMG_DIR)/q3lite_rcon.png
# Uninstall q3lite.desktop app menu file.
rm -f $(Q3LITE_LOCAL_APP_DIR)/q3lite.desktop
# Uninstall q3lite_ded.desktop app menu file.
rm -f $(Q3LITE_LOCAL_APP_DIR)/q3lite_ded.desktop
# Uninstall q3lite_timedemo.desktop app menu file.
rm -f $(Q3LITE_LOCAL_APP_DIR)/q3lite_timedemo.desktop
# Uninstall q3lite_rcon.desktop app menu file.
rm -f $(Q3LITE_LOCAL_APP_DIR)/q3lite_rcon.desktop
# Uninstall q3lite.directory submenu file.
rm -f $(Q3LITE_DIR_DIR)/q3lite.directory
# Uninstall lxde-pi-applications.menu file.
rm -f $(Q3LITE_MENU_DIR)/lxde-pi-applications.menu
# Uninstall q3lite_ded.service systemd service file.
rm -f $(Q3LITE_SYSTEMD_DIR)/q3lite_ded.service
# Uninstall q3lite script.
rm -f $(Q3LITE_BIN_DIR)/q3lite
# Uninstall q3lite-ded server script.
rm -f $(Q3LITE_BIN_DIR)/q3lite-ded
# Uninstall rcon command script.
rm -f $(Q3LITE_BIN_DIR)/rcon
# Uninstall rcmd.sh command script.
rm -f $(Q3LITE_BIN_DIR)/rcmd.sh
# Uninstall q3admin background server script.
rm -f $(Q3LITE_BIN_DIR)/q3admin
@echo "Removing the 'quake3' user"
$(shell userdel -fr quake3 2> /dev/null)
@echo ""
q3lite_makedirs:
ifneq ($(BUILD_BASEGAME),0)
-$(MKDIR) -m 0755 $(Q3LITE_BASEPATH)/$(BASEGAME)
endif
ifneq ($(BUILD_MISSIONPACK),0)
-$(MKDIR) -m 0755 $(Q3LITE_BASEPATH)/$(MISSIONPACK)
endif
ifneq ($(BUILD_GAME_QVM),0)
ifneq ($(BUILD_BASEGAME),0)
-$(MKDIR) -m 0755 $(Q3LITE_BASEPATH)/$(BASEGAME)/vm
endif
ifneq ($(BUILD_MISSIONPACK),0)
-$(MKDIR) -m 0755 $(Q3LITE_BASEPATH)/$(MISSIONPACK)/vm
endif
endif
ifneq ($(Q3LITE_HOMEPATH),)
-$(MKDIR) -m 0775 $(Q3LITE_HOMEPATH)/$(BASEGAME)
ifneq ($(Q3LITE_HOMEPATH)/$(BASEGAME),)
chown $(Q3LITE_USER):$(Q3LITE_USER) $(Q3LITE_HOMEPATH)/$(BASEGAME)
chmod 777 $(Q3LITE_HOMEPATH)/$(BASEGAME)
endif
ifneq ($(BUILD_MISSIONPACK),0)
-$(MKDIR) -m 0775 $(Q3LITE_HOMEPATH)/$(MISSIONPACK)
ifneq ($(Q3LITE_HOMEPATH)/$(MISSIONPACK),)
chown $(Q3LITE_USER):$(Q3LITE_USER) $(Q3LITE_HOMEPATH)/$(MISSIONPACK)
chmod 777 $(Q3LITE_HOMEPATH)/$(MISSIONPACK)
endif
endif
chown $(Q3LITE_USER):$(Q3LITE_USER) $(Q3LITE_HOMEPATH)
chmod 777 $(Q3LITE_HOMEPATH)
endif
ifneq ($(Q3LITE_LOCAL_APP_DIR),)
-$(MKDIR) -m 0775 $(Q3LITE_LOCAL_APP_DIR)
endif
ifneq ($(Q3LITE_DIR_DIR),)
-$(MKDIR) -m 0775 $(Q3LITE_DIR_DIR)
endif
ifneq ($(Q3LITE_MENU_DIR),)
-$(MKDIR) -m 0775 $(Q3LITE_MENU_DIR)
endif
ifneq ($(Q3LITE_LIB_PATH),)
ifeq ($(Q3LITE_INSTALL_SDL),1)
-$(MKDIR) -m 0775 $(Q3LITE_LIB_PATH)
chown -R root:staff $(Q3LITE_LIB_PATH)
endif
endif
q3lite_rmdirs:
rm -f -r $(Q3LITE_BASEPATH)
rm -f -r $(Q3LITE_TMP_DIR)
rm -f -r $(Q3LITE_LIB_PATH)
#############################################################################
# DEPENDENCIES
#############################################################################
.PHONY: q3lite_install q3lite_makedirs q3lite_rmdirs
# If the target name contains "clean", don't do a parallel build
ifneq ($(findstring clean, $(MAKECMDGOALS)),)
.NOTPARALLEL:
endif