-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (31 loc) · 761 Bytes
/
Makefile
File metadata and controls
38 lines (31 loc) · 761 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
30
31
32
33
34
35
36
37
38
CC=gcc
CFLAGS= -Wall -Wextra -Werror -pedantic -lm -std=c11 -O -D_FORTIFY_SOURCE=2
LIBRARIES= -lm
DEPS = hash_table.h prime.h
OBJ = program-07.o hash_table.o prime.o
TEST =
PROGRAM = program-07
%.o: %.c $(DEPS)
$(CC) -c -o $@ $< $(CFLAGS) $(LIBRARIES)
$(PROGRAM): $(OBJ)
$(CC) -o $@ $^ $(CFLAGS) $(LIBRARIES)
.PHONY: clean
clean:
rm -f tests $(PROGRAM) valgrind.txt *.o *~ core $(INCDIR)/*~
run:
./$(PROGRAM)
valgrind:
valgrind --leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
--verbose \
--log-file=valgrind.txt \
./$(PROGRAM)
tests:
$(CC) -o tests $(TEST) $(CFLAGS) && valgrind --leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
--verbose \
--log-file=tests.txt \
./tests \
&& rm -f tests