-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
89 lines (66 loc) · 1.57 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
88
89
NAME = minishell
SRCS = srcs/main.c\
srcs/parser.c\
srcs/pipe.c\
srcs/command.c\
srcs/args.c\
srcs/bin.c\
srcs/builtins.c\
srcs/bash.c\
srcs/cd.c\
srcs/export.c\
srcs/unset.c\
srcs/utils.c\
srcs/lens.c\
srcs/remove.c\
srcs/exit.c\
OBJS = $(SRCS:.c=.o)
CC = gcc
CFLAGS += -Wall -Werror -Wextra -g3 -fsanitize=address
#CFLAGS += -g3 -fsanitize=address
RM = rm -rf
LIBFT = libft.a
LIBFTDIR = libft/
LIBFTLINK = -L $(LIBFTDIR) -lft
all: $(NAME)
$(NAME): complib echoCM $(OBJS) echoOK
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBFTLINK)
complib:
$(MAKE) -C libft/
%.o: %.c
$(CC) -c $(CFLAGS) -o $@ $<
printf "$(GREEN)██"
clean: echoCLEAN
$(MAKE) -C $(LIBFTDIR) clean
$(RM) $(OBJS)
fclean: clean echoFCLEAN
$(MAKE) -C $(LIBFTDIR) fclean
$(RM) $(OBJS)
$(RM) $(NAME)
re: fclean all
leaks:
valgrind --leak-check=full --show-leak-kinds=all ./$(NAME)
git:
make fclean
git add .
git commit -m "make done"
git push
norme:
norminette ./srcs/* ./libft/*
.PHONY: all clean fclean re leaks git norme
.SILENT:
##############______________Colors______________##############
RED = \033[1;31m
GREEN = \033[1;32m
YELLOW = \033[1;33m
CYAN = \033[1;36m
END = \033[0m
##############______________MESSAGES______________##############
echoCM:
echo "$(YELLOW)===> Compiling $(RED)Minishell$(END)\n"
echoOK:
echo "$(GREEN) OK ===> Compilation Success$(END)\n"
echoCLEAN :
echo "\n$(CYAN)===> Cleanning OBJS$(END)"
echoFCLEAN :
echo "$(CYAN)===> Cleanning minishell & Libft$(END)\n"