-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (51 loc) · 2 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: barodrig <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/10/15 17:18:05 by barodrig #+# #+# #
# Updated: 2021/11/04 14:23:32 by barodrig ### ########.fr #
# #
# **************************************************************************** #
SHELL = /bin/sh
NAME = pipex
CC = clang -Wall -Wextra -Werror
INC= -I./includes
BONUS= bonus/main.c srcs/ft_errors_manager.c srcs/ft_execute_cmds.c\
SRCS = main ft_errors_manager ft_execute_cmds\
FIL = $(addsuffix .c, $(addprefix srcs/, $(SRCS)))
OBJ = $(FIL:.c=.o)
OBJ_BONUS = $(BONUS:.c=.o)
.c.o:
-@${CC} ${INC} -c $< -o ${<:.c=.o}
all: $(NAME)
$(NAME): $(OBJ)
@echo "Compiling libft..."
@make -s -C ./libft
@echo "--> [OK]"
@echo "Compiling pipex...."
-@$(CC) $(INC) $(OBJ) -Llibft -lft -o $(NAME)
@echo "--> [OK]"
@echo "Now write : ./pipex file1 | cmd1 | cmd2 | cmd... | cmdX | file2"
bonus: $(NAME)_bonus
$(NAME)_bonus : $(OBJ_BONUS)
@echo "Compiling libft..."
@make -s -C ./libft
@echo "--> [OK]"
@echo "Compiling pipex with bonus...."
-@$(CC) $(INC) $(OBJ_BONUS) -Llibft -lft -o $(NAME)_bonus
@echo "--> [OK]"
@echo "Now write : ./pipex file1 | cmd1 | cmd2 | cmd... | cmdX | file2"
clean:
@echo "CLEANING ..."
@make -s clean -C ./libft
@rm -rf $(OBJ) $(OBJ_BONUS)
@echo "--> [OK]"
fclean: clean
@make -s fclean -C ./libft
@rm -f $(NAME)
@rm -f $(NAME)_bonus
re: fclean all
.PHONY: all clean fclean re bonus