-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (66 loc) · 1.57 KB
/
Makefile
File metadata and controls
77 lines (66 loc) · 1.57 KB
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
CC = clang -Wall -Wextra -Werror
RM = rm -rf
NAME = minishell
INCS_DIR = ./includes/
MAIN_INC = -I$(INCS_DIR)
LIB_DIR = ./libft/
LIB_INC = -I$(LIB_DIR)includes/
LIB_NAME = $(LIB_DIR)libft.a
INCS = $(addprefix $(INCS_DIR), minishell.h structures.h)
SRCS = $(addprefix sources/, \
execute/args.c \
execute/types.c \
execute/fork.c \
execute/command.c \
execute/execute.c \
execute/file.c \
execute/useful.c \
execute/pipe.c \
parse/count.c \
parse/env.c \
parse/parse.c \
parse/redir.c \
parse/state.c \
parse/tree.c \
parse/node.c \
parse/trim.c \
parse/useful.c \
utilities/errors.c \
utilities/free.c \
utilities/prompt.c \
utilities/reader.c \
utilities/reader_useful.c \
builtin/cd.c \
builtin/echo.c \
builtin/env.c \
builtin/exit.c \
builtin/export.c \
builtin/export_sorted.c \
builtin/pwd.c \
builtin/unset.c \
environment/declare.c \
environment/env.c \
environment/replace.c \
environment/update.c \
environment/useful.c \
expand/join.c \
expand/main.c \
expand/expansion.c \
expand/useful.c \
main.c )
OBJS = $(SRCS:.c=.o)
%.o : %.c
@$(CC) $(MAIN_INC) $(LIB_INC) -c $< -o $@
all : $(NAME)
$(NAME) : $(OBJS) $(INCS)
@make --silent -C $(LIB_DIR)
@$(CC) $(OBJS) $(LIB_NAME) -L$(LIB_DIR) $(LIB_INC) $(MAIN_INC) -o $(NAME)
@echo "minishell compiled"
clean:
@$(MAKE) clean --silent -C $(LIB_DIR)
@$(RM) $(OBJS)
fclean : clean
@$(MAKE) fclean --silent -C $(LIB_DIR)
@$(RM) $(NAME)
re : fclean all
.PHONY : all clean fclean re