-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
56 lines (45 loc) · 1.23 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
NAME = fdf
CC = gcc
CFLAGS = -Wall -Wextra -Werror -g
INCLUDES = -I./includes
MLX_INCLUDE =
MLX_DIR=./minilibx
MLX_FLAGS = -L$(MLX_DIR) -lmlx -framework OpenGl -framework AppKit
#source
SRCS_DIR = sources/
SRCS = main.c parse_file.c errors.c mlx_utils.c utils.c\
draw_segment.c draw.c colors.c map_tools.c palette.c\
hooks.c hooks_suite.c mouse_hooks.c\
SRCS_PREFIXED = $(addprefix $(SRCS_DIR), $(SRCS))
#objsm
OBJS = $(SRCS_PREFIXED:.c=.o)
all : $(NAME)
%.o: %.c ./includes/fdf.h ./includes/color.h
$(CC) $(CFLAGS) -I$(MLX_DIR) -c $< -o $@
$(NAME): $(OBJS)
@$(MAKE) re -C ./libft
@$(MAKE) -C $(MLX_DIR)
@echo "\033[0;32m libmlx.dylib builded \033[m"
@$(CC) $(CFLAGS) $(OBJS) -L./libft -lft -lm $(MLX_FLAGS) -o $(NAME)
@cp $(MLX_DIR)/libmlx.dylib libmlx.dylib
@echo "\033[0;32m libmlx.dylib copied \033[m"
@echo $(NAME) est construit
clean :
@$(MAKE) clean -C ./libft
@$(MAKE) clean -C $(MLX_DIR)
@rm -rf $(OBJS)
@echo cleaning
fclean : clean
@$(MAKE) fclean -C ./libft
@rm -rf $(NAME)
@rm -rf libmlx.dylib
@echo "full clean"
re : fclean all
bonus : re
map42:all
./fdf maps/42.map
map_simple:all
./fdf maps/42.map
help :
@echo "all $(NAME) clean fclean re \033[0;32m map42 map_simple help\033[m"
.PHONY : all clean fclean re help