forked from nbelouni/42sh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
126 lines (112 loc) · 2.3 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
114
115
116
117
118
119
120
121
122
123
124
125
126
NAME = 42sh
IDIR = ./inc/
ILIB = ./libft/inc
INCS = 42sh.h \
read.h \
lex.h \
exec.h \
completion.h \
globbing.h
INCC = $(addprefix $(IDIR), $(INCS))
LDIR = ./libft
LIBS = -lft
SDIR = ./src/
SRCS = ft_builtin_cd.c \
ft_builtin_echo.c \
ft_builtin_env.c \
ft_builtin_exit.c \
ft_builtin_setenv.c \
ft_builtin_unsetenv.c\
ft_builtin_export.c \
ft_builtin_export_tools.c\
ft_builtin_unset.c\
ft_export_print.c\
ft_norm_tools.c \
ft_init.c \
ft_list_tools.c \
ft_list_tools2.c \
ft_opt_parse.c \
read.c \
buf.c \
term.c \
signal.c \
curs.c \
main.c \
edit_completion.c \
edit_move.c \
edit_buf.c \
edit_line.c \
edit_visual.c \
calc_len.c \
prompt.c \
is_line_ended.c \
is_token.c \
ft_exec.c \
ft_tokenlist.c \
reg_path.c \
lex_buf_line.c \
lex_buf_pars.c \
is_tok.c \
is_check.c \
sort_list.c \
sort_list_token.c \
can_create_tree.c \
completion.c \
is_token_type.c \
return_errors.c \
ast_create.c \
find_quote_end.c \
globbing.c \
here_doc.c \
replace_expansions.c\
find_expansions.c \
exp.c \
which_sequence_type.c\
expand_text.c \
replace_regex.c \
check_regex.c \
match_regex.c \
find_regex.c \
expand.c \
ft_get_history.c \
ft_set_history.c \
ft_histopt_filename.c\
ft_histopt_offset.c \
ft_histopt_args.c \
ft_history_opt.c \
ft_history_tools.c \
ft_builtin_history.c\
ft_builtin_bang.c \
ft_default_set.c \
ft_bang_alphanum_sub.c\
ft_bang_special_sub.c\
ft_bang_substitution.c\
ft_quick_substitution.c\
edit_history.c \
ft_print.c
SRCC = $(addprefix $(SDIR),$(SRCS))
ODIR = ./obj/
OBJS = $(SRCS:.c=.o)
OBCC = $(addprefix $(ODIR),$(OBJS))
FLAG = -g -Wall -Werror -Wextra
$(NAME): $(OBCC)
make -C ./libft/
gcc $(FLAG) $(OBCC) -ltermcap -L$(LDIR) $(LIBS) -o $(NAME)
$(ODIR)%.o: $(SDIR)%.c
@mkdir -p $(ODIR)
gcc $(FLAG) -c $^ -o $@ -I$(IDIR) -I$(ILIB)
all: $(NAME)
clean:
echo "Delete all object files"
@make -C ./libft/ clean
/bin/rm -rf $(ODIR)
fclean: clean
echo "Delete objects and binary"
@make -C ./libft/ fclean
/bin/rm -f $(NAME)
re: fclean all
# ft_cmdnew.c \
# ft_cmdadd.c \
# ft_cmdclear.c \
# ft_cmdestroy.c \
# ft_cmdpush.c \