-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (45 loc) · 1.98 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: kjimenez <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/09/29 11:53:31 by kjimenez #+# #+# #
# Updated: 2023/06/27 18:47:47 by kjimenez ### ########.fr #
# #
# **************************************************************************** #
DIR_BIN := bin
DIR_OBJ := build
NAME := $(DIR_BIN)/fract_ol
SRC := fract_ol.c colors.c graphics.c fractals.c controls.c controls_keyboard.c \
controls_mouse.c controls_julia.c fractals_mandelbrot.c \
fractals_julia.c fractals_tricorn.c \
fractals_burningship.c
OBJ := $(addprefix $(DIR_OBJ)/,$(SRC:c=o))
LIBS_PATH := libs
MLX_PATH := $(LIBS_PATH)/mlx_linux
LIBFT_PATH := $(LIBS_PATH)/libft
CC := clang
CFLAGS := -Wall -Wextra -Werror -I$(LIBFT_PATH)/include -I$(MLX_PATH) -Iinclude -Ofast
LDFLAGS := -L$(LIBFT_PATH)/bin -lft_stdio -lft_string -L$(MLX_PATH) -lmlx_Linux -lXext -lX11 -lm -lz
GIT := git
MKDIR := mkdir -p
INIT_SUB := $(shell $(GIT) submodule init)
UPDATE_SUB := $(shell $(GIT) submodule update)
BUILD_MLX := $(shell $(MAKE) -C $(MLX_PATH))
BUILD_LIBFT := $(shell $(MAKE) -C $(LIBFT_PATH))
all: $(NAME)
fractol: $(NAME)
$(NAME): $(OBJ)
$(CC) $(OBJ) $(LDFLAGS) -o $(NAME)
$(DIR_OBJ)/%.o: %.c
@$(MKDIR) $(@D)
$(CC) $(CFLAGS) -c $< -o $@
clean:
$(RM) $(OBJ)
fclean: clean
$(RM) $(NAME)
re: fclean $(NAME)
.PHONY: all fractol clean fclean re
vpath %.c src:src/controls:src/fractals