aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh30
1 files changed, 20 insertions, 10 deletions
diff --git a/build.sh b/build.sh
index a93e242..2295b55 100755
--- a/build.sh
+++ b/build.sh
@@ -2,12 +2,11 @@
cd ${0%/*} # go to project root
-FLAGS="-Wall -Wextra -g -pedantic"
+FLAGS="-std=c99 -Wall -Wextra -g -pedantic"
SRCD="src"
ODIR="obj"
BIN="bin"
FILES="files"
-VALGRND=""
RUN=0
function __run__ {
@@ -23,27 +22,38 @@ function __clean__ {
rm -rf $BIN
rm -rf $ODIR
rm -rf $FILES
- kill $( ps -q $$ -o pgid= ) # exit
+ exit 0
+}
+
+function __setup__ {
+ ./download-tilesets.sh $FILES
+ exit 0
+}
+
+function __topng__ {
+ ./ppmtopng.sh $FILES
+ exit 0
}
set -xe
+mkdir -p $BIN
+mkdir -p $ODIR
+mkdir -p $FILES
+
if ! { [[ $# -eq 0 ]]; } 2> /dev/null
then
__$1__
fi
-mkdir -p $BIN
-mkdir -p $ODIR
-mkdir -p $FILES
-
-gcc -c $SRCD/gen_tiles.c -o $ODIR/gen_tiles.o $FLAGS -DPATH=files/tilesets
+gcc -c $SRCD/gen_tiles.c -o $ODIR/gen_tiles.o $FLAGS -DPATH=$FILES
gcc -c $SRCD/ppm.c -o $ODIR/ppm.o $FLAGS
gcc -c $SRCD/tilemap.c -o $ODIR/tilemap.o $FLAGS
-gcc -c $SRCD/tiles.c -o $ODIR/tiles.o $FLAGS
+gcc -c $SRCD/tiles.c -o $ODIR/tiles.o $FLAGS -DPATH=\"$FILES\"
+gcc -c $SRCD/wfc.c -o $ODIR/wfc.o $FLAGS -DPATH=\"$FILES\"
gcc -c $SRCD/main.c -o $ODIR/main.o $FLAGS
-gcc -o $BIN/wfc $ODIR/main.o $ODIR/ppm.o $ODIR/tiles.o $ODIR/tilemap.o $FLAGS
+gcc -o $BIN/wfc $ODIR/main.o $ODIR/wfc.o $ODIR/tiles.o $ODIR/tilemap.o $ODIR/ppm.o $FLAGS
gcc -o $BIN/gen_tiles $ODIR/gen_tiles.o $FLAGS
if ! { [[ $RUN -eq 0 ]]; } 2> /dev/null