forked from mpg/p256-m
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (34 loc) · 1.09 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
35
36
37
38
39
40
41
42
43
44
# Usage:
# - 'make' runs the test suites on the host
# - 'make all' also prints code size on stack usage (main development target)
# it leaves a variety of dumps around for inspection if desired
# - 'make clean' removes files generated by 'make all' and coverage.sh.
TESTOPEN=test-openbox
TESTCLOSED=test-closedbox
TESTDATA=test-data.h
TESTLIB=p256-native.o
SRC=p256-m.c
HDR=p256-m.h
CC=clang
CFLAGS=-Werror -Weverything --std=c99 -Os
CFLAGS_SAN=-fsanitize=address -fsanitize=undefined
runtest: $(TESTCLOSED) $(TESTOPEN)
./$(TESTCLOSED)
./$(TESTOPEN)
$(TESTLIB): $(SRC) $(HDR)
$(CC) $(CFLAGS) $(CFLAGS_SAN) $< -c -o $@
$(TESTCLOSED): test-closedbox.c $(TESTLIB) $(TESTDATA) $(HDR)
$(CC) $(CFLAGS) $(CFLAGS_SAN) $< $(TESTLIB) -o $@
$(TESTOPEN): test-openbox.c $(TESTDATA) $(SRC)
$(CC) $(CFLAGS) $(CFLAGS_SAN) $< -o $@
$(TESTDATA): gen-test-data.py p256.py
python3 $< > $@
all: runtest
./sizes.sh
./stack.sh
clean:
rm -f $(TESTCLOSED) $(TESTOPEN) $(TESTDATA)
rm -f *.s *.o *.dump *.sizes *.su *.dfinish
rm -f *.gcda *.gcno *.info *.html
rm -rf cov-closed cov-open
.PHONY: runtest clean all