-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
29 lines (23 loc) · 710 Bytes
/
makefile
File metadata and controls
29 lines (23 loc) · 710 Bytes
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
CFLAGS = -std=c99
CFLAGS += -g
CFLAGS += -Wall
CFLAGS += -Wextra
CFLAGS += -pedantic
CFLAGS += -Werror
VFLAGS = --quiet
VFLAGS += --tool=memcheck
VFLAGS += --leak-check=full
VFLAGS += --error-exitcode=1
a.out: main.c src/binary_search_tree.c src/binary_search_tree.h
@$(CC) $(CFLAGS) main.c src/binary_search_tree.c -o a.out
./a.out
test: tests.out
@./tests.out
memcheck: tests.out
@valgrind $(VFLAGS) ./tests.out
@echo "Memory check passed"
clean:
rm -rf *.o *.out *.out.dSYM
tests.out: test/test_binary_search_tree.c src/binary_search_tree.c src/binary_search_tree.h
@echo Compiling $@
@$(CC) $(CFLAGS) src/binary_search_tree.c test/vendor/unity.c test/test_binary_search_tree.c -o tests.out