2023-08-19 07:18:34 -04:00
|
|
|
# Make script for Chad projects
|
|
|
|
# This script depends on the following variables
|
|
|
|
# - OUT : output program name
|
|
|
|
# - OUTARGS : default flags to fork ${OUT} with
|
|
|
|
|
|
|
|
#
|
|
|
|
CHAD_DEBUG:=-Og -ggdb -pg -fno-inline
|
|
|
|
|
|
|
|
# Programs to check warnings for as defined by the Chad standard
|
|
|
|
GCC:=gcc
|
2023-08-21 10:13:24 -04:00
|
|
|
D.versions:=-D_XOPEN_SOURCE=700
|
2023-08-19 18:49:10 -04:00
|
|
|
GCC.warnings:=-Wall -Wextra -Wpedantic -Wvla -Wshadow -Wundef
|
2023-08-19 07:18:34 -04:00
|
|
|
CLANG:=clang
|
|
|
|
CLANG.warnings:=-Weverything
|
|
|
|
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
|
|
|
|
|
|
|
chad_test:
|
2023-08-21 10:13:24 -04:00
|
|
|
${GCC} ${D.versions} ${GCC.warnings} ${SRC} -o ${OUT}
|
|
|
|
${CLANG} ${D.versions} ${GCC.warnings} ${SRC} -o ${OUT}
|
2023-08-19 18:49:10 -04:00
|
|
|
${VALGRIND} ${VALGRIND.flags} ${OUT} ${OUTARGS}
|
2023-08-19 07:18:34 -04:00
|
|
|
|
|
|
|
.DEFAULT_GOAL:=main
|