This repository has been archived by the owner on Mar 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
94 lines (67 loc) · 2.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
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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: cfatrane <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2016/11/29 16:05:24 by cfatrane #+# #+# #
#* Updated: 2017/02/09 18:06:38 by cfatrane ### ########.fr *#
# #
# **************************************************************************** #
# Binary
NAME = fdf
# Path
SRC_PATH = ./srcs/
OBJ_PATH = ./objs/
CPPFLAGS = -I./includes/
# Name
SRC_NAME = main.c \
ft_check.c \
ft_fdf.c \
ft_create_map.c \
ft_mlx.c \
ft_init.c \
ft_bresenham.c \
ft_pixel_put.c \
ft_draw.c \
ft_point.c \
ft_hook.c \
ft_key_hook_move.c \
ft_key_hook_color.c \
OBJ_NAME = $(SRC_NAME:.c=.o)
# Files
SRC = $(addprefix $(SRC_PATH)/,$(SRC_NAME))
OBJ = $(addprefix $(OBJ_PATH), $(OBJ_NAME))
# Flags
LDFLAGS = -L./libft/
LFT = -lft
CC = gcc $(CFLAGS)
CFLAGS = -Wall -Wextra -Werror
MLX = -lmlx -framework OpenGL -framework AppKit
# Rules
all: $(NAME)
$(NAME): $(OBJ)
@make -C./libft/
@echo "\033[34mCreation of $(NAME) ...\033[0m"
@$(CC) $(LDFLAGS) $(LFT) $(OBJ) -o $@ $(MLX)
@echo "\033[32m$(NAME) created\n\033[0m"
$(OBJ_PATH)%.o: $(SRC_PATH)%.c
@mkdir $(OBJ_PATH) 2> /dev/null || true
@$(CC) $(CPPFLAGS) -o $@ -c $<
clean:
@make clean -C ./libft/
@echo "\033[33mRemoval of .o files of $(NAME) ...\033[0m"
@rm -f $(OBJ)
@rmdir $(OBJ_PATH) 2> /dev/null || true
@echo "\033[31mFiles .o deleted\n\033[0m"
fclean: clean
@make fclean -C ./libft/
@echo "\033[33mRemoval of $(NAME)...\033[0m"
@rm -f $(NAME)
@echo "\033[31mBinary $(NAME) deleted\n\033[0m"
re: fclean all
norme:
norminette $(SRC)
norminette $(INC_PATH)*.h
.PHONY: all, clean, fclean, re