-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile-corr
92 lines (73 loc) · 2.23 KB
/
Makefile-corr
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
NAME = minishell
SRC = src/main.c \
src/signals.c \
\
src/build_envs.c \
src/lexer.c \
src/lexer_handlers.c \
src/lexer_utils.c \
src/expand.c \
src/expand_utils.c \
src/quotes.c \
src/populate.c \
src/populate_helpers.c \
\
src/post-parse.c \
\
src/piping.c \
\
src/heredoc.c \
src/envs_commands.c \
src/export_unset.c \
src/check_command.c \
src/cd_command.c \
src/pwd_command.c \
src/echo_command.c \
src/exit_command.c \
\
src/env_utils.c \
src/env_mem.c \
src/tok_utils.c \
src/quotes_utils.c \
src/cmd_utils.c \
src/exec_utils.c \
src/exec_helpers.c \
src/exp_uns_utils.c \
src/misc_utils.c \
src/misc_utils2.c \
\
src/exec_errors.c \
src/syntax_errors.c \
src/clean.c
INC = -I includes -I ~/.brew/opt/readline/include
CC = cc
FLAGS = -g -Wall -Wextra -Werror
LIBFT_LIBRARY_DIR = bigft # Descriptive variable name
LIBS = bigft/libft.a -lreadline -L ~/.brew/opt/readline/lib
OBJS := $(patsubst src/%.c, objs/%.o, ${SRC})
DEPS := $(INC)
GREEN := \033[1;32m
YELLOW := \033[1;33m
CYAN := \033[1;36m
CLR_RMV := \033[0m
RED := \033[1;31m
all: $(NAME)
re: fclean all
objs/%.o: src/%.c
@mkdir -p objs
$(CC) $(FLAGS) $(INC) -o $@ -c $<
clean:
@make clean -C $(LIBFT_LIBRARY_DIR)
@ echo "$(GREEN)Deleting $(YELLOW)bigft $(CLR_RMV)objs ✔️"
@rm -rf $(OBJS)
@echo "$(GREEN)Deleting $(YELLOW)$(NAME)$(CLR_RMV) objs ✔️"
fclean: clean
@make fclean -C $(LIBFT_LIBRARY_DIR)
@ echo "$(GREEN)Deleting $(YELLOW)bigft $(CLR_RMV)binary ✔️"
@rm -rf $(NAME)
@echo "$(GREEN)Deleting $(YELLOW)$(NAME) $(CLR_RMV) binary ✔️"
$(NAME): $(OBJS)
@make -C $(LIBFT_LIBRARY_DIR)
$(CC) $(FLAGS) $(LIBS) bigft/libft.a $(OBJS) -o $@
@echo "$(YELLOW)Done! ✔️$(CLR_RMV)"
.PHONY: all re clean fclean