-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
167 lines (137 loc) · 8.25 KB
/
Copy pathmakefile
File metadata and controls
167 lines (137 loc) · 8.25 KB
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
155
156
157
158
159
160
161
162
163
164
165
166
167
define HEADER
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣠⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠂⠂⢄
⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣾⣿⣿⣿⣤⡀⠀⠀⠀⠀⢀⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠊⠀⠀⠀⠀⠑⡀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⣾⣿⣿⣻⡿⣿⣿⣦⡀⠀⠀⢄⠁⠢⠀⠀⠀⠀⠀⠀⠀⠀⠀⡐⠀⠀⠀⠀⠀⠀⠀⢐
⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣷⣿⣟⣿⣿⣻⣿⣿⣷⣀⠢⠀⠀⠁⠢⠀⢄⠀⠀⠀⠀⢀⠂⠀⠀⠀⠀⠀⠀⠀⠠⡁
⠀⠀⠀⠀⠀⠀⠀⠀⢀⢸⣿⣾⣿⣽⣯⣿⣯⡿⠿⠟⠷⠀⠀⠀⠀⠀⠀⠈⠂⡌⠢⡐⠀⠀⠀⠀⠀⠀⠀⠀⠠⡁
⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⡿⣷⣿⠽⠋⠃⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠢⠈⢄
⠀⠀⠀⢄⠀⠀⠀⠀⠀⠶⠿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠄⠐⠠⠀⠀⡈⠢⡀⠀⠀⠀⠠⠁⠀⠀⠑⢄
⠀⠀⠀⠐⡈⠁⠁⠈⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⢄⠀⠀⢀⠂⠀⠈⠢⡀⠀⡊⠀⠀⠀⠀⠀⢂⠀
⠀⠀⠀⠀⠢⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠔⠀⢀⢀⠂⠀⠀⠀⠀⠱⠀⠀⠀⠀⠀⠀⠐⠄
⠀⠀⠀⠀⠈⢂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢁⠉⠐⠄⡀⠀⠀⠀⠀⢀⠀⡀⢀⠁⠁⠁⠀⠀⠀⠀⠀⠀⡅⠀⠀⠀⠀⠀⠀⢀⠇
⠀⠀⠀⠀⠀⠀⠑⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠡⡀⢀⠈⢂⠀⡅⠈⠀⠀⢁⠌⠀⠀⠀⠀⠀⠀⠀⠀⠀⢂⠀⠀⠀⠀⠀⠀⡰⠁⠄
⠀⠀⠀⠀⠀⠀⠰⠀⠀⠀⠀⠀⢀⡀⣠⣤⣤⣄⡈⠀⠀⠀⢆⠐⢄⠠⠂⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠆⠀⠀⠀⠀⡰⠁⢨
⠀⠀⠀⠀⠀⠀⢃⠀⠀⠀⠀⠀⠠⠀⠸⠀⠰⣿⢿⠀⢄⢀⠀⡀⠠⠠⠾⠶⠷⢷⣶⣤⣂⠰⠀⠄⠠⢀⢀⠈⢂⠀⠀⠀⠠⢂
⠀⠀⠀⠀⠀⠀⠈⢄⠠⠀⠄⠔⠁⠀⠘⡀⠈⣿⣦⠂⠀⠀⠀⠀⠀⠀⡃⠀⠀⢿⣿⣧⢈⣷⡦⠀⠀⠀⠠⠘⠀⠃⠂⠄⠤⠠⠈⡢
⠀⠀⠀⠀⠀⠀⠀⠀⠑⢄⠀⠀⠀⠀⠀⠣⢀⠌⢃⢈⢉⠐⠐⠄⠠⠀⡅⠀⠀⠹⣿⠿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢌⢁
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡱⢀⠐⠀⠁⠈⠀⠂⠂⠢⠀⠑⠀⠀⠀⠁⠈⡐⠐⠀⠈⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠔⠁
⠀⠀⠀⠀⠀⠀⠀⠀⢀⠌⠀⠆⠠⣶⣷⣷⡦⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠒⡁
⠀⠀⠀⠀⠀⠀⠀⠀⠡⠠⡀⢘⠀⠙⠛⠉⠀⠀⠀⠀⠀⠀⠀⢀⣠⣄⣄⠀⠀⠀⠑⠠⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡅
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢐⠁⠢⠐⠐⠂⠤⠠⡀⡀⢀⠀⠀⢀⡬⠋⠁⠀⠀⠀⠀⠀⠐⢄⠀⠀⠀⠀⠀⠀⠀⠀⢢
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢨⠀⠈⠄⠀⠀⠀⠀⠀⠀⠁⠈⠂⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠢⢀⠀⠀⠀⠀⠀⠀⢷⣔⡄⢀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠆⠄⡀⣈⠢⢄⡀⣀⢀⠀⡀⣀⢀⣀⣀⣀⣀⣀⠀⠀⠀⠀⠀⠀⣀⠀⠀⠁⣿⣾⣷⣿⣾⣾⣿⠿⠇⢈⠂
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⠿⠟⠂⠢⡀⠀⠿⠶⢀⠘⠋⠉⠉⠈⠁⠀⠀⠀⢀⠌
⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠔⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⡀⠿⠛⠛⠊⠀⠂⠈⠈⠀⠈⠐⠀⠀⠀⠁⠀⠀⠀⠀⠀⠀⠀⢀⠂
⠀⠀⠀⠀⠀⠀⠀⢀⠐⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⢍⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠂
⠀⠀⠀⠀⠀⠀⠀⠀⠑⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠐⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠄⠢⠈⠐⠁⠑⠈⠂⠑⠄⡀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⢄⠀⠀⠀⠀⠀⠀⠀⢀⢃⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠊⠀⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⡀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠞⠉⠐⠄⠀⠀⠀⠀⢐⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⠄⡀
⠀⠀⠀⠀⠀⠀⠀⠀⡰⠀⠀⠀⠌⠀⠀⠀⠀⠀⠈⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠠⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠂⢄
⠀⠀⠀⠀⠀⠀⠀⢐⠁⠀⠀⠨⡀⠀⠀⠀⠀⠀⠀⡣⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢀⠀⡑⠤⡀
⠀⠀⠀⠀⠀⠀⠀⠆⠀⠀⠀⠀⠈⠢⡀⠀⠀⠀⠀⠆⠡⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⠔⠈⠀⠀⠀⠀⠀⠀⠡
\033[38;5;201m_ __ ___ ___ ___ _ __\033[0m
\033[38;5;201m| '_ ` _ \ / _ \ / _ \| '_ \ \033[0m
\033[38;5;141m| | | | | | (_) | (_) | |_) |\033[0m
\033[38;5;68m|_| |_| |_|\___/ \___/| .__/\033[0m
\033[38;5;68m|_|\033[0m
\033[38;5;196m----------\033[38;5;208m----------\033[38;5;226m----------\033[38;5;46m----------\033[38;5;21m----------\033[38;5;129m----------\033[0m
endef
export HEADER
define HEADER_LIB
_____ _ _ _ _ _ _ _
/ __ \ (_) (_) | | (_) | (_)
| / \/ ___ _ __ ___ _ __ _| |_ _ __ __ _ | | _| |__ _ __ __ _ _ __ _ ___ ___
| | / _ \| '_ ` _ \| '_ \| | | | '_ \ / _` | | | | | '_ \| '__/ _` | '__| |/ _ \/ __|
| \__/\ (_) | | | | | | |_) | | | | | | | (_| | | |___| | |_) | | | (_| | | | | __/\__ \
\____/\___/|_| |_| |_| .__/|_|_|_|_| |_|\__, | \_____/_|_.__/|_| \__,_|_| |_|\___||___/
| | __/ |
|_| |___/
endef
export HEADER_LIB
define HEADER_NAME
_____ _ _ _ _ _ _ _ _
/ __ \ (_) (_) (_) (_) | | | | |
| / \/ ___ _ __ ___ _ __ _| |_ _ __ __ _ _ __ ___ _ _ __ _ ___| |__ ___| | |
| | / _ \| '_ ` _ \| '_ \| | | | '_ \ / _` | | '_ ` _ \| | '_ \| / __| '_ \ / _ \ | |
| \__/\ (_) | | | | | | |_) | | | | | | | (_| | | | | | | | | | | | \__ \ | | | __/ | |
\____/\___/|_| |_| |_| .__/|_|_|_|_| |_|\__, | |_| |_| |_|_|_| |_|_|___/_| |_|\___|_|_|
| | __/ |
|_| |___/
endef
export HEADER_NAME
# Variables
GREEN = \033[0;32m
ORANGE = \033[38;5;208m
RESET = \033[0m
NAME = minishell
CC = cc
CFLAGS = -Wall -Wextra -Werror -lreadline -g
DEVFLAGS = -lreadline -g3
RM = rm -f
EXTENDED_FT = libs/extended_ft/
EXFT_LIB = $(EXTENDED_FT:%=%libft.a)
SRCS = srcs/minishell.c \
SUPP = srcs/error_handling/errors.c \
srcs/error_handling/exec_err.c \
srcs/initialization/init.c \
srcs/initialization/init_utils.c \
srcs/initialization/init_env.c \
srcs/lexing/lexing.c \
srcs/lexing/token_funcs.c \
srcs/minishell_loop/main_loop.c \
srcs/builtins/cd.c \
srcs/builtins/echo.c \
srcs/builtins/env.c \
srcs/builtins/export.c \
srcs/builtins/exit.c \
srcs/builtins/pwd.c \
srcs/builtins/unset.c \
srcs/parsing/parsing.c \
srcs/parsing/parsing_utils.c \
srcs/parsing/pipeline_fd_funcs.c \
srcs/parsing/pipeline_ll_funcs.c \
srcs/parsing/exec_path.c \
srcs/parsing/parsing_envvars.c \
srcs/execution/execute.c \
srcs/execution/execute_one.c \
srcs/execution/execute_utils.c \
srcs/execution/execute_builtins.c \
srcs/in_out_files/files.c \
srcs/in_out_files/infile.c \
srcs/in_out_files/heredoc.c \
srcs/in_out_files/outfile.c \
srcs/signals/signals.c \
srcs/signals/signals_utils.c \
srcs/env/env_funcs.c \
srcs/env/env_extras.c \
$(NAME): $(EXFT_LIB) $(SRCS) $(SUPP)
@echo "$$HEADER_NAME"
@$(CC) $(SUPP) $(SRCS) $(EXFT_LIB) $(CFLAGS) -o $(NAME)
$(EXFT_LIB): $(EXTENDED_FT)makefile
@echo "$$HEADER_LIB"
@make -C $(EXTENDED_FT)
# Rules
all: $(NAME)
debug: $(EXFT_LIB)
@echo "$(ORANGE)Compiling debug $(NAME)$(RESET)"
@$(CC) $(SUPP) $(SRCS) $(EXFT_LIB) $(DEVFLAGS) -o $(NAME)
clean:
@echo "$(ORANGE)Cleaning up...$(RESET)"
@make -s fclean -C $(EXTENDED_FT)
@echo "$(GREEN)Clean up successful$(RESET)"
fclean: clean
@echo "$(ORANGE)Full clean up...$(RESET)"
@rm -f $(NAME)
@echo "$(GREEN)Full clean up successful$(RESET)"
re: fclean all
header:
@echo "$$HEADER"
help:
@echo "$$HEADER"
@echo "\033[0;36mmake\033[0m : complies the project."
@echo "\033[0;36mmake all\033[0m : complies the project and the bonus."
@echo "\033[0;36mmake re\033[0m : recompiles the project."
@echo "\033[0;36mmake debug\033[0m : runs the program in debug mode."
@echo "\033[0;36mmake clean\033[0m : cleans up object files."
@echo "\033[0;36mmake fclean\033[0m : cleans up all files generated by the makefile."
.PHONY: all clean fclean re header debug help