-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (25 loc) · 922 Bytes
/
Makefile
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
HEADERDIR = ./include
SOURCEDIR = ./src
BINARYDIR = ./bin
TESTSDIR = ./tests
EXCLUDE = hashmap.c
IFLAGS = -iquote$(HEADERDIR)
CFLAGS = -Wall -Wextra -Werror -pedantic -g #-fsanitize=address -static-libasan
OFLAG = -Og
DEBUGFLAGS = -DVALGRIND #-DDEBUG_MALLOC -DDEBUG_HMAP
LIBFLAGS = -lm
# := is important to avoid running find every time SRC is inspected
SRC := $(shell find $(SOURCEDIR)/ ! -name $(EXCLUDE) -name '*.c')
# SRC := $(wildcard $(SOURCEDIR)*.c)
# SRC := $(filter-out $(SRC)/hashmap.c, $(SRC))
# SRC := $(subst $(EXCLUDE),,$(SRC))
# OBJ = $(SRC:.cc=.o)
EXEC = lispy
VALGRIND = "valgrind --track-origins=yes --leak-check=full --show-reachable=yes $(BINARYDIR)/$(EXEC)"
$(EXEC):
$(CC) $(IFLAGS) $(CFLAGS) $(DEBUGFLAGS) $(OFLAG) $(LIBFLAGS) -o $(BINARYDIR)/$@ $(SRC)
clean:
rm -rf $(BINARYDIR)/$(EXEC)
test:
# Raise --delay=<s> if there are false positive
python $(TESTSDIR)/test.py $(VALGRIND) -v -o