-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
105 lines (87 loc) · 3.04 KB
/
Makefile
File metadata and controls
105 lines (87 loc) · 3.04 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: njegat <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/02/08 10:20:47 by njegat #+# #+# #
# Updated: 2023/04/24 19:07:21 by ltuffery ### ########.fr #
# #
# **************************************************************************** #
NAME = minishell
CC = clang
FLAGS = -Werror -Wextra -Wall -g
RLFLAGS = -L/usr/local/lib -I/usr/local/include -lreadline
LINK_LIB = libft/
NAME_LIB = libft.a
SRC = src/minishell.c \
src/parsing/parsing.c \
src/parsing/check_quote.c \
src/parsing/check_pipe.c \
src/parsing/check_redirecting.c \
src/lexer/lexer.c \
src/lexer/split_prompt.c \
src/lexer/get_redirect.c \
src/lexer/interpreter_var.c \
src/lexer/redirect_rename.c \
src/lexer/tokens/variable.c \
src/lexer/get_cmd.c \
src/utils/lexer_utils.c \
src/utils/free_struct.c \
src/utils/env_utils.c \
src/utils/exitcode_utils.c \
src/utils/heredoc_utils.c \
src/builtins/export.c \
src/builtins/export/export_parsing.c \
src/builtins/export/export_print.c \
src/builtins/export/export_utils.c \
src/builtins/cd.c \
src/builtins/echo.c \
src/builtins/env.c \
src/builtins/exit.c \
src/builtins/pwd.c \
src/builtins/unset.c \
src/execution/exec_handler.c \
src/execution/exec_utils.c \
src/execution/files_mana.c \
src/execution/get_path.c \
src/execution/heredoc_handler.c \
src/execution/simple_exec/single_cmd.c \
src/execution/simple_exec/simple_exec_utils.c \
src/execution/pipe/pipe_handler.c \
src/execution/pipe/pipe_exec.c \
src/execution/pipe/select_pipe.c \
src/execution/pipe/pipe_utils.c \
src/execution/pipe/pipe_dup_handler.c \
src/signals/init.c
BSRC =
OBJ = $(SRC:%.c=%.o)
BOBJ = $(BSRC:%.c=%.o)
%.o: %.c
@$(CC) $(FLAGS) -c $< -o $@
$(NAME): $(OBJ)
@make -s -C $(LINK_LIB)
@$(CC) $(FLAGS) $(RLFLAGS) $(OBJ) $(LINK_LIB)$(NAME_LIB) -o $(NAME)
@echo "\033[4;32m--- executable created ---\n\033[0m"
all: $(NAME)
bonus: $(BOBJ)
@make -s -C $(LINK_LIB)
@$(CC) $(BOBJ) $(LINK_LIB)$(NAME_LIB) -o $(NAME)
@echo "\033[4;32m--- executable created ---\n\033[0m"
clean:
@rm -rf $(OBJ)
@rm -rf $(BOBJ)
@make -s -C $(LINK_LIB) clean
fclean: clean
@rm -rf $(NAME)
@make -s -C $(LINK_LIB) fclean
@echo "\033[4;35m--- all creations have been deleted ---\n\033[0m"
re: fclean all
test:
@make -s -C libft
@clang tests/$(FILE).c src/builtins/$(FILE).c libft/libft.a -g
@valgrind ./a.out
@rm a.out
@make fclean -s -C libft
.PHONY: all clean fclean re bonus