aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2022-08-12 15:13:00 +0300
committerkartofen <mladenovnasko0@gmail.com>2022-08-12 15:13:00 +0300
commit8aabe7061552063a2f0be4ba6c1da44e383c0931 (patch)
tree738c09d3765f2d2bac971a8b6503ef5f565c6121 /build.sh
parent01d4df646900c9581a9680dad80f846864938f91 (diff)
edit build script
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh13
1 files changed, 6 insertions, 7 deletions
diff --git a/build.sh b/build.sh
index a419369..0656dfa 100755
--- a/build.sh
+++ b/build.sh
@@ -1,26 +1,24 @@
#!/bin/sh
cd ${0%/*} # go to project root
-set -xe
FLAGS="-Wall -Wextra -g -pedantic"
SRCD="src"
ODIR="obj"
BIN="bin"
VALGRND=""
-
RUN=0
-function run {
+function __run__ {
RUN=1
}
-function leak {
+function __leak__ {
VALGRND="valgrind --leak-check=full --show-leak-kinds=all -s"
RUN=1
}
-function clean {
+function __clean__ {
rm -rf $BIN
rm -rf $ODIR
rm -rf files/tiles
@@ -28,15 +26,16 @@ function clean {
kill $( ps -q $$ -o pgid= ) # exit
}
+set -xe
+
if ! { [[ $# -eq 0 ]]; } 2> /dev/null
then
- $1
+ __$1__
fi
mkdir -p $ODIR
mkdir -p $BIN
-
gcc -c $SRCD/gen_tiles.c -o $ODIR/gen_tiles.o $FLAGS
gcc -c $SRCD/ppm.c -o $ODIR/ppm.o $FLAGS
gcc -c $SRCD/tilemap.c -o $ODIR/tilemap.o $FLAGS