-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
39 lines (27 loc) · 887 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
CC = clang
CFLAGS = -Wall -Wextra -Werror -Wpedantic
LFLAGS = $(shell pkg-config --libs gmp)
SORUCES = randstate.c numtheory.c rsa.c
EXEC = test
OBJECTS = $(SOURCES)
all: keygen encrypt decrypt
$(EXEC): $(OBJECTS)
$(CC) $(CFLAGS) $(LFLAGS) -g -o keygen $(SOURCES) keygen.c
$(CC) $(CFLAGS) $(LFLAGS) -g -o encrypt $(SOURCES) encrypt.c
$(CC) $(CFLAGS) $(LFLAGS) -g -o decrypt $(SOURCES) decrypt.c
%.o:%.c
$(CC) $(CFLAGS) -c $<
tidy:
rm -rf $(OBJECTS)
clean: tidy
rm -rf keygen encrypt decrypt
format:
clang-format -i -style=file *.[c,h]
keygen:
$(CC) $(CFLAGS) $(LFLAGS) -lm -g -o keygen rsa.c numtheory.c randstate.c keygen.c
encrypt:
$(CC) $(CFLAGS) $(LFLAGS) -lm -g -o encrypt rsa.c numtheory.c randstate.c encrypt.c
decrypt:
$(CC) $(CFLAGS) $(LFLAGS) -lm -g -o decrypt rsa.c numtheory.c randstate.c decrypt.c
pkg-config:
sudo apt install pkg-config libgmp-dev