main.c and test.c generate binary executables so they can stay in the main folder, but the rest can go into their own dedicated folder to make it look nicer
39 lines
540 B
Bash
39 lines
540 B
Bash
#!/usr/bin/env sh
|
|
|
|
set -xe
|
|
|
|
CFLAGS="-Wall -Wextra -std=c11 -ggdb -fsanitize=address -fsanitize=undefined"
|
|
LINK="-I."
|
|
LIB="impl/sv.c impl/vec.c impl/symtable.c impl/tag.c impl/constructor.c impl/stream.c impl/sys.c"
|
|
OUT="alisp.out"
|
|
|
|
build() {
|
|
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
|