-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
87 lines (68 loc) · 2.08 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
NAME = so_long.out
SRC = $(MAIN_SRC) $(SRC_ERR) $(SRC_GNL) $(SRC_MAP) $(SRC_GAME)
MAIN_SRC = main.c errors.c
LIBFT_A = libft.a
LIBF_DIR = libft/
LIBFT = $(addprefix $(LIBF_DIR), $(LIBFT_A))
GNL = get_next_line.c get_next_line_utils.c
SRC_GNL = $(addprefix gnl/, $(GNL))
MAP = map_reader.c map_checker.c map_checker_utils.c \
tilemap_generator.c enemy_generator.c
SRC_MAP = $(addprefix map/, $(MAP))
GAME = game_init.c open_images.c open_wall_images.c open_panel.c \
input.c player_movement.c player_end.c update.c enemy_behaviour.c follower_behaviour.c \
render.c draw_wall.c \
reset.c end_program.c
SRC_GAME = $(addprefix game/, $(GAME))
OBJ = *.o
FLAGS = -Wall -Wextra -Werror
INCLUDE = -lmlx -framework OpenGL -framework AppKit
NONE='\033[0m'
GREEN='\033[32m'
YELLOW='\033[33m'
GRAY='\033[2;37m'
CURSIVE='\033[3m'
all: $(NAME)
$(NAME): $(OBJ)
@echo $(CURSIVE)$(GRAY) " - Making libft..." $(NONE)
@make -C $(LIBF_DIR)
@echo $(CURSIVE)$(GRAY) " - Compiling $(NAME)..." $(NONE)
@gcc $(FLAGS) $(OBJ) $(LIBFT) $(INCLUDE) -o $(NAME)
@echo $(GREEN)"- Compiled -"$(NONE)
$(OBJ): $(SRC)
@echo $(CURSIVE)$(GRAY) " - Making object files..." $(NONE)
@gcc $(FALGS) -c $(SRC)
exe: re
@make -C ./ clean
@echo $(YELLOW)" - Executing $(NAME)... \n"$(NONE)
@./$(NAME) $(m)
@echo $(YELLOW)"\n - Done -"$(NONE)
play: all
@echo $(YELLOW)" - Playing all maps... \n"$(NONE)
@make -C ./ clean
@./$(NAME) map_files/map_0.ber
@./$(NAME) map_files/map_1.ber
@./$(NAME) map_files/map_2.ber
@./$(NAME) map_files/map_3.ber
@./$(NAME) map_files/map_4.ber
@./$(NAME) map_files/map_5.ber
@./$(NAME) map_files/map_6.ber
@./$(NAME) map_files/long.ber
@./$(NAME) map_files/sergio.ber
norm:
@echo $(GRAY) ""
@norminette $(SRC) *.h */*.h
@echo $(NONE) ""
libftnorm:
@echo $(GRAY) ""
@make -C $(LIBF_DIR) norm
@echo $(NONE) ""
clean:
@echo $(CURSIVE)$(GRAY) " - Removing object files..." $(NONE)
@rm -rf $(OBJ)
@make -C $(LIBF_DIR) clean
fclean: clean
@echo $(CURSIVE)$(GRAY) " - Removing $(NAME)..." $(NONE)
@rm -rf $(NAME)
@make -C $(LIBF_DIR) fclean
re: fclean all