-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (29 loc) · 799 Bytes
/
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
NAME=fractol
SRCS=fractol.c \
renderer.c \
fractal_iterator.c \
render_hooks.c \
OBJS=$(SRCS:.c=.o)
LIBS_DIR=libs
OBJS_DIR=build
SRCS_DIR=srcs
OBJS_PATH=$(addprefix $(OBJS_DIR)/, $(OBJS))
SRCS_PATH=$(addprefix $(SRCS_DIR)/, $(SRCS))
INCLUDES=includes
FLAGS= -Wall -Werror -Wextra
all: $(NAME)
$(NAME): $(OBJS_PATH) $(INCLUDES)/fractol.h
make -C $(LIBS_DIR)/centropy
gcc $(OBJS_PATH) $(LIBS_DIR)/centropy/centropy.a -lmlx -framework openGL -framework AppKit -o $(NAME)
$(OBJS_PATH): $(OBJS_DIR)/%.o : $(SRCS_DIR)/%.c | $(OBJS_DIR)
gcc $(FLAGS) -I$(INCLUDES) -c $< -o $@
$(OBJS_DIR):
mkdir $(OBJS_DIR)
clean:
make -C $(LIBS_DIR)/centropy clean
rm -rf $(OBJS_DIR)
fclean: clean
make -C $(LIBS_DIR)/centropy fclean
rm -rf $(NAME)
re: fclean all
make -C $(LIBS_DIR)/centropy re