-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
74 lines (55 loc) · 2.05 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: galo <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/04/30 19:58:25 by galo #+# #+# #
# Updated: 2023/06/08 18:05:42 by gmacias- ### ########.fr #
# #
# **************************************************************************** #
NAME = so_long
HEADERS = sources/so_long.h \
./get_next_line/get_next_line.h \
mlx/mlx.h
INCLUDES = mlx/libmlx.a
SOURCES = ft_check_map.c \
ft_checker_posible.c \
ft_draw_map.c \
ft_finish.c \
ft_move_key.c \
ft_read_map.c \
ft_utils.c \
so_long.c \
get_next_line_utils.c \
get_next_line.c
DIR_OBJ = objects
OBJECTS = $(addprefix $(DIR_OBJ)/,$(SOURCES:%.c=%.o))
CC = gcc
CFLAGS = -Wall -Werror -Wextra -g
MLX_FLAGS = -g -Lmlx -lmlx -framework OpenGL -framework Appkit
vpath %.c sources get_next_line
all : make_lib make_dir $(NAME)
make_lib:
@make -C mlx
@echo "\n\n minilibx complete!\n\n"
make_dir:
@mkdir -p $(DIR_OBJ)
$(DIR_OBJ)/%.o: %.c $(HEADERS) | make_dir
@$(CC) $(CFLAGS) -c $< -o $@
$(NAME) : $(OBJECTS) $(HEADERS)
@echo "Compiling so long"
@$(CC) $(CFLAGS) $(MLX_FLAGS) $(OBJECTS) $(INCLUDES) -o $(NAME)
@echo "Done!"
clean :
@echo "Removing (so_long) objects..."
@make clean -C mlx
@rm -rf $(DIR_OBJ)
@echo "Done!"
fclean : clean
@echo "Removing execute (so_long)..."
@rm -rf $(NAME)
@echo "Done!"
re : fclean all
.PHONY : all clean fclean re make_dir make_lib