-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
56 lines (42 loc) · 1.76 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: tglandai <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2016/11/04 12:18:57 by tglandai #+# #+# #
# Updated: 2018/10/11 13:12:56 by tglandai ### ########.fr #
# #
# **************************************************************************** #
NAME = fractol
SRC_PATH = srcs
SRC_NAME = main.c hook.c mandelbrot.c julia.c tools.c burningship.c
OBJ_PATH = objs
OBJ_NAME = $(SRC_NAME:.c=.o)
CC = clang
CFLAGS = -Wall -Werror -Wextra
CPPFLAGS = -I includes -I libft/includes
LDFLAGS = -L libft
LDLIBS = -O2 -lft -lm -lmlx -framework OpenGL -framework AppKit
SRC = $(addprefix $(SRC_PATH)/,$(SRC_NAME))
OBJ = $(addprefix $(OBJ_PATH)/,$(OBJ_NAME))
all: $(NAME)
$(NAME): $(OBJ)
@make -C libft
@$(CC) $(LDFLAGS) $(LDLIBS) $^ -o $@
@echo "Compilation of Fractol: \033[1;32mOK\033[m"
$(OBJ_PATH)/%.o: $(SRC_PATH)/%.c
@mkdir $(OBJ_PATH) 2> /dev/null || true
@$(CC) $(CFLAGS) -c $< $(CPPFLAGS) -o $@
clean:
@make -C libft clean
@rm -f $(OBJ)
@rmdir $(OBJ_PATH) 2> /dev/null || true
@echo "Fractol: Removing Objs"
fclean: clean
@make -C libft fclean
@rm -f $(NAME)
@echo "Fractol : Removing Fractol"
re: fclean all
.PHONY: all clean fclean re