Branch
Hash :
5af3e82a
Author :
Thomas de Grivel
Date :
2022-11-02T17:38:47
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
CFLAGS = -std=c89 -W -Wall -Werror -DDEBUG -ggdb
ASAN_CFLAGS = ${CFLAGS} -fsanitize=address -O1 -fno-omit-frame-pointer -g
COV_CFLAGS = ${CFLAGS} -ftest-coverage -fprofile-arcs
CPPFLAGS = -I.. -I./include -D _GNU_SOURCE
LDFLAGS =
ASAN_LDFLAGS = ${LDFLAGS} -fsanitize=address -O1 -fno-omit-frame-pointer -g
COV_LDFLAGS = ${LDFLAGS}
git_nif_test_SRC = \
enif_fake_src.c \
git_nif_test.c \
git_nif.c \
mstr.c
git_nif_test = git_nif_test
git_nif_test_OBJ = $(git_nif_test_SRC:.c=.o)
git_nif_test_asan = git_nif_test_asan
git_nif_test_asan_OBJ = $(git_nif_test_SRC:.c=.asan.o)
git_nif_test_cov = git_nif_test_cov
git_nif_test_cov_OBJ = $(git_nif_test_SRC:.c=.cov.o)
PROGS = ${git_nif_test} ${git_nif_test_cov} ${git_nif_test_asan}
CLEANFILES = *.o ${PROGS}
all: ${PROGS}
.SUFFIXES: .asan.o .cov.o
.c.asan.o:
${CC} ${CPPFLAGS} ${ASAN_CFLAGS} -c $< -o $@
.c.cov.o:
${CC} ${CPPFLAGS} ${COV_CFLAGS} -c $< -o $@
${git_nif_test}: ${git_nif_test_OBJ}
${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} ${git_nif_test_OBJ} ${LIBS} -o ${git_nif_test}
${git_nif_test_asan}: ${git_nif_test_asan_OBJ}
${CC} ${ASAN_CFLAGS} ${CPPFLAGS} ${ASAN_LDFLAGS} ${git_nif_test_asan_OBJ} ${LIBS} -o ${git_nif_test_asan}
${git_nif_test_cov}: ${git_nif_test_cov_OBJ}
${CC} ${CFLAGS} ${COV_CFLAGS} ${CPPFLAGS} ${COV_LDFLAGS} ${git_nif_test_cov_OBJ} ${LIBS} -o ${git_nif_test_cov}
CLEANFILES += coverage.* *.gcda *.gcno *.gcov *.gcov.txt *.gcov.html
clean:
rm -f ${CLEANFILES}
.PHONY: all clean
include ../../config.mk