-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
99 lines (80 loc) · 2.86 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
88
89
90
91
92
93
94
95
96
97
98
99
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: mhonchar <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/05/15 19:28:21 by mhonchar #+# #+# #
# Updated: 2019/06/27 20:08:29 by mhonchar ### ########.fr #
# #
# **************************************************************************** #
NAME = NeonBones
LIB_NAME = libft.a
SRC_DIR = src/
OBJ_DIR = obj/
INC_DIR = includes/
LIBFT_DIR = libft/
LIB = $(addprefix $(LIBFT_DIR), $(LIB_NAME)) \
-L./libsdl/lib -lSDL2 \
-L./libsdl_image/lib -lSDL2_image \
-L./libsdl_ttf/lib -lSDL2_ttf \
-L./libsdl_mixer/lib -lSDL2_mixer
SRC_FILES = main.c \
get_next_line.c \
map_reader.c \
map_utils.c \
start_init.c \
clean_handler.c \
event_handler.c \
render_handler.c \
update_handler.c \
move_n_rot.c \
rc_loop.c \
rc_calculation.c \
rc_floor_ceiling.c \
sdl_pixel_manipulation.c \
start_init_std.c \
texture_utils.c
HEADERS = $(INC_DIR)neon.h \
$(LIBFT_DIR)libft.h \
libsdl/include/SDL2/SDL.h \
libsdl_image/include/SDL2/SDL_image.h \
libsdl_ttf/include/SDL2/SDL_ttf.h \
libsdl_mixer/include/SDL2/SDL_mixer.h
SRC = $(addprefix $(SRC_DIR), $(SRC_FILES))
OBJ = $(addprefix $(OBJ_DIR), $(SRC_FILES:.c=.o))
CC = gcc -g
CFLAGS = -Wall -Werror -Wextra
INC = -I $(INC_DIR) \
-I $(LIBFT_DIR) \
-I libsdl/include/SDL2/ \
-I libsdl_image/include/SDL2/ \
-I libsdl_ttf/include/SDL2/ \
-I libsdl_mixer/include/SDL2/
C_RED = \033[31m
C_GREEN = \033[32m
C_MAGENTA = \033[35m
C_NONE = \033[0m
all: $(NAME)
$(NAME): $(HEADERS) $(OBJ_DIR) $(OBJ)
@make -C $(LIBFT_DIR)
@$(CC) $(CFLAGS) $(OBJ) $(LIB) -o $(NAME)
@printf "$(C_MAGENTA)NeonBones:$(C_NONE) %-25s$(C_GREEN)[done]$(C_NONE)\n" $@
$(OBJ_DIR):
@mkdir obj
@printf "$(C_MAGENTA)NeonBones:$(C_NONE) %-25s$(C_GREEN)[done]$(C_NONE)\n" $@
$(OBJ_DIR)%.o: $(SRC_DIR)%.c $(HEADERS)
@$(CC) $(CFLAGS) -c $(INC) $< -o $@
@printf "$(C_MAGENTA)NeonBones:$(C_NONE) %-25s$(C_GREEN)[done]$(C_NONE)\n" $@
clean:
@rm -rf $(OBJ_DIR)*
@make fclean -C $(LIBFT_DIR)
@printf "$(C_MAGENTA)NeonBones:$(C_NONE) %-25s$(C_RED)[done]$(C_NONE)\n" $@
fclean: clean
@rm -rf $(NAME)
@make fclean -C $(LIBFT_DIR)
@printf "$(C_MAGENTA)NeonBones:$(C_NONE) %-25s$(C_RED)[done]$(C_NONE)\n" $@
re: fclean all
norm:
@norminette $(SRC) $(HEADERS)