forked from barrust/set
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (29 loc) · 1020 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
33
34
35
36
37
38
CC=gcc
COMPFLAGS=-Wall -Wpedantic -Winline -Wextra -Wno-long-long
SRCDIR=src
DISTDIR=dist
TESTDIR=tests
all: set
$(CC) ./$(DISTDIR)/set.o $(CFLAGS) $(COMPFLAGS) ./$(TESTDIR)/set_test.c -o ./$(DISTDIR)/s
debug: COMPFLAGS += -g
debug: all
release: COMPFLAGS += -O3
release: all
sanitize: COMPFLAGS += -fsanitize=undefined
sanitize: test
test: COMPFLAGS += --coverage
test: set
$(CC) $(DISTDIR)/set.o $(TESTDIR)/testsuite.c $(CCFLAGS) $(COMPFLAGS) -lcrypto -o ./$(DISTDIR)/test -g
set:
$(CC) -c ./$(SRCDIR)/set.c -o ./$(DISTDIR)/set.o $(COMPFLAGS) $(CFLAGS)
runtests:
@ if [ -f "./$(DISTDIR)/test" ]; then ./$(DISTDIR)/test; fi
clean:
if [ -f "./$(DISTDIR)/set.o" ]; then rm -r ./$(DISTDIR)/set.o; fi
if [ -f "./$(DISTDIR)/s" ]; then rm -r ./$(DISTDIR)/s; fi
if [ -f "./$(DISTDIR)/test" ]; then rm -rf ./$(DISTDIR)/*.gcno; fi
if [ -f "./$(DISTDIR)/test" ]; then rm -rf ./$(DISTDIR)/*.gcda; fi
if [ -f "./$(DISTDIR)/test" ]; then rm -r ./$(DISTDIR)/test; fi
rm -f ./*.gcno
rm -f ./*.gcda
rm -f ./*.gcov