-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·82 lines (65 loc) · 2.34 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
# **************************************************************************** #
# LE - / #
# / #
# Makefile .:: .:/ . .:: #
# +:+:+ +: +: +:+:+ #
# By: kcabus <[email protected]> +:+ +: +: +:+ #
# #+# #+ #+ #+# #
# Created: 2018/04/06 14:53:11 by kcabus #+# ## ## #+# #
# Updated: 2018/11/09 14:59:56 by yoginet ### #+. /#+ ###.fr #
# / #
# / #
# **************************************************************************** #
.PHONY: all clean fclean re compile
NAME = 42sh
WFLAGS = -Wall -Wextra -Werror -g
SRC_PATH = ./
INC_PATH = ./includes/
OBJ_PATH = ./obj/
LIB_PATH = ./libft/
EDIT_PATH = ./edition/
PARSE_PATH = ./parser/
AUTOCOMP_PATH = ./autocomp/
EXEC_PATH = ./exec/
SRC = $(addprefix $(SRC_PATH),$(N_SRCS))
OBJ = $(addprefix $(OBJ_PATH),$(OBJ_NAME))
INC = -I $(LIB_PATH) \
-I $(EDIT_PATH) \
-I $(PARSE_PATH) \
-I $(AUTOCOMP_PATH) \
-I $(EXEC_PATH)
OBJ_NAME = $(N_SRCS:.c=.o)
N_SRCS = main.c
LIB_A = -L $(LIB_PATH) -lft \
-L $(PARSE_PATH) -lparser \
-L $(EDIT_PATH) -ledition \
-L $(EXEC_PATH) -lexec \
-L $(AUTOCOMP_PATH) -lautocomp \
-ltermcap
all : $(NAME)
$(NAME): $(OBJ) compile
@gcc $(WFLAGS) $(OBJ) $(INC) $(LIB_A) -o $(NAME)
$(OBJ_PATH)%.o: $(SRC_PATH)%.c
@mkdir -p $(OBJ_PATH)
@gcc -c $(WFLAGS) $(INC) -o $@ $<
compile :
@make -C $(LIB_PATH)
@make -C $(PARSE_PATH)
@make -C $(EDIT_PATH)
@make -C $(EXEC_PATH)
@make -C $(AUTOCOMP_PATH)
clean :
@make -C $(LIB_PATH) clean
@make -C $(PARSE_PATH) clean
@make -C $(EDIT_PATH) clean
@make -C $(EXEC_PATH) clean
@make -C $(AUTOCOMP_PATH) clean
@rm -rf $(OBJ_PATH)
fclean : clean
@make -C $(LIB_PATH) fclean
@make -C $(PARSE_PATH) fclean
@make -C $(EDIT_PATH) fclean
@make -C $(EXEC_PATH) fclean
@make -C $(AUTOCOMP_PATH) fclean
@rm -rf $(NAME)
re : fclean clean all