-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·79 lines (66 loc) · 1.92 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
NAME = minishell
HEADER = ./include/minishell.h
LIBFT_DIR = ./libft
LIBFT = $(LIBFT_DIR)/libft.a
SRC_DIR = ./src
SRC = $(SRC_DIR)/start_end/exit.c \
$(SRC_DIR)/start_end/set_mini.c \
$(SRC_DIR)/start_end/main.c \
$(SRC_DIR)/start_end/first_checks.c \
$(SRC_DIR)/start_end/free.c \
$(SRC_DIR)/start_end/free2.c \
$(SRC_DIR)/start_end/error.c \
$(SRC_DIR)/settings/pipes.c \
$(SRC_DIR)/settings/settings.c \
$(SRC_DIR)/settings/var_utils.c \
$(SRC_DIR)/settings/local_var.c \
$(SRC_DIR)/settings/envp.c \
$(SRC_DIR)/settings/input.c \
$(SRC_DIR)/settings/output.c \
$(SRC_DIR)/settings/keys.c \
$(SRC_DIR)/parts/parts_handle.c \
$(SRC_DIR)/parts/parts_merge.c \
$(SRC_DIR)/parts/parts_utils.c \
$(SRC_DIR)/parts/parts_proces.c \
$(SRC_DIR)/parts/parts_var.c \
$(SRC_DIR)/lexer_parser/parser.c \
$(SRC_DIR)/lexer_parser/parser2.c \
$(SRC_DIR)/lexer_parser/lexer_substr.c \
$(SRC_DIR)/lexer_parser/newl_check.c \
$(SRC_DIR)/lexer_parser/lexer.c \
$(SRC_DIR)/lexer_parser/utils.c \
$(SRC_DIR)/executor/builtins.c \
$(SRC_DIR)/executor/builtins_utils.c \
$(SRC_DIR)/executor/cd.c \
$(SRC_DIR)/executor/export.c \
$(SRC_DIR)/executor/unset.c \
$(SRC_DIR)/executor/echo.c \
$(SRC_DIR)/executor/executor.c \
$(SRC_DIR)/executor/utils_ex.c \
$(SRC_DIR)/executor/child.c \
$(SRC_DIR)/executor/path_checker.c \
$(SRC_DIR)/executor/copy_data.c \
$(SRC_DIR)/executor/cd_utils.c
OJB_DIR = ./obj
$(shell mkdir -p $(OJB_DIR))
OBJ = $(patsubst $(SRC_DIR)/%.c,$(OJB_DIR)/%.o,$(SRC))
CC = cc
CFLAG = -Wall -Wextra -Werror -g3
all:$(NAME)
$(LIBFT):
@make -C $(LIBFT_DIR)
$(NAME): $(OBJ) $(LIBFT) $(HEADER)
@cp $(HEADER) $(OJB_DIR)
@$(CC) $(CFLAG) $(OBJ) $(LIBFT) -lreadline -o $(NAME)
@echo Done compiling!
$(OJB_DIR)/%.o: $(SRC_DIR)/%.c
@mkdir -p $(dir $@)
@$(CC) $(CFLAG) -c $< -o $@
clean:
@rm -rf $(OJB_DIR)
@echo Deleted objects!
fclean: clean
@rm -f $(NAME)
@echo Deleted program!
re: fclean all
.PHONY: all clean fclean re