2020-11-15 15:50:36 +01:00
|
|
|
CC = gcc
|
|
|
|
CFLAGS = -Wall -Wextra -pedantic -std=c99 -Werror
|
|
|
|
CPPFLAGS = -Iinclude/ -Itests/
|
|
|
|
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 \
|
|
|
|
|
|
|
|
OBJS = $(SRC:.c=.o)
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: $(OBJS)
|
|
|
|
|
|
|
|
.PHONY: check
|
|
|
|
check: testsuite
|
|
|
|
./testsuite --verbose
|
|
|
|
|
|
|
|
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 \
|
|
|
|
|
|
|
|
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
|