-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (60 loc) · 1.52 KB
/
Makefile
File metadata and controls
74 lines (60 loc) · 1.52 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
64
65
66
67
68
69
70
71
72
73
74
# change with $(GCC) or $(CLANG) depend system
CC = $(CLANG)
# change your includes
HEADER = includes/projet.h
# change binary name
NAME = Arkanoid
# add sources files
SRCS = src/main.c \
src/basic_functions.c \
src/init_start.c \
src/init_map.c \
src/fill_map.c \
src/get_level_file.c \
src/move.c \
src/basic_move.c \
src/do_dmg.c \
src/adv_move.c \
src/game.c \
src/run.c \
src/collide.c \
src/exit_free.c \
src/render/render_close.c \
src/render/render_draw.c \
src/render/render_draw_case.c \
src/render/render_draw_player.c \
src/render/render_init.c \
src/render/render_keyboard.c \
src/render/render_score.c
# Don'y modify following
GCC = gcc
CLANG = clang
CFLAGS = -Wall -Werror -Wextra -w -pedantic -o3
LIB_GLFW = glfw/src/libglfw3.a
LIB = libft/libft.a
OBJS = $(SRCS:.c=.o)
all: $(NAME)
$(LIB_GLFW):
@echo "\t\tGLFW install START"
@git submodule init && git submodule update && cd glfw && cmake . && make
@echo "\t\tGLFW install DONE"
$(LIB):
make -C libft
%.o: %.c $(HEADER)
@$(CC) $(CFLAGS) -I glfw/include/ -I libft/includes -I includes/ -c $< -o $@
$(NAME): $(LIB_GLFW) $(LIB) $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -o $(NAME) $(LIB_GLFW) $(LIB) \
-I glfw/include/ -I libft/ -I includes/ \
-L glfw/src/ -lglfw3 \
-framework Cocoa -framework OpenGL \
-framework IOKit -framework GLUT -framework CoreVideo
clean:
make clean -C libft
rm -rf $(OBJS)
fclean: clean
make fclean -C libft
rm -rf $(NAME)
gclean:
git submodule deinit -f glfw
re: fclean all
.PHONY: all clean fclean re