-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
64 lines (45 loc) · 1.31 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
NAME = pipex
LIBFT = include/libft/libft.a
LIBFT_PATH = include/libft/
SRCS_PATH = src/
CC = gcc
CFLAGS = -Wall -Werror -Wextra -g
RM = rm -f
SRCS_FILES = main.c pipex.c utils.c check_args.c bonus.c functools.c
SRCS = $(addprefix $(SRCS_PATH), $(SRCS_FILES))
OBJS = $(SRCS:.c=.o)
all: $(NAME)
@echo "BOOM 💥💥💥💥💥 $(NAME) Compiled! 💯 $(DEFAULT)"
clean:
@$(RM) $(OBJS)
@make -C $(LIBFT_PATH) clean
@echo "$(YELLOW)Object files deleted!$(DEFAULT)💯"
$(NAME): $(OBJS)
-@$(MAKE) -C $(LIBFT_PATH)
-@$(CC) $(CFLAGS) -o $@ $^ $(LIBFT)
@echo "$(GREEN)$(NAME) created!$(DEFAULT)"
fclean: clean
@$(RM) $(NAME) $(LIBFT)
re: fclean all
.PHONY: all clean libft fclean re
git:
@git add .
@git commit -m "$(COMMIT)"
@echo "\n$(GREEN)$(NAME) Committed!$(DEFAULT)💯"
#COLORS
RED = \033[1;31m
GREEN = \033[1;32m
YELLOW = \033[1;33m
DEFAULT = \033[0m
COMMIT = $(shell date "+%d %B %T")
# //FIXME delete before pushing :)
run:
@./pipex "notes.txt" "cat" "wc" out.txt
runcmd:
@./pipex "notes.txt" "/bin/cat" "/usr/bin/wc" out.txt
summary:
valgrind --leak-check=summary --trace-children=yes --track-fds=yes ./$(NAME)
valgrind:
valgrind --leak-check=full --show-leak-kinds=all --trace-children=yes --track-fds=yes ./$(NAME)
full:
valgrind --leak-check=full ./$(NAME) "Makefile" "cat" "cat" "wc" "out"