-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
84 lines (67 loc) · 2.24 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: dvdovenk <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2017/02/07 09:26:14 by dvdovenk #+# #+# #
# Updated: 2017/02/07 09:29:29 by dvdovenk ### ########.fr #
# #
# **************************************************************************** #
NAME = ft_select
N_INC = ft_lib.h
N_SRCS += main.c \
delete.c \
exit.c \
output_prepare.c \
input.c \
print.c \
signals.c \
termcap.c \
termios.c \
key.c \
key2.c \
toolkit.c \
dynamic_search.c
CC = gcc
CC_FLAGS = -Wall -Werror -Wextra -g
P_SRCS = ./srcs/
P_OBJ = ./obj/
P_LFT = libft/
I_INC = ./includes
I_LFT = ./libft/includes
I_ADD = -ltermcap
L_LFT = -L./libft/ -lft
NOC=\033[0m
OKC=\033[32;05m
ERC=\033[31m
WAC=\033[33m
SRC = $(addprefix $(P_SRCS),$(N_SRCS))
OBJ = $(addprefix $(P_OBJ),$(OBJ_NAME))
INC = $(addprefix -I,$(I_INC) $(I_LFT))
OBJ_NAME = $(N_SRCS:.c=.o)
all: $(NAME)
project: clean proj
proj: $(OBJ)
@echo "$(OKC)$(NAME): Compiling objectives $(NAME)$(NOC)"
@$(CC) $(CC_FLAGS) $(I_ADD) -o $(NAME) $(OBJ) $(INC) $(L_LFT)
@echo "$(OKC)$(NAME): Compilation success!$(NOC)"
$(NAME): $(OBJ)
@echo "$(OKC)$(NAME): Compiling libft.a$(NOC)"
@make -C $(P_LFT)
@echo "$(OKC)$(NAME): Compiling $(NAME)$(NOC)"
@$(CC) $(CC_FLAGS) $(I_ADD) -o $(NAME) $(OBJ) $(INC) $(L_LFT)
@echo "$(OKC)$(NAME): Compilation success!$(NOC)"
$(P_OBJ)%.o: $(P_SRCS)%.c
@mkdir -p $(P_OBJ) $(ADD)
@$(CC) $(CC_FLAGS) -o $@ -c $^ $(INC)
clean:
@make -C $(P_LFT) clean
@rm -rf $(P_OBJ)
@echo "$(WAC)$(NAME): Removing $(NAME) ./obj/$(NOC)"
fclean: clean
@make -C $(P_LFT) fclean
@rm -f $(NAME)
@echo "$(WAC)$(NAME): Removing executable$(NOC)"
re: fclean all