-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (23 loc) · 1.05 KB
/
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
CC = gcc
CFLAGS = -std=gnu11 -Wall -Wextra -O3
all: malloc.so test-spec sha-verify
malloc: malloc.so
run-all-tests: run-test-spec run-sha-verify
run-test-spec: test-spec
./tests/test-spec
run-sha-verify:
./tests/sha-verify $(SEED) # might want to pass seed to randomize tests
test-spec: tests/spec_tests.c malloc.o malloc.h
$(CC) -std=gnu11 -g tests/spec_tests.c malloc.o -o ./tests/test-spec
integrity-check.o: malloc_integrity_check.c malloc_integrity_check.h
$(CC) -std=gnu11 -g -c malloc_integrity_check.c -o integrity-check.o
malloc.o: malloc.c malloc.h
$(CC) $(CFLAGS) -c -fPIC malloc.c -o malloc.o
malloc.so: malloc.o
$(CC) $(CFLAGS) -shared malloc.o -o malloc.so -pthread
# requires libssl-dev when using SHA256 for data verification
sha-verify: integrity-check.o malloc.o malloc.h
-$(CC) -std=gnu11 -g tests/sha_verify.c -o ./tests/sha-verify -lssl -lcrypto malloc.o integrity-check.o
# $(CC) -std=gnu11 -g tests/sha_verify.c -o ./tests/sha-verify malloc.o integrity-check.o
clean:
rm -f *.o *~ *.so ./tests/test-spec ./tests/sha-verify