forked from Jason2Brownlee/CleanFixedQuakeC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
102 lines (95 loc) · 2.52 KB
/
Makefile
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
# makefile
# list of targets that should always run
.PHONY : clean build dist run
# current version of the release
VERSION=1.6
# release filename
RELEASE=quake_progs_gpl_v${VERSION}.zip
# directory where the qc files are compiled
DIR_BUILD=$(CURDIR)/build
# directory where release artifacts are placed
DIR_DIST=$(CURDIR)/dist
# location of quakec source code
DIR_QC=$(CURDIR)/qc
# location of compilers
DIR_COMPILERS=$(CURDIR)/compilers
# specify preferred quakec compiler
QUAKEC=fteqcc
# qcc (idsoftware)
ifeq ($(QUAKEC),qcc)
# filename of quakec compiler
QCCNAME=qcc
# location of the quakec compiler
QCCCOMPILER=$(DIR_COMPILERS)/qcc/${QCCNAME}
# quakec compiler flags
QCFLAGS=
endif
# gmqcc
ifeq ($(QUAKEC),gmqcc)
QCCNAME=gmqcc
# location of the quakec compiler
QCCCOMPILER=$(DIR_COMPILERS)/gmqcc/${QCCNAME}
# quakec compiler flags
QCFLAGS=-std=qcc -Wall
endif
# fteqcc
ifeq ($(QUAKEC),fteqcc)
# filename of quakec compiler
QCCNAME=fteqcc
# location of the quakec compiler
QCCCOMPILER=$(DIR_COMPILERS)/fteqcc/${QCCNAME}
# quakec compiler flags
QCFLAGS=-Wall
endif
# frikqcc
ifeq ($(QUAKEC),frikqcc)
# filename of quakec compiler
QCCNAME=frikqcc
# location of the quakec compiler
QCCCOMPILER=$(DIR_COMPILERS)/frikqcc/${QCCNAME}
# quakec compiler flags
QCFLAGS=-warn 9
endif
# meqcc
ifeq ($(QUAKEC),meqcc)
# filename of quakec compiler
QCCNAME=qcc
# location of the quakec compiler
QCCCOMPILER=$(DIR_COMPILERS)/meqcc/${QCCNAME}
# quakec compiler flags
QCFLAGS=
endif
# compile the quakec source code
build:
# create the required directories
mkdir -p ${DIR_BUILD}
mkdir -p ${DIR_DIST}
# compile quakec source
cp -r ${DIR_QC} ${DIR_BUILD}/
cp ${QCCCOMPILER} ${DIR_BUILD}/qc/
cd ${DIR_BUILD}/qc/;./${QCCNAME} ${QCFLAGS};true
rm ${DIR_BUILD}/qc/${QCCNAME}
# create a release
dist: clean build
# put the documentation into position
cp $(CURDIR)/*.txt ${DIR_BUILD}
cp $(CURDIR)/*.md ${DIR_BUILD}
# create the archive
cd ${DIR_BUILD};zip -r ${RELEASE} qc progs.dat *.txt *.md
# place the release for distribution
cp ${DIR_BUILD}/${RELEASE} ${DIR_DIST}
# delete all build and release artifacts
clean:
rm -rf ${DIR_BUILD}
rm -rf ${DIR_DIST}
# hack for testing changes
DIR=/Users/jasonb/Games/QuakeDev
GAME=test1
MAP=e1m1
run: clean build
# create directory if needed
mkdir -p $(DIR)/$(GAME)
# copy progs into place
cp ${DIR_BUILD}/progs.dat $(DIR)/$(GAME)
# start quakespasm
open $(DIR)/QuakeSpasm-SDL2.app --args -nolauncher -basedir $(DIR) -game $(GAME) +map $(MAP) +developer 1 -width 1024 -height 768 -bpp 32 -window -nosound