-
Notifications
You must be signed in to change notification settings - Fork 53
/
build_qc.sh
executable file
·119 lines (100 loc) · 4.39 KB
/
build_qc.sh
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
#!/bin/bash
#FTEQCC and FTEQW must be defined.
#QSS should be defined...
BUILDFOLDER=~/htdocs
BUILDLOGFOLDER=$BUILDFOLDER/build_logs
if [ "$FTEQCC" == "" ]; then
QSS=~/htdocs/qss/quakespasm-spiked-linux64
FTEQW=~/htdocs/linux_amd64/fteqw64
FTEQCC=~/htdocs/linux_amd64/fteqcc64
fi
#this really should use the native cpu type... until then we use 32bit in case anyone's still using a 32bit kernel.
if [ "$FTEQW" != "" ]; then
echo "--- QC builds ---"
echo "Making fteextensions.qc"
BASEDIR=~/.fte
GAMEDIR=fte
mkdir -p $BASEDIR/$GAMEDIR/src
#generate fte's extensions
CFG=$BASEDIR/fte/minusargsaresilly.cfg
echo "pr_dumpplatform -o fteextensions" > $CFG
echo "pr_dumpplatform -o csqcsysdefs -Tcs" >> $CFG
echo "pr_dumpplatform -o menusysdefs -Tmenu" >> $CFG
$FTEQW -basedir $BASEDIR -nohome -quake -game $GAMEDIR +set snd_device none -nosound +set vid_renderer sv +exec minusargsaresilly.cfg +quit >> /dev/null
#if we have fteqcc available then try to generate some symbol lists for our generic defs
if [ "$FTEQCC" != "" ]; then
#get QSS to spit out its defs for completeness.
if [ "$QSS" != "" ] && [ -e "$BASEDIR/id1/pak1.pak" ] && [ -e "$QSS" ]; then
CFG=$BASEDIR/$GAMEDIR/gen.cfg
echo "pr_dumpplatform -Oqscsextensions -Tcs" > $CFG
echo "pr_dumpplatform -Oqsextensions -Tss" >> $CFG
echo "pr_dumpplatform -Oqsmenuextensions -Tmenu" >> $CFG
$QSS -dedicated -nohome -game $GAMEDIR -basedir $BASEDIR +exec gen.cfg +quit >>/dev/null
else
echo "QSS not available?"
fi
if [ ! -e "$BASEDIR/fte/src/dpsymbols.src" ]; then
ln -sr quakec/dpsymbols.src $BASEDIR/$GAMEDIR/src/
fi
if [ ! -e "$BASEDIR/fte/src/dpdefs/" ]; then
echo "no dpdefs subdir found in $BASEDIR/fte/src/ ... manual intervention required"
fi
#generate symbol tables from the various engines's defs
( cd $BASEDIR/$GAMEDIR/src
$FTEQCC -Fdumpsymbols -oqsscs.dat qscsextensions.qc && sort -o qss_cs.sym qsscs.dat.sym
$FTEQCC -Fdumpsymbols -oqssss.dat qsextensions.qc && sort -o qss_ss.sym qssss.dat.sym
$FTEQCC -Fdumpsymbols -oqssmn.dat qsmenuextensions.qc && sort -o qss_menu.sym qssmn.dat.sym
$FTEQCC -Fdumpsymbols -oftecs.dat -DCSQC fteextensions.qc && sort -o fte_cs.sym ftecs.dat.sym
$FTEQCC -Fdumpsymbols -oftess.dat -DSSQC fteextensions.qc && sort -o fte_ss.sym ftess.dat.sym
$FTEQCC -Fdumpsymbols -oftemn.dat -DMENU fteextensions.qc && sort -o fte_menu.sym ftemn.dat.sym
$FTEQCC -Fdumpsymbols -odpcs.dat -DCSQC dpsymbols.src && sort -o dp_cs.sym dpcs.dat.sym
$FTEQCC -Fdumpsymbols -odpss.dat -DSSQC dpsymbols.src && sort -o dp_ss.sym dpss.dat.sym
$FTEQCC -Fdumpsymbols -odpmn.dat -DMENU dpsymbols.src && sort -o dp_menu.sym dpmn.dat.sym
) >>/dev/null
#generate generic extensions
CFG=$BASEDIR/fte/minusargsaresilly.cfg
echo "pr_dumpplatform -Ocsqc_api -Fdepfilter -Tsimplecs" > $CFG
echo "pr_dumpplatform -Ofte_csqc_api -Fdepfilter -Tcs" >> $CFG
echo "pr_dumpplatform -Odp_csqc_api -Fdepfilter -Tdpcs" >> $CFG
echo "pr_dumpplatform -Ossqc_api -Fdepfilter -Tnq" >> $CFG
echo "pr_dumpplatform -Omenu_api -Fdepfilter -Tmenu" >> $CFG
$FTEQW -basedir $BASEDIR -nohome -quake -game $GAMEDIR +set snd_device none -nosound +set vid_renderer sv +exec minusargsaresilly.cfg +quit >> /dev/null
fi
#fix up and copy the results somewhere useful
rm $CFG
mkdir -p $BUILDFOLDER/ftedefs $BUILDFOLDER/genericdefs
mv $BASEDIR/$GAMEDIR/src/fteextensions.qc $BUILDFOLDER/ftedefs
mv $BASEDIR/$GAMEDIR/src/csqcsysdefs.qc $BUILDFOLDER/ftedefs
mv $BASEDIR/$GAMEDIR/src/menusysdefs.qc $BUILDFOLDER/ftedefs
mv $BASEDIR/$GAMEDIR/src/*_api.qc $BUILDFOLDER/genericdefs
fi
if [ "$FTEQCC" != "" ]; then
mkdir -p $BUILDFOLDER/csaddon/
( cd quakec/csaddon/src
echo -n "Making csaddon... "
$FTEQCC -srcfile csaddon.src > $BUILDLOGFOLDER/csaddon.txt 2>&1
if [ $? -eq 0 ]; then
echo "done"
cp ../csaddon.dat $BUILDFOLDER/csaddon/
cd ..
zip -q9 $BUILDFOLDER/csaddon/csaddon.pk3 csaddon.dat
else
echo "failed"
fi
)
( cd quakec/menusys
echo -n "Making menusys... "
$FTEQCC -srcfile menu.src > $BUILDLOGFOLDER/menu.txt 2>&1
if [ $? -eq 0 ]; then
echo "done"
zip -q -q9 -o -r $BUILDFOLDER/csaddon/menusys_src.zip .
cp ../menu.dat $BUILDFOLDER/csaddon/
cd ..
zip -q9 $BUILDFOLDER/csaddon/menusys.pk3 menu.dat
else
echo "failed"
fi
)
else
echo "Skiping csaddon + qcmenu, no compiler build"
fi