-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (31 loc) · 883 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
33
34
35
36
37
38
39
40
41
42
43
44
45
CC = clang
CFLAGS = -Wall -Wextra -Werror -Wpedantic -g -gdwarf-4 $(shell pkg-config --cflags gmp)
LFLAGS = $(shell pkg-config --libs gmp)
.PHONY: all clear
all: keygen encrypt decrypt
decrypt: decrypt.o ss.o numtheory.o randstate.o
$(CC) -o $@ $^ $(LFLAGS)
encrypt: encrypt.o ss.o numtheory.o randstate.o
$(CC) -o $@ $^ $(LFLAGS)
keygen: keygen.o ss.o numtheory.o randstate.o
$(CC) -o $@ $^ $(LFLAGS)
ss: ss.o numtheory.o randstate.o
$(CC) -o $@ $^ $(LFLAGS)
numtheory: numtheory.o randstate.o
$(CC) -o $@ $^ $(LFLAGS)
ss.o: ss.c
$(CC) $(CFLAGS) -c $<
numtheory.o: numtheory.c
$(CC) $(CFLAGS) -c $<
randstate.o: randstate.c
$(CC) $(CFLAGS) -c $<
keygen.o: keygen.c
$(CC) $(CFLAGS) -c $<
decrypt.o: decrypt.c
$(CC) $(CFLAGS) -c $<
encrypt.o: encrypt.c
$(CC) $(CFLAGS) -c $<
clean:
rm *.o decrypt keygen encrypt
format:
clang-format -i -style=file *.[ch]