forked from JDesbordes/MiniShell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
87 lines (63 loc) · 3.43 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
77
78
79
80
81
82
83
84
85
86
87
# **************************************************************************** #
# LE - / #
# / #
# Makefile .:: .:/ . .:: #
# +:+:+ +: +: +:+:+ #
# By: jdesbord <[email protected]> +:+ +: +: +:+ #
# #+# #+ #+ #+# #
# Created: 2019/11/07 15:34:08 by jdesbord #+# ## ## #+# #
# Updated: 2020/02/04 03:30:38 by jdesbord ### #+. /#+ ###.fr #
# / #
# / #
# **************************************************************************** #
# **************************************************************************** #
# VARIABLES #
# **************************************************************************** #
HEADER = includes/minishell.h
LIB = libftprintf.a libasm.a
LIBS = Libftprintf/libftprintf.a libasm/libasm.a
SRC_PATH = srcs
SRCS_NAME = minishell.c ft_echo.c ft_setup.c ft_input.c ft_cd.c\
ft_env.c ft_parseargs.c ft_exit.c ft_varenv.c ft_list.c\
ft_unset.c ft_redirlst.c extraparse.c ft_redirection.c\
ft_export.c ft_synthax.c ft_freestruct.c ft_tab.c extrasetup.c\
ft_manager.c
OBJS = ${SRCS:.c=.o}
NAME = minishell
RM = rm -f
FLAGS = -g3 -fsanitize=address -Wall -Wextra -Werror
SRCS = $(addprefix $(SRC_PATH)/,$(SRCS_NAME))
# **************************************************************************** #
# REGLES #
# **************************************************************************** #
all: $(NAME)
bonus: all
%.o: %.c $(HEADER) $(LIBS)
@echo "\033[0;32m[OK] \033[0m \033[0;33m Compiling:\033[0m" $<
@gcc $(FLAGS) -I $(HEADER) -c $< -o $@
$(NAME): $(LIB) ART $(OBJS) $(HEADER)
@gcc $(OBJS) $(FLAGS) $(LIBS) -o $(NAME) -lm
@echo "\x1b[36m\n[OK] \033[0m \x1b[35m Compiling Minifell\033[0m"
$(LIB):
@$(MAKE) -C Libftprintf all
@$(MAKE) -C libasm all
clean:
@$(MAKE) -C Libftprintf clean
@$(MAKE) -C libasm clean
@echo "\x1b[36m[OK] \033[0m \x1b[34m Removing ALL File object\033[0m"
@$(RM) $(OBJS)
fclean: clean
@$(MAKE) -C Libftprintf fclean
@$(MAKE) -C libasm fclean
@echo "\x1b[36m[OK] \033[0m \x1b[32m All is Removing\033[0m"
@$(RM) $(NAME)
re: fclean all
ART:
@echo "___ ________ _ _ _____ _____ _ _ _____ _ _ "
@echo "| \/ |_ _| \ | |_ _/ ___| | | || ___| | | | "
@echo "| . . | | | | \| | | | \ '--.| |_| || |__ | | | | "
@echo "| |\/| | | | | . ' | | | '--. \ _ || __|| | | | "
@echo "| | | |_| |_| |\ |_| |_/\__/ / | | || |___| |____| |____"
@echo "\_| |_/\___/\_| \_/\___/\____/\_| |_/\____/\_____/\_____/"
@echo ""
.PHONY: clean fclean