-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
87 lines (67 loc) · 2.17 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
79
80
81
82
83
84
85
86
87
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: tblaase <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/10/06 10:57:58 by tblaase #+# #+# #
# Updated: 2022/02/08 17:34:11 by tblaase ### ########.fr #
# #
# **************************************************************************** #
NAME = so_long
CC = gcc
CFLAGS = -Wall -Wextra -Werror -g
MLX_PATH = mlx/
MLX_LIB = $(MLX_PATH)libmlx.a
MLX_FLAGS = -Lmlx -lmlx -framework OpenGL -framework AppKit
LIBFT_PATH = libft/
LIBFT_LIB = $(LIBFT_PATH)libft.a
Y = "\033[33m"
R = "\033[31m"
G = "\033[32m"
B = "\033[34m"
X = "\033[0m"
UP = "\033[A"
CUT = "\033[K"
CFILES = \
init.c\
key_hook.c\
map.c\
move.c\
parse_input.c\
put_imgs.c\
so_long.c\
win.c\
OBJECTS = $(CFILES:.c=.o)
all: subsystems $(NAME)
%.o : %.c
@echo $(Y)Compiling [$<]...$(X)
@$(CC) $(CFLAGS) -Imlx -c -o $@ $<
@printf $(UP)$(CUT)
subsystems:
@echo $(B)
make -C $(MLX_PATH) all
@echo $(B)
make -C $(LIBFT_PATH) all
$(NAME): $(OBJECTS)
@echo $(Y)Compiling [$(CFILES)]...$(X)
@echo $(G)Finished [$(CFILES)]$(X)
@echo
@echo $(Y)Compiling [$(NAME)]...$(X)
@$(CC) $(CFLAGS) $(MLX_FLAGS) $(OBJECTS) $(MLX_LIB) $(LIBFT_LIB) -o $(NAME)
@echo $(G)Finished [$(NAME)]$(X)
clean:
@make -C $(MLX_PATH) clean
@make -C $(LIBFT_PATH) clean
@rm -f $(OBJECTS)
@echo $(R)Removed [$(OBJECTS)]$(X)
fclean: clean
@make -C $(MLX_PATH) fclean
@make -C $(LIBFT_PATH) fclean
@rm -f $(NAME)
@echo $(R)Removed [$(NAME)]$(X)
re: fclean all
norm:
norminette libft init.c key_hook.c map.c move.c parse_input.c put_imgs.c so_long.c so_long.h win.c
.PHONY: all clean fclean re norm