aboutsummaryrefslogtreecommitdiffhomepage
path: root/justfile
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-05-07 09:13:49 +0900
committernsfisis <nsfisis@gmail.com>2025-05-07 09:13:49 +0900
commit68d9da9746d235e2d9a7d0ba61310c533b355847 (patch)
tree573494cc000416a46c35d5bc5e0788f38a126b20 /justfile
parent9c618db8b3f68356157596aea86e68b10e6a401a (diff)
downloadducc-68d9da9746d235e2d9a7d0ba61310c533b355847.tar.gz
ducc-68d9da9746d235e2d9a7d0ba61310c533b355847.tar.zst
ducc-68d9da9746d235e2d9a7d0ba61310c533b355847.zip
copy files from P4Dcc
Diffstat (limited to 'justfile')
-rw-r--r--justfile50
1 files changed, 50 insertions, 0 deletions
diff --git a/justfile b/justfile
new file mode 100644
index 0000000..24add55
--- /dev/null
+++ b/justfile
@@ -0,0 +1,50 @@
+CFLAGS := "-Wno-builtin-declaration-mismatch"
+
+all: build
+
+build N="1":
+ #!/usr/bin/env bash
+ if [[ {{N}} = 1 ]]; then
+ gcc -g -O0 -o p4dcc main.c {{CFLAGS}}
+ else
+ if [[ {{N}} = 2 ]]; then
+ prev=""
+ else
+ prev=$(({{N}} - 1))
+ fi
+ "./p4dcc${prev}" < main.c > main{{N}}.s
+ gcc -s -Wl,-z,noexecstack -o p4dcc{{N}} main{{N}}.s
+ fi
+
+build-upto-5-gen:
+ just build 1
+ just build 2
+ just build 3
+ just build 4
+ just build 5
+
+test-self-hosted: build-upto-5-gen
+ diff -u ./p4dcc2 ./p4dcc3
+ diff -u ./p4dcc3 ./p4dcc4
+ diff -u ./p4dcc4 ./p4dcc5
+
+test TESTCASE="all" $BIN="p4dcc": build
+ #!/usr/bin/env bash
+ if [[ {{TESTCASE}} = all ]]; then
+ bash tests/all.sh
+ else
+ bash tests/run.sh {{TESTCASE}}
+ fi
+
+test-all:
+ just test-self-hosted
+ just test all p4dcc
+ just test all p4dcc2
+ just test all p4dcc3
+ just test all p4dcc4
+ just test all p4dcc5
+
+clean:
+ rm -f main*.s
+ rm -f p4dcc*
+ rm -rf tests/tmp