-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
41 lines (30 loc) · 842 Bytes
/
Makefile
File metadata and controls
41 lines (30 loc) · 842 Bytes
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
# Compiler options
CC := gcc
CFLAGS := -Wall -Wextra
# Debug flag
ifdef deb
CFLAGS += -g
endif
# OpenSSL library
OPENSSL_LIB := -lssl -lcrypto
# Source files
CLIENT_SRC := test_client/client.c crypto/ssl-encrypt.c
SERVER_SRC := external_module/server.c external_module/connection.c external_module/container_list.c crypto/ssl-encrypt.c
# Object files
CLIENT_OBJ := $(CLIENT_SRC:.c=.o)
SERVER_OBJ := $(SERVER_SRC:.c=.o)
# Executables
CLIENT := test_client/client
SERVER := external_module/extmod
all: $(CLIENT) $(SERVER)
$(CLIENT): $(CLIENT_OBJ)
$(CC) $(CFLAGS) -o $@ $^ $(OPENSSL_LIB)
$(SERVER): $(SERVER_OBJ)
$(CC) $(CFLAGS) -o $@ $^ $(OPENSSL_LIB)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@ $(OPENSSL_LIB)
deb:
@echo "Building with debug symbols..."
$(MAKE) all deb=1
clean:
rm -f $(CLIENT) $(SERVER) $(CLIENT_OBJ) $(SERVER_OBJ)