aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2025-08-21 22:02:23 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2025-08-21 22:02:23 +0100
commit49a3302fd67e1925b53935939f9a61f6d79b9978 (patch)
tree89699e002fc41e9b79cb65fcacf22b932299606f /build.sh
parent89c77a796d947186ae77a896dc9a99cc9fb4ee2b (diff)
downloadalisp-49a3302fd67e1925b53935939f9a61f6d79b9978.tar.gz
alisp-49a3302fd67e1925b53935939f9a61f6d79b9978.tar.bz2
alisp-49a3302fd67e1925b53935939f9a61f6d79b9978.zip
Split out tests into its own file
Also adjust the build system to do some more (cleaning, building, testing, running).
Diffstat (limited to 'build.sh')
-rw-r--r--build.sh20
1 files changed, 18 insertions, 2 deletions
diff --git a/build.sh b/build.sh
index 7301bc4..544f623 100644
--- a/build.sh
+++ b/build.sh
@@ -3,20 +3,36 @@
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"
+LINK=""
+LIB="sv.c vec.c symtable.c tag.c constructor.c sys.c"
OUT="alisp.out"
build() {
- cc $CFLAGS -o $OUT $SRC;
+ cc $LINK $CFLAGS -o $OUT $LIB main.c;
+ cc $LINK $CFLAGS -o test.out $LIB test.c;
+}
+
+clean() {
+ rm -v $OUT test.out;
}
run() {
./$OUT;
}
+test() {
+ ./test.out
+}
+
build
if [ "$1" = "run" ]
then
run
+elif [ "$1" = "test" ]
+then
+ test
+elif [ "$1" = "clean" ]
+then
+ clean
fi