-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
82 lines (65 loc) · 2.31 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: yaskour <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/12/31 12:01:08 by yaskour #+# #+# #
# Updated: 2022/01/15 17:44:26 by yaskour ### ########.fr #
# #
# **************************************************************************** #
framework= -framework OpenGL -framework AppKit
NAME=fdf
cc = gcc
flags = -Wall -Wextra -Werror
SRCS = main_mandatory.c\
draw.c\
key.c\
read.c \
menu.c \
BONUS_SRCS = main_bonus.c\
key_bonus.c
OBJS =$(SRCS:.c=.o)
INCL= fdf.h
BONUS_OBJS =$(BONUS_SRCS:.c=.o)\
draw.o\
read.o\
menu.o\
GNL_SRC = get_next_line.c\
get_next_line_utils.c
GNL_OBJS =$(GNL_SRC:.c=.o)
GREY=$'\x1b[30m
GREEN=$'\x1b[32m
YELLOW=$'\x1b[33m
BLUE=$'\x1b[34m
PURPLE=$'\x1b[35m
CYAN=$'\x1b[36m
WHITE=$'\x1b[37m
all:utils $(NAME)
%.a:
@echo " $(CYAN)MAKE $(YELLOW)$@\n"
@make -C ./libft
@mv ./libft/libft.a .
gnl:$(GNL_OBJS)
utils:gnl libft.a
%.o: %.c $(INCL)
@$(cc) $(flags) $< -I $(INCL) -c
@echo " $(CYAN)COMPILING $(YELLOW) $^ $(CYAN) to $(YELLOW)$@\n"
$(NAME):$(OBJS) utils
@echo " \n$(BLUE)---------------------------------------------\n"
@echo " $(CYAN)LINKING$(YELLOW) $(OBJS) $(GNL_OBJS) libft.a $(CYAN) to $(YELLOW) $(NAME)\n"
@$(cc) $(flags) $(OBJS) $(GNL_OBJS) -lmlx $(framework) libft.a -o $(NAME)
bonus:$(BONUS_OBJS) utils
@echo " \n$(BLUE)---------------------------------------------\n"
@echo " $(GREEN)LINKING$(CYAN) $(BONUS_OBJS) $(GNL_OBJS) libft.a $(GREEN) to $(CYAN) $(NAME)\n"
@$(cc) $(flags) $(BONUS_OBJS) $(GNL_OBJS) -lmlx $(framework) libft.a -o $(NAME)
clean:
@rm -rf *.o
@rm -rf ./libft/*.o
@rm -rf ./get_next_line/*.o
fclean:clean
@rm -rf *.a
@rm -rf fdf
re:fclean all
.PHONY: all gnl utils bonus clean fclean re