21 lines
744 B
Bash
21 lines
744 B
Bash
cd "$(git rev-parse --show-toplevel)"
|
|
|
|
CFLAGS="$CFLAGS -std=c11 -pedantic -Wall -Wextra"
|
|
CFLAGS="$CFLAGS -fsanitize=address,undefined"
|
|
CFLAGS="$CFLAGS -O0 -ggdb"
|
|
|
|
if [ ! -e build ]; then mkdir build; else rm build/*; fi
|
|
|
|
# Build library
|
|
clang $CFLAGS -Ilib -c lib/parse.c -o build/parse.o
|
|
clang $CFLAGS -Ilib -c lib/desugar.c -o build/desugar.o
|
|
clang $CFLAGS -Ilib -c lib/regex.c -o build/regex.o
|
|
ar -crs build/lib.a build/parse.o build/desugar.o build/regex.o
|
|
|
|
# Build tests
|
|
clang $CFLAGS -Itests -c tests/testing.c -o build/testing.o
|
|
clang $CFLAGS -Ilib -Itests -o build/parse_tests \
|
|
tests/parse_tests.c build/testing.o build/lib.a
|
|
clang $CFLAGS -Ilib -Itests -o build/desugar_tests \
|
|
tests/desugar_tests.c build/testing.o build/lib.a
|