forked from dsprenkels/sss
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
32 lines (24 loc) · 827 Bytes
/
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
CFLAGS += -g -O2 -m64 -std=c99 -pedantic \
-Wall -Wshadow -Wpointer-arith -Wcast-qual -Wformat -Wformat-security \
-Werror=format-security -Wstrict-prototypes -Wmissing-prototypes \
-D_FORTIFY_SOURCE=2 -fPIC -fno-strict-overflow
SRCS = hazmat.c randombytes.c sss.c tweetnacl.c
OBJS := ${SRCS:.c=.o}
all: libsss.a
libsss.a: randombytes/librandombytes.a $(OBJS)
$(AR) -rcs libsss.a $^
randombytes/librandombytes.a:
$(MAKE) -C randombytes librandombytes.a
# Force unrolling loops on hazmat.c
hazmat.o: CFLAGS += -funroll-loops
%.out: %.o randombytes/librandombytes.a
$(CC) -o $@ $(CFLAGS) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS)
$(MEMCHECK) ./$@
test_hazmat.out: $(OBJS)
test_sss.out: $(OBJS)
.PHONY: check
check: test_hazmat.out test_sss.out
.PHONY: clean
clean:
$(MAKE) -C randombytes $@
$(RM) *.o *.gch *.a *.out