-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (44 loc) · 2.03 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: lvincent <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/06/07 16:02:47 by gpouzet #+# #+# #
# Updated: 2023/10/31 03:20:28 by gpouzet ### ########.fr #
# #
# **************************************************************************** #
CC = clang
FLAGS = -Wall -Wextra -Werror
NAME = minishell
SRC = src/small_builtins.c src/g_env.c src/ft_echo.c src/main.c src/parserv2.c\
src/parser.c src/pars_redir.c src/arg_sep.c src/t_data.c src/env_sep.c \
src/exec.c src/export.c src/redirections.c src/pipeline.c src/heredoc.c\
src/utils.c src/utils2.c src/utils3.c src/ft_exit.c src/signal.c src/quote.c\
src/error.c src/ft_export.c src/exception.c src/utils4.c src/parser_env.c
OBJ = $(SRC:.c=.o)
%.o: %.c
@$(CC) $(FLAGS) -o $@ -c $<
@echo -n "\\r\033[2K"
@echo -n "\\r\033[1;33m[compiling...]"$<
all: $(NAME)
$(NAME): $(OBJ)
@make -s --no-print-directory -C libft
@$(CC) $(FLAGS) $(OBJ) -lreadline -L./libft -lft -o $(NAME)
@echo -n "\\r\033[2K"
@echo "\033[1;32m[executable created]"
clean:
@make fclean --no-print-directory -C libft
@rm -rf $(OBJ)
fclean: clean
@rm -rf $(NAME)
@echo "\033[1;32m[Programe deleted]"
re: fclean all
debug: FLAGS += -g
debug: fclean $(OBJ)
@make debug_lib -s --no-print-directory -C libft
@$(CC) $(FLAGS) -g $(OBJ) -lreadline -L./libft -lft -o $(NAME)
@echo -n "\\r\033[2K"
@echo "\033[1;32m[executable created]"
.PHONY: all clean fclean re debug