aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rw-r--r--build.sh17
1 files changed, 15 insertions, 2 deletions
diff --git a/build.sh b/build.sh
index 878c28c..7301bc4 100644
--- a/build.sh
+++ b/build.sh
@@ -1,9 +1,22 @@
#!/usr/bin/env sh
+set -xe
+
CFLAGS="-Wall -Wextra -std=c11 -ggdb -fsanitize=address -fsanitize=undefined"
SRC="vec.c symtable.c tag.c constructor.c sys.c main.c"
OUT="alisp.out"
-set -xe
+build() {
+ cc $CFLAGS -o $OUT $SRC;
+}
+
+run() {
+ ./$OUT;
+}
+
+build
-cc $CFLAGS -o $OUT $SRC;
+if [ "$1" = "run" ]
+then
+ run
+fi