-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (30 loc) · 1011 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
CC = clang
# Code inspired from Eugene's Lab Section (2/4/2022).
CFLAGS = -Wall -Wextra -Werror -Wpedantic $(shell pkg-config --cflags gmp)
LFLAGS = $(shell pkg-config --libs gmp)
all: keygen encrypt decrypt
keygen: keygen.o numtheory.o randstate.o rsa.o
$(CC) -o keygen keygen.o numtheory.o randstate.o rsa.o $(LFLAGS)
encrypt: encrypt.o numtheory.o randstate.o rsa.o
$(CC) -o encrypt encrypt.o numtheory.o randstate.o rsa.o $(LFLAGS)
decrypt: decrypt.o numtheory.o randstate.o rsa.o
$(CC) -o decrypt decrypt.o numtheory.o randstate.o rsa.o $(LFLAGS)
numtheory.o: numtheory.c
$(CC) $(CFLAGS) -c numtheory.c
randstate.o: randstate.c
$(CC) $(CFLAGS) -c randstate.c
rsa.o: rsa.c
$(CC) $(CFLAGS) -c rsa.c
keygen.o: keygen.c
$(CC) $(CFLAGS) -c keygen.c
encrypt.o: encrypt.c
$(CC) $(CFLAGS) -c encrypt.c
clean:
rm -f numtheory.o numtheory
rm -f randstate.o
rm -f rsa.o
rm -f encrypt.o encrypt
rm -f keygen.o keygen
rm -f decrypt.o decrypt
format:
clang-format -i -style=file *.[c,h]