-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (41 loc) · 1.69 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: laranda <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/04/11 16:48:09 by laranda #+# #+# #
# Updated: 2019/04/11 17:13:49 by laranda ### ########.fr #
# #
# **************************************************************************** #
NAME = ft_parse_options.a
SRC = ft_parse_options.c
OBJ_DIR = obj
OBJ := $(SRC:.c=.o)
OBJ := $(addprefix $(OBJ_DIR)/, $(OBJ))
FLAGS = -Wall -Werror -Wextra
OK_COLOR = \033[1;32m
ERROR_COLOR = \033[1;31m
TEXT_COLOR = \033[0;33m
NO_COLOR = \033[m
.PHONY: all clean fclean re
all: $(NAME)
$(NAME): $(OBJ)
@ar rc $(NAME) $(OBJ)
@ranlib $(NAME)
@echo "$(OK_COLOR)[ FT_PARSE_OPTIONS COMPILED ]$(NO_COLOR)"
$(OBJ_DIR):
@-mkdir -p $(OBJ_DIR)
$(OBJ): ft_parse_options.h | $(OBJ_DIR)
$(OBJ): $(OBJ_DIR)/%.o : %.c
@echo "$(TEXT_COLOR)[Compiling $@]$(NO_COLOR) . . . \c"
@gcc -c -Iincludes $(FLAGS) $< -o $@
@echo "$(OK_COLOR)[ OK ]$(NO_COLOR)"
clean:
@-rm -Rf $(OBJ_DIR)
@echo "$(ERROR_COLOR)[ Removed OBJ folder ]$(NO_COLOR)"
fclean: clean
@-rm -f $(NAME)
@echo "$(ERROR_COLOR)[ Removed the LIBRARY ]$(NO_COLOR)"
re: fclean all