2023-08-21 09:19:40 -04:00
|
|
|
# Programs to check warnings for as defined by the chad standard
|
2023-08-19 07:18:34 -04:00
|
|
|
|
2023-08-21 10:18:26 -04:00
|
|
|
ARGS:=${TARGET} < source/main.c
|
|
|
|
|
2023-08-19 07:18:34 -04:00
|
|
|
GCC:=gcc
|
2023-08-21 10:13:24 -04:00
|
|
|
D.versions:=-D_XOPEN_SOURCE=700
|
2023-08-21 10:18:26 -04:00
|
|
|
GCC.warnings:=-Wall -Wextra -Wpedantic -Wvla -Wshadow -Wundef
|
2023-08-25 15:06:46 -04:00
|
|
|
GCC.debug:=-O0 -ggdb -pg -fno-inline
|
2023-08-21 10:18:26 -04:00
|
|
|
|
2023-08-19 07:18:34 -04:00
|
|
|
CLANG:=clang
|
|
|
|
CLANG.warnings:=-Weverything
|
2023-08-21 09:19:40 -04:00
|
|
|
|
2023-08-19 07:18:34 -04:00
|
|
|
VALGRIND:=valgrind
|
2023-08-19 18:49:10 -04:00
|
|
|
VALGRIND.flags:=--track-origins=yes --leak-check=full --show-leak-kinds=all
|
2023-08-19 07:18:34 -04:00
|
|
|
|
2023-08-21 09:19:40 -04:00
|
|
|
chad_test:
|
2023-08-25 15:06:46 -04:00
|
|
|
${CLANG} ${CPPFLAGS} ${D.versions} ${CLANG.warnings} ${SRC} -o ${TARGET}
|
2023-08-24 13:17:49 -04:00
|
|
|
${GCC} ${CPPFLAGS} ${D.versions} ${GCC.debug} ${GCC.warnings} ${SRC} -o ${TARGET}
|
2023-08-21 09:19:40 -04:00
|
|
|
${VALGRIND} ${VALGRIND.flags} $(shell pwd)/${TARGET} ${ARGS}
|