-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (47 loc) · 2.22 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# **************************************************************************** #
# PROGRAM #
# **************************************************************************** #
NAME = $(BUILD_DIR)/ft_shield
# **************************************************************************** #
# VARS #
# **************************************************************************** #
MAKE = make
CP = cp
MV = mv
MKDIR = mkdir -p
RM = rm -rf
# **************************************************************************** #
# COMPILER #
# **************************************************************************** #
CC = gcc
CFLAGS = -Wall -Wextra -Werror -Wpedantic -Wshadow -g3
# **************************************************************************** #
# SOURCES #
# **************************************************************************** #
BUILD_DIR := build
INC_DIR := includes
SRCS := srcs/commands.c srcs/daemon.c srcs/main.c srcs/password.c srcs/server.c
OBJS := $(SRCS:%.c=$(BUILD_DIR)/%.o)
DEPS := $(OBJS:%.o=%.d)
# **************************************************************************** #
# FLAGS #
# **************************************************************************** #
CFLAGS += -I./$(INC_DIR)
LDFLAGS += -I/opt/ssl/include/ -L/opt/ssl/lib/ -lcrypto
# **************************************************************************** #
# RULES #
# **************************************************************************** #
all: $(NAME)
$(NAME): $(OBJS) $(LDLIBS)
$(CC) $(CFLAGS) -D PASSWORD=password -o $@ $(OBJS) $(LDFLAGS)
$(BUILD_DIR)/%.o: %.c
mkdir -p $(dir $@)
$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
clean:
$(RM) $(OBJS)
fclean: clean
$(RM) $(BUILD_DIR)
re:: clean
re:: all
-include $(DEPS)
.PHONY: all sanitize clean fclean re