-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
64 lines (49 loc) · 1.79 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ssottori <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/02/05 19:29:37 by ssottori #+# #+# #
# Updated: 2024/03/25 18:58:07 by ssottori ### ########.fr #
# #
# **************************************************************************** #
MAKEFLAGS += --silent
RED=\033[1;31m
GREEN=\033[1;32m
NC=\033[0m
CCFLAGS = cc -Wall -Wextra -Werror -ggdb3
RM = rm -rf
NAME = pipex
SRC_DIR = src
OBJ_DIR = obj
LIBFT_D = libft
INC = inc
SRCS = pipex.c \
utils.c \
OBJS = $(SRCS:.c=.o)
LIBFT = $(LIBFT_D)/libft.a
LIBS = -L$(LIBFT_D) -lft
HEADERS = -I$(INC) -I$(LIBFT_D)/inc
all: $(LIBFT) $(NAME)
$(LIBFT):
$(MAKE) -C $(LIBFT_D)
$(NAME): $(OBJS)
$(CCFLAGS) $(OBJS) $(HEADERS) $(LIBS) -o $(NAME)
@echo "[$(GREEN)PIPEX$(NC)] - $<"
# $(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(INC_DIR)/push_swap.h
%.o: %.c
@mkdir -p $(OBJ_DIR)
echo "[$(GREEN)PIPEX$(NC)] - $<"
$(CCFLAGS) $(HEADERS) -c $< -o $@
clean:
@echo "[$(RED)PIPEX$(NC)] Cleaning object files..."
$(MAKE) -C $(LIBFT_D) clean
@$(RM) $(OBJS) $(OBJ_DIR)
fclean: clean
@echo "[$(RED)PIPEX$(NC)] Cleaning executable file..."
$(MAKE) -C $(LIBFT_D) fclean
@$(RM) $(NAME)
re: fclean all
.PHONY: all clean fclean re