-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
154 lines (139 loc) · 3.42 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
APP_NAME = ush
LIBMXF = libmx
LIB_NAME = libmx.a
INC = \
inc/ \
libmx/inc/
SRC_DIR = src
OBJ_DIR = obj
SRC = $(addprefix $(SRC_DIR)/,\
builds/mx_cd.c \
builds/mx_pwd.c \
builds/mx_env.c \
builds/mx_export.c \
builds/mx_exit.c \
builds/mx_echo.c \
builds/mx_which.c \
builds/mx_check_symlink.c\
builds/mx_find_flag.c\
builds/mx_file_exist.c\
builds/mx_parse_echo.c\
builds/mx_execute_env_flags.c\
builds/mx_free_env.c\
builds/mx_env_error.c\
builds/mx_getenv.c\
builds/mx_handle_path.c \
builds/mx_parse_env_args.c\
input/mx_process_input.c \
input/mx_input_ascii.c \
input/mx_input_non_ascii.c \
input/mx_set_non_canonic.c \
input/mx_fill_command.c \
input/mx_get_twidth.c \
input/mx_getch.c \
input/mx_move_coursor.c \
parsing/mx_count_queue_operation.c \
parsing/mx_create_queue.c \
parsing/mx_insort_t_queue.c \
parsing/mx_parsing.c \
parsing/mx_pop_front_queue.c \
parsing/mx_push_back_queue.c \
printing/mx_print_prompt.c \
executing/mx_execute.c \
executing/mx_push_execute_queue.c \
executing/mx_check_expansion.c \
executing/mx_create_redirect.c\
executing/mx_child_execute.c\
executing/mx_split_echo.c \
executing/mx_tidle_check.c \
main/mx_coomand_in_path.c \
main/mx_create_ush.c \
main/mx_is_builtin.c \
main/mx_use_pipe.c \
main/main.c \
history/mx_free_history.c \
utils/mx_util_get_flag_index.c \
utils/mx_util_replace_operator.c \
utils/mx_util_strsplit_one.c \
utils/mx_util_strincpy.c \
utils/mx_util_strindup.c \
com_sub/mx_com_sub.c \
com_sub/mx_com_sub_back.c \
com_sub/mx_com_sub_free.c \
com_sub/mx_com_sub_space.c \
com_sub/mx_create_com_sub.c )
OBJ = \
mx_cd.o \
mx_pwd.o \
mx_env.o \
mx_export.o \
mx_exit.o \
mx_echo.o \
mx_which.o \
mx_check_symlink.o\
mx_find_flag.o\
mx_parse_echo.o\
mx_execute_env_flags.o\
mx_getenv.o\
mx_env_error.o\
mx_free_env.o\
mx_handle_path.o\
mx_parse_env_args.o\
mx_file_exist.o\
mx_process_input.o \
mx_input_ascii.o \
mx_input_non_ascii.o \
mx_set_non_canonic.o \
mx_fill_command.o \
mx_get_twidth.o \
mx_getch.o \
mx_move_coursor.o \
mx_count_queue_operation.o \
mx_create_queue.o \
mx_insort_t_queue.o \
mx_parsing.o \
mx_pop_front_queue.o \
mx_push_back_queue.o \
mx_print_prompt.o \
mx_execute.o \
mx_push_execute_queue.o \
mx_check_expansion.o \
mx_create_redirect.o \
mx_child_execute.o \
mx_coomand_in_path.o \
mx_create_ush.o \
mx_is_builtin.o \
mx_use_pipe.o \
main.o \
mx_free_history.o \
mx_util_get_flag_index.o \
mx_util_replace_operator.o \
mx_util_strsplit_one.o \
mx_com_sub.o \
mx_com_sub_back.o \
mx_com_sub_free.o \
mx_com_sub_space.o \
mx_create_com_sub.o \
mx_util_strincpy.o \
mx_split_echo.o \
mx_tidle_check.o \
mx_util_strindup.o
CC = clang
CFLAGS = -std=c11 -Wall -Wextra -Werror -Wpedantic
all : install
install : libmx/libmx.a ush
libmx/libmx.a:
@make -C $(LIBMXF)
ush : $(SRC) inc/ush.h libmx/libmx.a
@$(CC) $(CFLAGS) -c $(SRC) $(foreach d, $(INC), -I $d)
@$(CC) $(CFLAGS) $(OBJ) $(LIBMXF)/$(LIB_NAME) -o $(APP_NAME) -ltermcap
@printf "\r\33[2Kush \033[32;1mcreated\033[0m\n"
@mkdir -p $(OBJ_DIR)
@mv $(OBJ) $(OBJ_DIR)
uninstall : clean
@make uninstall -C $(LIBMXF)
@rm -rf $(APP_NAME)
clean :
@make clean -C $(LIBMXF)
@rm -rf $(OBJ_DIR)
reinstall : uninstall install