-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·98 lines (78 loc) · 2.34 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: fsidler <fsidler@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/05/30 19:54:25 by fsidler #+# #+# #
# Updated: 2018/12/03 19:24:43 by fsidler ### ########.fr #
# #
# **************************************************************************** #
CC = clang
NAME = scop
CFLAGS = -Wall -Wextra -Werror -g
SDLFLAGS = $(shell sdl2-config --libs --cflags)
DIR_LIBFT = libs/libft
DIR_LIBMATH = libs/libmath
DIR_SRCS = sources
DIR_OBJS = tmp
HEADERS = includes
SRCS = setup.c \
init.c \
shader.c \
tga_loader.c \
textures.c \
parser.c \
parser_utils.c \
mtl_parse.c \
attrib_parse.c \
obj_parse.c \
obj_get.c \
node_create.c \
node_add.c \
node_clean.c \
buffers_bind.c \
uniforms_get.c \
uniforms_set.c \
selection.c \
selection_set.c \
handles_manip.c \
handles_inter.c \
inter1.c \
inter2.c \
events_handle.c \
update.c \
draw.c \
handles_draw.c \
cleanup.c \
main.c \
OBJS = $(addprefix $(DIR_OBJS)/, $(SRCS:.c=.o))
all: tmp $(NAME)
$(NAME): $(OBJS)
@make -C $(DIR_LIBFT)
@make -C $(DIR_LIBMATH)
$(CC) $(CFLAGS) -L $(DIR_LIBFT) -lft -L $(DIR_LIBMATH) -lmath -o $@ $^ $(SDLFLAGS) -framework OpenGL
tmp:
@mkdir -p tmp
$(DIR_OBJS)/%.o: $(DIR_SRCS)/%.c $(HEADERS)/$(NAME).h
$(CC) $(CFLAGS) -I $(HEADERS) -I/Users/fsidler/.brew/include/ -D_THREAD_SAFE -c $< -o $@
norme:
@make norme -C $(DIR_LIBFT)
@echo
@make norme -C $(DIR_LIBMATH)
@echo
@norminette ./$(HEADERS)
@echo
@norminette ./$(DIR_SRCS)
clean:
@rm -f $(OBJ)
@make clean -C $(DIR_LIBFT)
@make clean -C $(DIR_LIBMATH)
@rm -rf $(DIR_OBJS)
fclean: clean
@rm -f $(NAME)
@make fclean -C $(DIR_LIBFT)
@make fclean -C $(DIR_LIBMATH)
re: fclean all
.PHONY: all, tmp, norme, clean, fclean, re