-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
76 lines (53 loc) · 2.3 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: asepulve <asepulve@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/03/15 14:26:54 by mvicente #+# #+# #
# Updated: 2023/04/27 23:54:24 by asepulve ### ########.fr #
# #
# **************************************************************************** #
# > >> < * ? [ ] | ; [ ] || && ( ) & # $ << " '
NAME = minishell
CC = cc
CFLAGS = -Wall -Wextra -Werror #-fsanitize=address
RM = rm -f #-fsanitizer==address
EXPANDER_SRC = expander.c utils_expander.c
LEXER_SRC = lexer.c command_to_tokens.c
PARSER_SRC = env_utils.c utils_parser_1.c parser.c redirect_outf_inf.c \
redirect_heredoc.c
EXECUTOR_SRC = cd.c echo.c builtins.c pwd.c commands.c execution.c \
export.c pipes.c env.c exit.c print_export.c unset.c \
update_var.c aux_executor.c check_arguments.c
UTILS_SRC = data_output.c string_jumps.c utils_list_1.c __def_env.c utils_general_1.c \
validator.c frees.c get_com_number.c aux.c signals.c utils_files.c \
formatter.c utils_lexer_1.c utils_list_2.c
SRC = $(addprefix expander/,$(EXPANDER_SRC)) \
$(addprefix lexer/,$(LEXER_SRC)) \
$(addprefix parser/,$(PARSER_SRC)) \
$(addprefix executor/,$(EXECUTOR_SRC)) \
$(addprefix utils/,$(UTILS_SRC)) \
main.c
LIBFT = libft/libft.a
OBJ = $(SRC:.c=.o)
%.o: %.c
@$(CC) $(CFLAGS) -c $^ -o $@
all: $(NAME)
$(NAME): $(OBJ)
@make -s -C libft
@$(CC) $(CFLAGS) $(OBJ) $(LIBFT) -o $(NAME) -lreadline
clean:
@make clean -s -C libft
@$(RM) $(OBJ)
v:
@make -s
valgrind --verbose --leak-check=full --track-origins=yes --show-leak-kinds=all ./minishell 2> valgrind.txt
run:
./minishell
fclean: clean
@make fclean -s -C libft
@$(RM) $(NAME)
re: fclean all
.PHONY: all clean