summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-06-12 12:12:58 +0200
committerkdx <kikoodx@paranoici.org>2023-06-12 12:12:58 +0200
commitacb633cc836a3068b597c89d4f160c5ab6e22fa7 (patch)
tree4a7048ae886e69c47cfc48a7fbc31fa61b41b906
parent07fe6662c369f85c4fa8c0d4a002bd42258851f0 (diff)
downloadgolem-acb633cc836a3068b597c89d4f160c5ab6e22fa7.tar.gz
build.sh alternative to tup
-rwxr-xr-xbuild.sh8
-rwxr-xr-xrun.sh2
-rwxr-xr-xtesting.sh2
3 files changed, 10 insertions, 2 deletions
diff --git a/build.sh b/build.sh
new file mode 100755
index 0000000..5e195b4
--- /dev/null
+++ b/build.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+CC=gcc
+CFLAGS='-s -O3 -std=c99 -Wall -Wextra'
+LIBS=
+NAME=build/golemc
+mkdir -p build
+$CC $CFLAGS -o "$NAME" src/main.c $LIBS
+printf '%s\n' "$NAME"
diff --git a/run.sh b/run.sh
index 4cf6869..9fa29f8 100755
--- a/run.sh
+++ b/run.sh
@@ -1,5 +1,5 @@
#!/bin/sh
-tup -q || exit 1
+tup -q || ./build.sh || exit 1
./build/golemc "$1" >build/tmp.orgaasm || exit 1
orgaasm build/tmp.orgaasm build/tmp.rom || exit 1
orgaemu build/tmp.rom
diff --git a/testing.sh b/testing.sh
index 98b8377..532d054 100755
--- a/testing.sh
+++ b/testing.sh
@@ -12,7 +12,7 @@ function test() {
[ "$QUIET" != "-q" ] && echo ""
}
-tup -q || exit 1
+tup -q || ./build.sh || exit 1
test "$1" "main(){5 + 2; return 4;}"
test "$1" "main(){6 + 3;}"
test "$1" "main(){'a' - 'b';}"