-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
83 lines (67 loc) · 2.26 KB
/
Makefile
File metadata and controls
83 lines (67 loc) · 2.26 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
75
76
77
78
79
80
81
82
83
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: dderevyn <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/01/21 20:30:28 by dderevyn #+# #+# #
# Updated: 2019/02/05 12:46:58 by dderevyn ### ########.fr #
# #
# **************************************************************************** #
NAME = fdf
OBJS_DIR = .$(patsubst %.a,%,$(NAME))_objects
CC = clang
CFLAGS = -Wall -Wextra -Werror
CLIBS = -lmlx -framework OpenGL -framework AppKit
RM = /bin/rm -rf
CP = cp -rf
LIBFT_PATH = libft/
LIBFT = libft.a
FDF_PATH = ffdf/
FDF_INCS = fdf.h\
fdf_typedefs.h
FDF_SRCS = fdf.c\
fdf_parse.c\
fdf_projections.c\
fdf_draw.c\
fdf_interact.c\
fdf_interface.c\
fdf_gradient.c\
fdf_help_menu.c\
fdf_mouse_control.c\
fdf_key_control.c\
fdf_inits.c\
fdf_complete_map.c
FDF_OBJS = $(FDF_SRCS:%.c=$(FDF_OBJS_DIR)/%.o)
FDF_OBJS_DIR = $(OBJS_DIR)
all: libft $(NAME)
$(NAME): $(FDF_OBJS)
@$(CC) $(CFLAGS) $^ $(CLIBS) -L $(LIBFT_PATH) -l$(patsubst %.a,%,$(LIBFT:lib%=%)) -o $(NAME)
$(FDF_OBJS_DIR)/%.o: $(FDF_PATH)%.c
@mkdir -p $(FDF_OBJS_DIR)
@$(CC) $(CFLAGS) -c $< $(addprefix -I.,$(addprefix $(FDF_PATH),$(FDF_INCS))) -o $@
libft:
@cd libft && make $(LIBFT)
clean:
@cd libft && make clean
@$(RM) $(OBJS_DIR)
fclean: clean
@cd libft && make fclean
@$(RM) $(NAME)
re: fclean all
norm:
@cd libft && make norm
@norminette $(addprefix $(FDF_PATH),$(FDF_SRCS)) \
$(addprefix $(FDF_PATH),$(FDF_INCS))
run:
@./fdf maps/42.fdf
test: rmt
@mkdir -p test
@$(CP) $(LIBFT_PATH) test/$(LIBFT_PATH)
@$(CP) $(FDF_PATH) test/$(FDF_PATH)
@$(CP) author test/author
@$(CP) Makefile test/Makefile
rmt:
@$(RM) test
.PHONY: all clean fclean re norm libft run test rmt