-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (60 loc) · 2.21 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: aarribas <aarribas@student.42malaga.com +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/08/01 09:08:07 by aarribas #+# #+# #
# Updated: 2022/08/11 01:22:03 by aarribas ### ########.fr #
# #
# **************************************************************************** #
# //= Variables =//
NAME = so_long
NAME_B = so_long_bonus
CFLAGS = -Wall -Werror -Wextra
LIN_FL = -ldl -lglfw -pthread -lm
MAC_FL = -lglfw -L "/Users/aarribas/.brew/Cellar/glfw/3.3.8/lib"
LIBMLX = ./lib/MLX42
LIBFT = ./lib/libft
HEADERS = -I ./includes -I $(LIBMLX)/include -I $(LIBFT)
LIBS = $(LIBMLX)/libmlx42.a $(LIBFT)/libft.a
SRCS = $(shell find ./src -iname "*.c")
SRCS_B = $(shell find ./bonus -iname "*.c")
OBJS = ${SRCS:.c=.o}
OBJS_B = ${SRCS_B:.c=.o}
BOLD = \033[1m
BLACK = \033[30;1m
RED = \033[31;1m
GREEN = \033[32;1m
YELLOW = \033[33;1m
BLUE = \033[34;1m
MAGENTA = \033[35;1m
CYAN = \033[36;1m
WHITE = \033[37;1m
RESET = \033[0m
# //= Recipes =//
all: libft libmlx $(NAME)
libft:
@$(MAKE) -C $(LIBFT)
libmlx:
@$(MAKE) -C $(LIBMLX)
#%.o: %.c
# @$(CC) $(CFLAGS) -o $@ -c $< $(HEADERS) && printf "$(GREEN)$(BOLD)\rCompiling: $(notdir $<)\r\e[35C[OK]\n$(RESET)"
$(NAME): $(OBJS)
@$(CC) $(OBJS) $(LIBS) $(CFLAGS) $(LIN_FL) $(HEADERS) -o $(NAME)
clean:
@rm -f $(OBJS)
@rm -f $(OBJS_B)
@$(MAKE) -C $(LIBFT) clean
@$(MAKE) -C $(LIBMLX) clean
fclean: clean
@rm -f $(NAME)
@rm -f $(NAME_B)
@$(MAKE) -C $(LIBFT) fclean
@$(MAKE) -C $(LIBMLX) fclean
re: clean all
bonus: libft libmlx $(NAME_B)
$(NAME_B): $(OBJS_B)
@$(CC) $(OBJS_B) $(LIBS) $(CFLAGS) $(LIN_FL) $(HEADERS) -o $(NAME_B)
.PHONY: all, clean, fclean, re, libmlx, libft, bonus