]> git.xolatile.top Git - public-libhl.git/commitdiff
Isolate chad.mk
authorEmil <emilwilliams@tuta.io>
Mon, 21 Aug 2023 13:19:40 +0000 (07:19 -0600)
committerEmil <emilwilliams@tuta.io>
Mon, 21 Aug 2023 13:19:40 +0000 (07:19 -0600)
Makefile
tests/chad.mk [new file with mode: 0644]

index 3b90c07597fbd1c689a492b48518fa47045a0f20..4bbf0423bf08fb6e0c38e764bd5b1b47cce46cdb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
 include config.mk
+include tests/chad.mk
 
 SRC.dir:=source
 OBJ.dir:=obj
diff --git a/tests/chad.mk b/tests/chad.mk
new file mode 100644 (file)
index 0000000..fe9fa97
--- /dev/null
@@ -0,0 +1,18 @@
+# Programs to check warnings for as defined by the chad standard
+
+GCC:=gcc
+GCC.warnings:=-Wall -Wextra -Wpedantic -Wvla -Wshadow -Wundef
+
+CLANG:=clang
+CLANG.warnings:=-Weverything
+
+VALGRIND:=valgrind
+VALGRIND.flags:=--track-origins=yes --leak-check=full --show-leak-kinds=all
+
+TARGET:=hl
+ARGS:=${TARGET} < source/main.c
+
+chad_test:
+       ${GCC} ${GCC.warnings} ${SRC} -o ${TARGET}
+       ${CLANG} ${GCC.warnings} ${SRC} -o ${TARGET}
+       ${VALGRIND} ${VALGRIND.flags} $(shell pwd)/${TARGET} ${ARGS}