-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
75 lines (59 loc) · 2.52 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: hkaddour <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/01/19 17:47:10 by hkaddour #+# #+# #
# Updated: 2022/11/07 14:51:25 by hkaddour ### ########.fr #
# #
# **************************************************************************** #
NAME = pipex
CC = cc
HEADER = include/pipex.h
CFLAGS = -Wall -Wextra -Werror
SRCS = $(addprefix mandatory/, main.c execution_utils.c execution.c)
SRCS_B = $(addprefix bonus/, main_bonus.c heredoc.c gnl.c pipeline.c \
utils_bonus.c ../mandatory/execution_utils.c)
LIB = libft/libft.a
INF = infile
OBJS = $(SRCS:.c=.o)
OBJS_B = $(SRCS_B:.c=.o)
BGreen=\033[1;32m
BYellow=\033[1;33m
BBlue=\033[1;34m
BPurple=\033[1;38;5;205m
BRed=\033[1;31m
all : tag $(INF) $(NAME)
$(NAME): $(LIB) $(OBJS)
@echo "\n$(BBlue)Compline object files to $(BPurple)$(NAME)"
@$(CC) $(OBJS) $(LIB) -o $@
%.o: %.c $(HEADER)
@/bin/echo -n "."
@$(CC) $(CFLAGS) -c $< -o $@ -I $(HEADER)
bonus: $(INF) $(LIB) $(OBJS_B)
@/bin/echo -n "."
@$(CC) $(OBJS_B) $(LIB) -o $(NAME)
$(LIB):
@make -C ./libft
$(INF):
@touch $@
tag:
@echo "$(BGreen)"
@echo "██████╗ ██╗██████╗ ███████╗██╗ ██╗"
@echo "██╔══██╗██║██╔══██╗██╔════╝╚██╗██╔╝"
@echo "██████╔╝██║██████╔╝█████╗ ╚███╔╝ "
@echo "██╔═══╝ ██║██╔═══╝ ██╔══╝ ██╔██╗ "
@echo "██║ ██║██║ ███████╗██╔╝ ██╗ BY HKADDOUR"
@echo "╚═╝ ╚═╝╚═╝ ╚══════╝╚═╝ ╚═╝"
clean:
@echo "$(BRed)clean"
@make clean -C ./libft
@rm -rf $(OBJS) $(OBJS_B)
fclean:
@echo "$(BRed)fclean"
@make fclean -C ./libft
@rm -rf $(NAME) $(OBJS) $(OBJS_B)
re: fclean all
.PHONY: all bonus tag clean fclean re