-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (38 loc) · 1.18 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
NAME = fdf
SOURCES = ./sources/main.c ./sources/read_input.c ./sources/initialize.c \
./sources/helpers.c ./sources/draw.c ./sources/color.c ./sources/rotate.c\
./sources/projections.c ./sources/mouse_hooks.c ./sources/key_hooks.c \
./sources/legend.c
OBJECTS = $(subst .c,.o,$(SOURCES))
LIBFT = libft/libft.a
HEADERS = includes
FLAGS = -Wall -Wextra -Werror
LINKS = -L /usr/local/lib -lmlx -I /usr/local/X11/include \
-L /usr/X11/lib -lX11 -lXext -framework OpenGL -framework Appkit
GREEN = \033[1;32m
RED = \033[1;31m
WHT = \033[1;37m
EOC = \033[1;0m
all: $(NAME)
%.o:%.c
@gcc $(FLAGS) -I $(HEADERS) -o $@ -c $<
$(LIBFT):
@echo "$(WHT)Compiling libft...$(EOC)"
@make -C libft
@echo "$(GREEN)Libft done.$(EOC)"
$(NAME): $(OBJECTS) $(LIBFT)
@echo "$(WHT)Compiling FDF...$(EOC)"
@gcc -o $(NAME) $(LINKS) $(OBJECTS) $(LIBFT)
@echo "$(GREEN)Fdf build completed.$(EOC)"
clean:
@echo "$(WHT)Removing o-files...$(EOC)"
@/bin/rm -f $(OBJECTS)
@make -C libft clean
@echo "$(GREEN)Clean done.$(EOC)"
fclean: clean
@echo "$(WHT)Removing object- and binary -files...$(EOC)"
@/bin/rm -f $(NAME)
@make -C libft fclean
@echo "$(GREEN)Fclean done.$(EOC)"
re: fclean all
.PHONY: all clean fclean re