tupperware/Makefile

39 lines
678 B
Makefile
Raw Permalink Normal View History

2020-11-15 15:50:36 +01:00
CC = gcc
CFLAGS = -Wall -Wextra -pedantic -std=c99 -Werror
2020-11-25 17:58:51 +01:00
CPPFLAGS = -Iinclude/ -Itests/ -D_DEFAULT_SOURCE
2020-11-15 15:50:36 +01:00
VPATH = src/ tests/
SRC = \
2020-11-24 19:42:16 +01:00
src/avl.c \
2020-11-15 15:50:36 +01:00
src/list.c \
2020-11-25 17:58:51 +01:00
src/vector.c \
2020-11-15 15:50:36 +01:00
OBJS = $(SRC:.c=.o)
.PHONY: all
all: $(OBJS)
.PHONY: check
check: testsuite
ASAN_OPTIONS=allocator_may_return_null=1 ./testsuite --verbose
2020-11-15 15:50:36 +01:00
TEST_SRC = \
2020-11-24 19:42:34 +01:00
tests/avl.c \
2020-11-15 15:50:36 +01:00
tests/list.c \
tests/testsuite.c \
tests/vector.c \
2020-11-15 15:50:36 +01:00
TEST_OBJS = $(TEST_SRC:.c=.o)
testsuite: LDFLAGS+=-lcriterion -fsanitize=address
testsuite: CFLAGS+=-fsanitize=address
testsuite: CFLAGS+=-g
testsuite: $(OBJS) $(TEST_OBJS)
.PHONY: clean
clean:
$(RM) $(OBJS)
$(RM) $(TEST_OBJS)
$(RM) testsuite