-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (54 loc) · 2.4 KB
/
Makefile
File metadata and controls
67 lines (54 loc) · 2.4 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: gcatarin <gcatarin@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/02/06 12:17:17 by helferna #+# #+# #
# Updated: 2024/02/26 14:00:48 by gcatarin ### ########.fr #
# #
# **************************************************************************** #
NAME = minishell
OS = $(shell uname)
CC = @cc
FLAGS = -Wall -Wextra -Werror -g #-fsanitize=address
LFT = libft/libft.a
INC = -I./libft -I./include
SRC = src/main.c src/parser/lexer.c src/clean/ft_free.c src/executor/executor.c \
src/builtins/exec_builtin.c src/builtins/echo.c src/builtins/cd.c src/builtins/unset.c \
src/builtins/env.c src/builtins/exit.c src/builtins/export.c src/builtins/pwd.c \
src/utils/ft_utils.c src/signals/signals.c src/redirect/heredoc.c src/utils/ft_lists.c \
src/redirect/redirect.c src/redirect/handle_files.c src/expander/expander.c \
src/utils/ft_utils_2.c src/parser/quotes.c src/utils/ft_export_utils.c \
src/errors/error.c src/utils/ft_utils_3.c src/utils/ft_utils_4.c src/expander/ft_expander_utils.c
OBJ = $(patsubst src/%.c, obj/%.o, $(SRC))
all: $(MLX) $(LFT) obj $(NAME)
$(NAME): $(OBJ)
$(CC) $(FLAGS) -I./include -lreadline -lncurses -o $@ $^ $(LFT)
$(LFT):
@make -sC libft
obj:
@mkdir -p obj
obj/%.o: src/%.c
@mkdir -p $(dir $@)
$(CC) $(FLAGS) -lreadline $(INC) -c $< -o $@
@mkdir -p obj
clean:
@make -sC libft clean
@rm -rf $(OBJ) obj
fclean: clean
@make -sC libft fclean
@rm -rf $(NAME)
re: fclean all
r:
@make re && clear
./minishell
# v:
# make re && clear && valgrind ./minishell
v: re readline.supp
clear
@valgrind --track-fds=yes --show-leak-kinds=all --leak-check=full --suppressions=readline.supp ./minishell
readline.supp:
@wget https://raw.githubusercontent.com/benjaminbrassart/minishell/master/readline.supp 2> /dev/null 1> /dev/null
.PHONY: all