-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (42 loc) · 1.55 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: alida-si <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/03/29 18:20:49 by alida-si #+# #+# #
# Updated: 2022/04/27 18:45:37 by alida-si ### ########.fr #
# #
# **************************************************************************** #
NAME = pipex
LIBFT_DIR = ./libft
LIBFT = ./libft/libft.a
SRC_DIR = ./src
OBJ_DIR = ./obj
SRC_FILES = pipex.c \
utils.c \
free.c \
main.c
SRC = $(addprefix $(SRC_DIR)/, $(SRC_FILES))
OBJ = $(SRC:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
CC = gcc
CCFLAGS = -Wall -Wextra -Werror
LIBFLAGS = -L./libft -lft
RM = rm -f
RM_DIR = rm -rf
all: $(NAME)
$(NAME): $(LIBFT) $(OBJ)
$(CC) $(CCFLAGS) -g -o $(NAME) $(OBJ) $(LIBFLAGS)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
mkdir -p $(OBJ_DIR)
$(CC) $(CCFLAGS) -c $< -o $@
$(LIBFT):
make -C ./libft
clean:
make clean -C $(LIBFT_DIR)
$(RM_DIR) $(OBJ_DIR)
fclean: clean
make fclean -C $(LIBFT_DIR)
$(RM) $(NAME)
re: fclean all