aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorbonmas14 <bonmas14@gmail.com>2025-09-25 12:06:11 +0000
committerbonmas14 <bonmas14@gmail.com>2025-09-25 12:06:11 +0000
commit3ad95773ae4f963435003c260278177f1e22577e (patch)
treedf06105a74760a1138ad6e42bf8c1445ec3bfc8d /build.sh
parent166877cf15f6afa89c9f8a61e267d485868d0ee1 (diff)
downloadungrateful-3ad95773ae4f963435003c260278177f1e22577e.tar.gz
ungrateful-3ad95773ae4f963435003c260278177f1e22577e.zip
Working on linux
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh29
1 files changed, 28 insertions, 1 deletions
diff --git a/build.sh b/build.sh
index 82eb864..e67c3ab 100755
--- a/build.sh
+++ b/build.sh
@@ -4,7 +4,7 @@ cc="gcc"
ld="gcc"
ar="ar"
-cflags="-std=c99 -fPIC -Wall -Wextra -g -Wno-error -pedantic -lm -ffast-math"
+cflags="-std=c99 -fPIC -Wall -Wno-unused-function -Wextra -g -Wno-error -pedantic -lm -ffast-math"
proc=$(nproc)
@@ -38,11 +38,23 @@ if [[ $? -ne 0 ]]; then
exit
fi
+echo "[BUILD] cynic.c"
+
+$cc $cflags -Isrc/ \
+ -c -o obj/disgrace.o \
+ -g src/disgrace.c
+
+if [[ $? -ne 0 ]]; then
+ exit
+fi
+
$ar rcs lib/libungrateful.a obj/ungrateful.o
$ar rcs lib/libcynic.a obj/cynic.o
+$ar rcs lib/libdisgrace.a obj/disgrace.o
cp src/ungrateful.h include/ungrateful.h
cp src/cynic.h include/cynic.h
+cp src/disgrace.h include/disgrace.h
# ------------ Tests from here
#
@@ -82,6 +94,21 @@ for test in tests/cyn/*.c; do
fi
done
+echo "---- Disgrace tests ----"
+
+for test in tests/d/*.c; do
+ fname=$(basename -- "$test")
+ fname="${fname%.*}"
+
+ echo "[BUILD] $test"
+
+ $cc $cflags -o bin/$fname $test -Llib/ -Iinclude/ -lungrateful -lcynic -ldisgrace &
+
+ if [[ $(jobs -r -p | wc -l) -ge $proc ]]; then
+ wait
+ fi
+done
+
wait
echo "---- Compiled ----"