-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·41 lines (29 loc) · 1.31 KB
/
Makefile
File metadata and controls
executable file
·41 lines (29 loc) · 1.31 KB
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
39
40
41
CC=gcc
CFLAGS=-Wall -Wvla -std=c2x -g -fsanitize=address
LDFLAGS=-lm -lpthread -fsanitize=address
INCLUDE=-Iinclude
.PHONY: all valgrind
all: pkgchk.o pkgmain btide p1tests p2tests clean
# Required for Part 1 - Make sure it outputs a .o file
pkgchk.o: src/chk/pkgchk.c src/tree/merkletree.c src/crypt/sha256.c
$(CC) -c $^ $(INCLUDE) $(CFLAGS) $(LDFLAGS)
pkgmain: src/pkgmain.c src/chk/pkgchk.c src/tree/merkletree.c src/crypt/sha256.c
$(CC) $^ $(INCLUDE) $(CFLAGS) $(LDFLAGS) -o $@
pkgchecker: src/pkgmain.c src/chk/pkgchk.c src/tree/merkletree.c src/crypt/sha256.c
$(CC) $^ $(INCLUDE) $(CFLAGS) $(LDFLAGS) -o $@
# Required for Part 2 - Make sure it outputs `btide` file
btide: src/btide.c src/chk/pkgchk.c src/tree/merkletree.c src/crypt/sha256.c #package
$(CC) src/btide.c src/chk/pkgchk.c src/tree/merkletree.c src/crypt/sha256.c $(INCLUDE) $(CFLAGS) $(LDFLAGS) -o $@
p1tests:
bash p1test.sh
p2tests:
bash p2test.sh
clean:
rm -f pkgchk.o pkgmain btide merkletree.o sha256.o package
rm -rf tests
# Valgrind target for btide and its dependency package
valgrind-btide: btide
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./btide
# Optionally, if you want to run Valgrind on package as well
valgrind-package: package
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes ./package