-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (46 loc) · 1.88 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: gkrusta <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/07/29 12:00:43 by gkrusta #+# #+# #
# Updated: 2023/08/26 17:47:37 by gkrusta ### ########.fr #
# #
# **************************************************************************** #
NAME = fractol
CC = gcc
FLAGS = -Wall -Wextra -Werror -g
LIBFT_PATH = libraries/libft/
LIBFT = $(LIBFT_PATH)/libft.a
HEADERS = -I ./inc -I ./libraries/MLX42/include/MLX42 -I ./libraries/libft
MLX42_PATH = libraries/MLX42/
MLX42 = $(MLX42_PATH)/libmlx42.a
SRCS = $(wildcard src/*.c)
OBJS = $(SRCS:.c=.o)
all: $(LIBFT) $(MLX42) $(NAME)
$(NAME): $(OBJS)
@ echo "\033[32mCompiling Fractol...\n"
@$(CC) $(FLAGS) $(OBJS) $(MLX42) $(LIBFT) -lglfw -L "/Users/$(USER)/.brew/opt/glfw/lib/" $(HEADERS) -o $@
@ echo "\n\t\t\033[32mCompiled!\n"
%.o: %.c
@$(CC) $(FLAGS) -c $< -o $@ $(HEADERS)
$(LIBFT):
@ make -C $(LIBFT_PATH)
@ echo "\n\t\t\033[32mCreated libft!\n"
$(MLX42):
@ make -C $(MLX42_PATH)
@ echo "\n\t\t\033[32mCreated Minilibx!\n"
RM = rm -f
clean:
@ $(RM) $(OBJS)
@ make -C $(LIBFT_PATH) clean
@ make -C $(MLX42_PATH) clean
@ echo "\n\t\t\033[32mEverything is clean!\n"
fclean: clean
@ $(RM) $(NAME)
@ make -C $(LIBFT_PATH) fclean
@ make -C $(MLX42_PATH) fclean
re: fclean all
.PHONY: all clean fclean re