-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (47 loc) · 1.66 KB
/
Makefile
File metadata and controls
62 lines (47 loc) · 1.66 KB
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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: snocita <snocita@student.42wolfsburg.de> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/02/14 17:31:46 by snocita #+# #+# #
# Updated: 2023/02/16 14:33:51 by snocita ### ########.fr #
# #
# **************************************************************************** #
NAME = pipex
CC = gcc
CFLAGS = -Wall -Wextra -Werror
RM = rm -rf
HEADER = pipex.h
SRCS = pipex.c subprocesses.c freeprocesses.c error.c
OBJS = $(SRCS:.c=.o)
OBJ_DIR = obj
INOUT = InOut
LIBFT_PATH = ./LIBFT
LIBFT = $(LIBFT_PATH)/libft.a
%.o: %.c
${CC} ${CFLAGS} -c $< -o $@
all: $(NAME)
$(NAME): $(OBJ_DIR) $(OBJS) $(LIBFT) $(INOUT)
cp $(LIBFT) .
@$(CC) $(CFLAGS) $(OBJS) libft.a -o $(NAME)
mv *.o ./obj
$(OBJ_DIR):
mkdir $(OBJ_DIR)
$(INOUT):
mkdir $(INOUT)
touch InOut/infile.txt InOut/outfile.txt
echo "THE\nQUICK\nBROWN\nFOX\n" > InOut/infile.txt
$(LIBFT):
make -C $(LIBFT_PATH) all
clean:
@$(RM) obj/
@$(RM) InOut/*
@$(RM) InOut
make -C $(LIBFT_PATH) clean
fclean: clean
@$(RM) $(NAME)
$(RM) libft.a
make -C $(LIBFT_PATH) fclean
re: fclean all