-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (45 loc) · 2.21 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: hoomen <hoomen@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/06/29 12:38:38 by hoomen #+# #+# #
# Updated: 2022/07/06 21:11:19 by hoomen ### ########.fr #
# #
# **************************************************************************** #
VPATH = src bonus
INCFLAGS = -I libft -I ftprintf -I mlx -I include
CC = cc
FLAGS = -Wall -Werror -Wextra
NAME = fractol
BONUSNAME = fractol
HEADER = include/fractol.h include/fr_userinfo.h include/keys.h include/fractol_bonus.h
SRC = main.c parse.c parse_julia.c init.c fractals.c complex.c newtons_utils.c color.c hsv2rgb.c events.c view.c change_image.c print_info.c print_info2.c
BON = main_bonus.c parse.c parse_julia.c init.c fractals.c complex.c newtons_utils.c color.c hsv2rgb.c events.c view.c change_image.c print_info.c print_info2.c
LIBS = libft/libft.a ftprintf/libftprintf.a
OBJ = $(addprefix obj/,$(notdir $(SRC:.c=.o)))
BONOBJ = $(addprefix obj/,$(notdir $(BON:.c=.o)))
$(NAME) : $(OBJ) | $(LIBS)
$(CC) $(FLAGS) -o $@ $^ -Llibft -lft -Lftprintf -lftprintf -lm -Lmlx -lmlx -framework OpenGL -framework AppKit
obj/%.o : %.c $(LIBS) $(HEADER) | obj
$(CC) $(FLAGS) $(INCFLAGS) -c $< -o $@
obj :
mkdir obj
$(LIBS) :
-(cd libft && make)
-(cd ftprintf && make && make clean)
-(cd libft && make clean)
all : $(NAME)
bonus : $(BONOBJ) | $(LIBS)
$(CC) $(FLAGS) -o $(NAME) $^ -Llibft -lft -Lftprintf -lftprintf -lm -Lmlx -lmlx -framework OpenGL -framework AppKit
clean :
rm -rf obj
fclean : clean
rm -f $(NAME)
-(cd libft && make fclean)
-(cd ftprintf && make fclean)
re : clean all
libs : fclean all
.PHONY : all clean fclean re bonus