-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·76 lines (67 loc) · 2.76 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: rabougue <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2015/12/10 19:16:51 by rabougue #+# #+# #
# Updated: 2016/05/19 18:01:43 by rabougue ### ########.fr #
# #
# **************************************************************************** #
####################################_COLOR_#####################################
GREEN = \033[38;5;10m
GREY = \033[38;5;60m
END = \033[0m
##################################_COMPILATION_#################################
CC = clang
FLAG = -O3 -Wall -Wextra -Werror
LFT = ./libft/libft.a
LSDL = -L ./libsdl/ -lSDL2
INCLUDE = -I ./includes/wolf.h -I ./libft/includes/ -I ./includes/SDL2/
OBJS = ./main.o \
./window.o \
./init.o \
./wolf.o \
./color.o \
./keyboard.o \
./sound.o \
./map.o \
./weapon.o \
NAME = wolf3d
FRAMEWORK = -framework OpenGL
##################################_CHANGE_PATH_#################################
SDL2DYLIB = ./libsdl/libSDL2-2.0.0.dylib
SDL2_image = ./libsdl/SDL2_image
##################################_RELINK_MODIFY_.h#############################
RELINK_H = ./includes/wolf.h
VPATH = sources/
all: $(NAME)
$(NAME): $(OBJS)
@printf "$(GREY)Compiling libft.a ...$(GREY)"
@make -s -C ./libft/
@printf " [$(GREEN)Success$(GREY)]\n"
@printf "Compiling .o ..."
@printf " [$(GREEN)Success$(GREY)]\n"
@printf "Compiling wolf3d ..."
@$(CC) $(FLAG) $(LFT) $(LSDL) $(INCLUDE) $(OBJS) -o $(NAME) $(FRAMEWORK)\
$(SDL2_image)
@printf " [$(GREEN)Success$(GREY)]\n$(END)"
@install_name_tool -change /usr/local/lib/libSDL2-2.0.0.dylib $(SDL2DYLIB)\
$(NAME)
@install_name_tool -change \
@rpath/SDL2_image.framework/Versions/A/SDL2_image $(SDL2_image) $(NAME)
@install_name_tool -change lib/libsdl/libSDL2-2.0.0.dylib $(SDL2DYLIB)\
$(SDL2_image)
%.o : %.c ${RELINK_H}
@$(CC) -c $(FLAG) $< -o $@
clean:
@printf "$(GREY)deleting all .o ...$(END)"
@rm -f $(OBJS)
@printf " [$(GREEN)Success$(GREY)]\n$(END)"
fclean:
@printf "$(GREY)Deleting libft.a, all .o and Wolf3d ...$(END)"
@rm -f $(NAME) $(OBJS)
@make -s fclean -C ./libft/
@printf " $(GREY)[$(GREEN)Success$(GREY)]\n$(END)"
re: fclean all