-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (39 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: lsilva-x <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2025/01/13 00:00:06 by lsilva-x #+# #+# #
# Updated: 2025/01/15 16:59:34 by lsilva-x ### ########.fr #
# #
# **************************************************************************** #
CC = cc
CFLAGS = -Wall -Wextra -Werror
NAME = pipex
SRC_DIR = ./src
OBJ_DIR = ./build/objects
INC_DIR = ./includes
SRC = $(SRC_DIR)/pipex.c \
$(SRC_DIR)/pipex_utils.c \
$(SRC_DIR)/path_search.c
OBJS = $(SRC:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
LIBFT_DIR = ./lib/libft
LIBFT = $(LIBFT_DIR)/lib/libft.a
all: $(NAME)
$(NAME): $(OBJS) $(LIBFT)
$(CC) $(CFLAGS) -I $(INC_DIR) $(OBJS) $(LIBFT) -o ./bin/$(NAME)
$(LIBFT):
$(MAKE) -C $(LIBFT_DIR)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
mkdir -p $(OBJ_DIR)
$(CC) $(CFLAGS) -I $(INC_DIR) -c $< -o $@
clean:
rm -f $(OBJS)
$(MAKE) -C $(LIBFT_DIR) clean
fclean: clean
rm -f $(NAME)
$(MAKE) -C $(LIBFT_DIR) fclean
re: fclean all
.PHONY: all clean fclean re