-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
54 lines (41 loc) · 1.56 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ledias-d <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/09/21 17:00:35 by ledias-d #+# #+# #
# Updated: 2024/11/26 18:54:43 by ledias-d ### ########.fr #
# #
# **************************************************************************** #
NAME = pipex
CC = cc
CFLAGS = -Wall -Wextra -Werror
LIBFT_DIR = ./libft
LIBFT = $(LIBFT_DIR)/libft.a
MAKE_LIBFT = make -C $(LIBFT_DIR)
SRCS = pipex.c utils.c
OBJS = $(SRCS:.c=.o)
TEST_SRC = $(SRCS)
TEST_EXEC = test
all: $(LIBFT) $(NAME)
$(NAME): $(OBJS)
$(CC) $(CFLAGS) -o $(NAME) $(OBJS) $(LIBFT)
$(LIBFT):
$(MAKE_LIBFT)
testfiles:
@echo "Creating test files..."
@touch infile outfile
@echo "ainda" > infile
@echo "Jamal bieber" >> infile
@echo "vai tomando" >> infile
@echo "Test files 'infile' and 'outfile' created successfully."
clean:
rm -f $(OBJS)
$(MAKE_LIBFT) clean
fclean: clean
rm -f $(NAME) $(TEST_EXEC)
$(MAKE_LIBFT) fclean
re: fclean all
.PHONY: all clean fclean re test