Isolate chad.mk

This commit is contained in:
Emil 2023-08-21 07:19:40 -06:00
parent d883445bd1
commit b21b46e825
No known key found for this signature in database
GPG Key ID: 5432DB986FDBCF8A
2 changed files with 19 additions and 0 deletions

View File

@ -1,4 +1,5 @@
include config.mk
include tests/chad.mk
SRC.dir:=source
OBJ.dir:=obj

18
tests/chad.mk Normal file
View File

@ -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}