-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
113 lines (100 loc) · 2.89 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
NAME = minishell
CC = gcc
CFLAGS = -Wall -Wextra -Werror
# CFLAGS = -g3 -fsanitize=address
# ifeq ($(DEBUG),true)
# CFLAGS += -g
# endif
SRCS_DIR = ./srcs \
./srcs/pre_setting \
./srcs/pre_setting/cursor \
./srcs/pre_setting/tokenize \
./srcs/run \
./srcs/run/blt_func \
./srcs/run/utils \
./srcs/utils
OBJS_DIR = ./objs
INC_DIR = ./includes
SRCS = ./srcs/main.c \
./srcs/minishell.c \
./srcs/pre_setting/check_syntax.c \
./srcs/pre_setting/check_syntax2.c \
./srcs/pre_setting/handle_enter_normal.c \
./srcs/pre_setting/handle_key_arrow.c \
./srcs/pre_setting/handle_special_key.c \
./srcs/pre_setting/init.c \
./srcs/pre_setting/prompt.c \
./srcs/pre_setting/read_cmd.c \
./srcs/pre_setting/cursor/cursor.c \
./srcs/pre_setting/tokenize/parse.c \
./srcs/pre_setting/tokenize/separate.c \
./srcs/pre_setting/tokenize/make_token_list.c \
./srcs/pre_setting/tokenize/token_array.c \
./srcs/pre_setting/tokenize/token.c \
./srcs/run/builtin.c \
./srcs/run/error.c \
./srcs/run/find.c \
./srcs/run/get_env_value.c \
./srcs/run/handle_no_cmd.c \
./srcs/run/inner_func.c \
./srcs/run/pipe.c \
./srcs/run/redirect.c \
./srcs/run/run.c \
./srcs/run/signal.c \
./srcs/run/blt_func/blt_cd.c \
./srcs/run/blt_func/blt_cd2.c \
./srcs/run/blt_func/blt_echo.c \
./srcs/run/blt_func/blt_env.c \
./srcs/run/blt_func/blt_exit.c \
./srcs/run/blt_func/blt_export.c \
./srcs/run/blt_func/blt_export2.c \
./srcs/run/blt_func/blt_export3.c \
./srcs/run/blt_func/blt_export4.c \
./srcs/run/blt_func/blt_pwd.c \
./srcs/run/blt_func/blt_unset.c \
./srcs/run/utils/free.c \
./srcs/run/utils/change_env.c \
./srcs/run/utils/is_pipe_exist.c \
./srcs/run/utils/replace_env_in_arg.c \
./srcs/run/utils/save_old_fds.c \
./srcs/run/utils/turn_on_flag.c \
./srcs/utils/ft_atoi.c \
./srcs/utils/ft_calloc.c \
./srcs/utils/ft_isalnum.c \
./srcs/utils/ft_isalpha.c \
./srcs/utils/ft_isdigit.c \
./srcs/utils/ft_isprint.c \
./srcs/utils/ft_itoa.c \
./srcs/utils/ft_memcpy.c \
./srcs/utils/ft_memmove.c \
./srcs/utils/ft_memset.c \
./srcs/utils/ft_putstr_fd.c \
./srcs/utils/ft_split.c \
./srcs/utils/ft_str_char_del.c \
./srcs/utils/ft_str_char_embed.c \
./srcs/utils/ft_str_char_join.c \
./srcs/utils/ft_strchr.c \
./srcs/utils/ft_strcmp.c \
./srcs/utils/ft_strcpy_i_to_j.c \
./srcs/utils/ft_strdup.c \
./srcs/utils/ft_strjoin.c \
./srcs/utils/ft_strlcpy.c \
./srcs/utils/ft_strlen.c \
./srcs/utils/ft_strncmp.c \
./srcs/utils/ft_strtrim.c \
./srcs/utils/ft_substr.c \
OBJS = $(addprefix $(OBJS_DIR)/, $(notdir $(SRCS:.c=.o)))
vpath %.c $(SRCS_DIR)
RM = rm -f
all: $(NAME)
$(NAME) : $(OBJS)
@$(CC) $(CFLAGS) -lncurses -o $@ $^
$(OBJS_DIR) :
@mkdir -p $(OBJS_DIR)
$(OBJS_DIR)/%.o : %.c | $(OBJS_DIR)
@$(CC) $(CFLAGS) -o $@ -I$(INC_DIR) -c $^
clean :
@$(RM) -r $(OBJS_DIR)
fclean : clean
@$(RM) $(NAME)
re : fclean all