-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (47 loc) · 2.24 KB
/
Copy pathMakefile
File metadata and controls
63 lines (47 loc) · 2.24 KB
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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: vvinogra <vvinogra@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2017/12/25 16:41:32 by vvinogra #+# #+# #
# Updated: 2018/03/20 20:34:50 by vvinogra ### ########.fr #
# #
# **************************************************************************** #
NAME = wolf3d
CC = gcc
SRC = main.c parsemap.c solution.c image.c hook.c move.c init.c \
tools.c music.c floor.c shot_gun.c
LIB_SRC = $(shell find libft | fgrep ".c")
OBJ = $(SRC:.c=.o)
INCLUDES = -I Frameworks/SDL2_mixer.framework/Versions/A/Headers \
-I Frameworks/SDL2.framework/Versions/A/Headers \
-F Frameworks/
FRAMEWORK = -framework SDL2_mixer \
-framework SDL2 \
-F Frameworks/ \
HEADER = libft/includes -I minilibx_macos
HEADER_RELATION = wolf.h libft/includes/libft.h
FLAGS = -Wall -Wextra -Werror
all: $(NAME)
$(NAME): $(LIB_SRC) $(OBJ)
@make -C minilibx_macos
@make -C libft
@$(CC) -o $(NAME) $(FRAMEWORK) -L minilibx_macos -lmlx -framework OpenGL -framework AppKit $(OBJ) -L libft -lft
@echo "Compilation finished: ./$(NAME) maps/map_example1.txt"
@install_name_tool -change @rpath/SDL2.framework/Versions/A/SDL2 Frameworks/SDL2.framework/Versions/A/SDL2 $(NAME)
@install_name_tool -change @rpath/SDL2_mixer.framework/Versions/A/SDL2_mixer Frameworks/SDL2_mixer.framework/Versions/A/SDL2_mixer $(NAME)
%.o: %.c $(HEADER_RELATION)
@$(CC) -c $(FLAGS) -o $@ $< -I $(HEADER) $(INCLUDES)
clean:
@rm -f $(OBJ)
@make clean -C libft
@echo "Object files deleted: $(NAME)"
fclean: clean
@rm -f $(NAME)
@rm -f libft/libft.a
@make clean -C minilibx_macos
@echo "Executable file deleted: libft/libft.a"
@echo "Executable file deleted: $(NAME)"
re: fclean all