-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (29 loc) · 1.02 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
34
35
36
37
# Compiler settings
CC := clang
CFLAGS := -g -Wall
LDLIBS := -lcrypto -lpthread
# Source file directories
INCLUDE_DIR := include
SRC_DIR := src
TEST_DIR := tests
# Source files
TCP_SRCS := $(wildcard $(SRC_DIR)/tcp/*.c)
UDP_SRCS := $(wildcard $(SRC_DIR)/udp/*.c)
HTTP_HELPERS_SRCS := $(wildcard $(SRC_DIR)/http/*.c)
WS_HELPER_SRCS := $(wildcard $(SRC_DIR)/ws/*.c)
WEB_SRCS := $(wildcard $(SRC_DIR)/web/*.c)
UTILS_SRCS := $(wildcard $(SRC_DIR)/utils/*.c)
COMMON_SRC := $(wildcard $(SRC_DIR)/socket.c)
# Test files
TEST_HTTP_SRCS := $(wildcard $(TEST_DIR)/http/*.c)
TEST_TCP_SRCS := $(wildcard $(TEST_DIR)/tcp/*.c)
TEST_UDP_SRCS := $(wildcard $(TEST_DIR)/udp/*.c)
TEST_WS_SRCS := $(wildcard $(TEST_DIR)/ws/*.c)
MAIN_SRCS := $(wildcard main.c)
# Output binary
OUTPUT := netc
all: $(OUTPUT)
$(OUTPUT): $(COMMON_SRC) $(TCP_SRCS) $(UDP_SRCS) $(HTTP_HELPERS_SRCS) $(WS_HELPER_SRCS) $(WEB_SRCS) $(UTILS_SRCS) $(TEST_HTTP_SRCS) $(TEST_TCP_SRCS) $(TEST_UDP_SRCS) $(TEST_WS_SRCS) $(MAIN_SRCS)
$(CC) $(CFLAGS) $^ -o $@ $(LDLIBS)
clean:
rm -f $(OUTPUT)