2 # WARNING! SHITTY CODE!
5 defines
="-DWIZARD -DLOCAL_SAVES"
6 cflags
="-Wno-narrowing -Isrc/felib -m32"
7 cflags
="${cflags} -fno-aggressive-loop-optimizations -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-strict-overflow -fwrapv"
16 while [ $# -gt 0 ]; do
17 if [ "z$1" = "zshitdoze" ]; then
19 elif [ "z$1" = "zforce" ]; then
22 echo "FATAL: unknown arg: $1"
29 if [ $shitdoze = tan
]; then
30 ARCH
="i686-w64-mingw32.static-"
32 defines
="${defines} -DSHITDOZE"
33 BUILD_DIR
="${BUILD_DIR}_shitdoze"
34 linkflags
="-Wl,-subsystem,windows"
38 cflags
="${cflags} -Wno-misleading-indentation"
43 PKGCONFIG
="${ARCH}pkg-config"
47 if [ "z$2" != "z" ]; then
48 $PKGCONFIG --silence-errors $1 --atleast-version=$2
50 $PKGCONFIG --silence-errors $1
52 if [ "$?" = "0" ]; then
53 cflags
="${cflags} `$PKGCONFIG $1 --cflags`"
54 lflags
="${lflags} `$PKGCONFIG $1 --libs`"
55 #echo "MSG: package '$1' found"
58 #echo "MSG: no package '$1'"
66 # $3: use gcc if not empty
74 obj
=`basename $2 .cpp`
75 obj
=`basename $obj .c`
77 obj
="${BUILD_DIR}/${obj}"
78 objects
="${objects} ${obj}"
79 xname
=`basename -s .c "$2"`
80 if [ "z$xname" = "z$2" ]; then
82 gppopt
="-std=gnu++14 -fpermissive"
87 if [ $FORCE != tan
]; then
88 if [ -e ${obj} ]; then
89 fstime
=`stat '--format=%Y' "$1/$2"`
90 fotime
=`stat '--format=%Y' ${obj}`
91 if [ $fotime -ge $fstime ]; then
96 $GCC -pipe -c -O2 -Wall -Isrc/game
${gppopt} ${defines} ${cflags} -o ${obj} "$1/$2"
97 if [ "$?" != "0" ]; then
98 echo "FATAL: compilation failed!"
105 echo "LINK ivan${BINSUFF}"
106 #echo "============="
108 #echo "============="
110 #echo "============="
111 $GPP -pipe -s -o ivan
${BINSUFF} ${objects} ${lflags} ${linkflags}
112 if [ "$?" != "0" ]; then
113 echo "FATAL: linking failed!"
116 ${ARCH}strip
-s ivan
${BINSUFF}
121 if [ "$have_package" != "tan" ]; then
122 echo "FATAL: you need SDL development package installed, version 1.2 or above!"
127 if [ "$have_package" = "tan" ]; then
128 echo "MSG: OpenGL renderer enabled"
130 echo "FATAL: you need OpenGL development package installed!"
134 find_package libpng
1.6
135 if [ "$have_package" = "tan" ]; then
136 echo "MSG: libpng found"
138 find_package libpng16
1.6
139 if [ "$have_package" = "tan" ]; then
140 echo "MSG: libpng found"
142 echo "FATAL: you need libpng v1.6 development package installed!"
147 find_package SDL_mixer
1.2
148 if [ "$have_package" != "tan" ]; then
149 echo "MSG: no SDL_mixer package found, sound disabled"
150 defines
="${defines} -DDISABLE_SOUND"
152 echo "MSG: sound support enabled"
155 find_package zlib
1.2
156 if [ "$have_package" = "tan" ]; then
157 defines
="${defines} -DUSE_ZLIB"
158 echo "MSG: compressed saves enabled"
162 if [ "$have_package" = "tan" ]; then
163 echo "MSG: ALSA silencing enabled"
164 defines
="${defines} -DENABLE_ALSA"
167 #echo "CFLAGS: ${cflags}"
168 #echo "DEFINES: ${defines}"
170 mkdir
${BUILD_DIR} 2>/dev
/null
172 compile src
/felib bitmap.cpp
173 compile src
/felib config.cpp
174 compile src
/felib feerror.cpp
175 compile src
/felib feio.cpp
176 compile src
/felib felist.cpp
177 compile src
/felib femain.cpp
178 compile src
/felib femath.cpp
179 compile src
/felib festring.cpp
180 compile src
/felib fetime.cpp
181 compile src
/felib graphics.cpp
182 compile src
/felib hscore.cpp
183 compile src
/felib rawbit.cpp
184 compile src
/felib fesave.cpp
185 compile src
/felib feparse.cpp
186 compile src
/felib whandler.cpp
187 compile src
/felib regex.c
189 compile src
/game ivancommon.cpp
190 compile src
/game actset.cpp
191 compile src
/game areaset.cpp
192 compile src
/game charset.cpp
193 compile src
/game
command.cpp
194 compile src
/game coreset.cpp
195 compile src
/game dataset.cpp
196 compile src
/game dungeon.cpp
197 compile src
/game game.cpp
198 compile src
/game godset.cpp
199 compile src
/game iconf.cpp
200 compile src
/game id.cpp
201 compile src
/game igraph.cpp
202 compile src
/game itemset.cpp
203 compile src
/game levelset.cpp
204 compile src
/game main.cpp
205 compile src
/game materset.cpp
206 compile src
/game message.cpp
207 compile src
/game object.cpp
208 compile src
/game roomset.cpp
209 compile src
/game
script.cpp
210 compile src
/game slotset.cpp
211 compile src
/game trapset.cpp
212 compile src
/game wmapset.cpp
213 compile src
/game wskill.cpp