-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (44 loc) · 1.81 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: rtavabil <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/01/11 16:39:33 by rtavabil #+# #+# #
# Updated: 2024/01/26 13:14:12 by rtavabil ### ########.fr #
# #
# **************************************************************************** #
NAME := fractol
SRC := main.c strings.c init.c error.c render.c \
complex_math.c ft_atold.c burning_ship.c \
map.c julia.c init_julia.c init_ship.c \
handle_close_x.c
OBJ := $(SRC:.c=.o)
CC = gcc
CFLAGS = -Wall -Wextra -Werror
MLX_PATH = minilibx-linux/
MLX_NAME = libmlx.a
MLX = $(MLX_PATH)$(MLX_NAME)
INC = -I ./minilibx-linux/
OBJ_PATH = obj/
OBJ = $(SRC:.c=.o)
OBJS = $(addprefix $(OBJ_PATH), $(OBJ))
all: $(MLX) $(NAME)
$(OBJ_PATH)%.o: $(SRC_PATH)%.c
@$(CC) $(CFLAGS) -c $< -o $@ $(INC) -g
$(OBJS): $(OBJ_PATH)
$(OBJ_PATH):
@mkdir $(OBJ_PATH)
$(MLX):
@make -sC $(MLX_PATH)
$(NAME): $(OBJS)
@$(CC) $(CFLAGS) -o $(NAME) $(OBJS) $(MLX) $(INC) -lXext -lX11 -lm
clean:
@rm -rf $(OBJ_PATH)
@make clean -C $(MLX_PATH)
fclean: clean
@rm -f $(NAME)
re: fclean all
.PHONY: all re clean fclean
#main.c strings.c init.c error.c render.c complex_math.c ft_atold.c burning_ship.c map.c julia.c init_julia.c init_ship.c handle_close_x.c