-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
33 lines (22 loc) · 1.12 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
VFLAGS = --track-origins=yes --leak-check=full --show-leak-kinds=all
CFLAGS = -std=gnu11 -g -Wall -Wextra -O2
COMMON = src/vpn_config.c src/vpn_registry.c lib/crypto.c
CRYPTO_FLAGS = -lm -I/usr/local/opt/openssl@3/include -L/usr/local/opt/openssl/lib -lssl -lcrypto
all: build-client
rsa: build-rsa-example
aes: build-aes-example
build-client: src/client.c $(COMMON)
gcc src/client.c $(COMMON) -pthread $(CFLAGS) $(CRYPTO_FLAGS) -o client.out
build-server: src/server.c $(COMMON)
gcc src/server.c $(COMMON) $(CFLAGS) $(CRYPTO_FLAGS) -pthread -o server.out
build-rsa-example:
gcc lib/example/rsa.c -I/usr/local/opt/openssl@3/include -L/usr/local/opt/openssl/lib -lssl -lcrypto -o ./build/rsa_server.out
gcc lib/example/rsa_c.c -I/usr/local/opt/openssl@3/include -L/usr/local/opt/openssl/lib -lssl -lcrypto -o ./build/rsa_client.out
build-aes-example:
gcc lib/example/AES.c -I/usr/local/opt/openssl@3/include -L/usr/local/opt/openssl/lib -lssl -lcrypto -o ./build/aes.out
client: build-client
sudo ./client.out default 192.168.1.8
server: build-server
sudo ./server.out
clean: server.out client.out
rm server.out client.out