-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (43 loc) · 1.36 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
NAME = fillit
LIB_FOLDER = libft
LIB = $(LIB_FOLDER)/libft.a
CFLAGS = -Wall -Wextra -Werror
CC = gcc
SRCS_FOLDER = srcs
SRCS = $(SRCS_FOLDER)/main.c \
$(SRCS_FOLDER)/ft_list.c \
$(SRCS_FOLDER)/ft_count.c \
$(SRCS_FOLDER)/ft_count_next.c \
$(SRCS_FOLDER)/ft_checker.c \
$(SRCS_FOLDER)/ft_parser.c \
$(SRCS_FOLDER)/ft_position.c \
$(SRCS_FOLDER)/ft_area.c \
$(SRCS_FOLDER)/ft_piece.c \
$(SRCS_FOLDER)/ft_resolver.c
OBJS_FOLDER = objs
OBJS = $(SRCS:$(SRCS_FOLDER)/%.c=$(OBJS_FOLDER)/%.o)
INC_FOLDER = includes
INCLUDES = $(INC_FOLDER)/fillit.h
all: $(NAME)
$(NAME): $(OBJS)
@ make -C $(LIB_FOLDER)
@ $(CC) $(CFLAGS) -I $(INCLUDES) -o $@ $^ $(LIB)
@ echo "Compilation $(NAME) ..."\
".............................................. \033[32m[OK]\033[0m"
$(OBJS_FOLDER):
@ mkdir $(OBJS_FOLDER)
$(OBJS_FOLDER)/%.o: $(SRCS_FOLDER)/%.c | $(OBJS_FOLDER)
@ $(CC) $(CFLAGS) -I $(INCLUDES) -o $@ -c $<
clean:
@ rm -f $(OBJS)
@ rm -rf $(OBJS_FOLDER)
@ make -C $(LIB_FOLDER) clean
@ echo "Delete *.o ($(NAME)) ..."\
"............................................. \033[32m[OK]\033[0m"
fclean: clean
@ rm -f $(NAME) $(LIB)
@ echo "Delete $(LIB) ..."\
"............................................ \033[32m[OK]\033[0m"
@ echo "Delete $(NAME) ..."\
"................................................... \033[32m[OK]\033[0m"
re: fclean all