-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·134 lines (120 loc) · 2.99 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
127
128
129
130
131
132
133
134
NAME = ush
NLIB = libmx
PLIB = Libmx/$(NLIB).a
SRCD = src
INCD = inc
OBJD = obj
LBMXINC = $(NLIB).h
INC = environment.h \
evaluator.h \
i.h \
liststr.h \
p.h \
parser.h \
ush.h \
SRC = main.c \
mx_builtin_cd.c \
mx_builtin_echo.c \
mx_builtin_echo2.c \
mx_builtin_env.c \
mx_builtin_exit.c \
mx_builtin_export.c \
mx_builtin_fg.c \
mx_builtin_fg2.c \
mx_builtin_jobs.c \
mx_builtin_pwd.c \
mx_builtin_which.c \
mx_builtins.c \
mx_check_buffer.c \
mx_driver_loop.c \
mx_env_get_value.c \
mx_env_new_delete.c \
mx_env_set_var.c \
mx_environ_copy.c \
mx_eval.c \
mx_eval_assignment.c \
mx_eval_command_substitution.c \
mx_eval_file_expansion.c \
mx_eval_logics.c \
mx_eval_parameter_expansion.c \
mx_eval_redirections1.c \
mx_eval_redirections2.c \
mx_eval_redirections3.c \
mx_eval_redirections4.c \
mx_eval_redirections5.c \
mx_eval_sequence.c \
mx_eval_sequence_pipeline.c \
mx_eval_simple_command1.c \
mx_eval_simple_command2.c \
mx_eval_simple_command3.c \
mx_eval_simple_command4.c \
mx_exec_apply_pipe.c \
mx_exec_try_bin.c \
mx_execute.c \
mx_free_all.c \
mx_global_env_new_delete.c \
mx_history.c \
mx_init_shell.c \
mx_liststr_convert_argv.c \
mx_liststr_delete.c \
mx_liststr_init.c \
mx_liststr_length.c \
mx_liststr_pop_front.c \
mx_liststr_push_back.c \
mx_liststr_push_front.c \
mx_new_delete_config.c \
mx_new_evalresult.c \
mx_parse_words_sequence1.c \
mx_parse_words_sequence2.c \
mx_parser_assignment.c \
mx_parser_change_mode.c \
mx_parser_find_command_substitution1.c \
mx_parser_find_command_substitution2.c \
mx_parser_find_command_substitution3.c \
mx_parser_find_file_expansion.c \
mx_parser_find_param.c \
mx_parser_get_binary_opid.c \
mx_parser_get_op_name.c \
mx_parser_get_operator_info_byid.c \
mx_parser_has_expression_operator.c \
mx_parser_is_closed_expression.c \
mx_parser_smart_find.c \
mx_parser_split_two_str.c \
mx_parser_strstr_esc.c \
mx_parser_trim.c \
mx_print_prompt.c \
mx_print_error_messages.c \
mx_read_input.c \
mx_sort_arr.c \
mx_strjoin_with_space.c \
mx_get_var_part.c \
mx_match_search.c \
mx_export_var_to_lists.c \
mx_flags_map.c \
mx_path_cancat.c \
mx_flags_handler_cd.c \
mx_flags_handler_env.c \
mx_environ_handler_env.c \
mx_exec_env.c \
mx_flags_settings_cd.c \
OBJ = $(SRC:.c=.o)
SRCS = $(addprefix $(SRCD)/, $(SRC))
INCS = $(addprefix $(INCD)/, $(INC))
LBMXP = Libmx/inc/$(NLIB).h
CFLAG = -std=c11 -Wall -Wextra -Wpedantic -Werror -Wunused-parameter
all: install clean
install:
@make -sC $(NLIB) install
@cp $(SRCS) $(INCS) $(LBMXP) .
@clang $(CFLAG) -c $(SRC) -I $(INC)
@mkdir $(OBJD)
@clang $(CFLAG) $(OBJ) $(PLIB) -o $(NAME)
@mv $(OBJ) $(OBJD)
@rm -rf $(LBMXINC) $(SRC) $(INC) *.gch
uninstall: clean
@make -sC $(NLIB) $@
@rm -rf $(NAME)
clean:
@make -sC $(NLIB) $@
@rm -rf $(OBJ) $(OBJD)
reinstall: uninstall install