This repository has been archived by the owner on Aug 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (46 loc) · 1.93 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: omiroshn <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/06/29 18:35:04 by omiroshn #+# #+# #
# Updated: 2018/06/29 18:35:06 by omiroshn ### ########.fr #
# #
# **************************************************************************** #
NAME = lem-in
CC = clang
FILES = main read_ants read_rooms adjacent_matrix read_links find_shortest_path \
print_pathes
LIBFT_DIR = libft/
SRC = $(addprefix src/, $(addsuffix .c, $(FILES)))
OBJ = $(addprefix obj/, $(addsuffix .o, $(FILES)))
OBJ_LIST = $(addsuffix .o, $(FILES))
FLAGS = -Wall -Wextra -Werror -O3
HEADERS = -I./includes -I./libft/includes -I./libft/ft_printf/includes
HEADER = ./includes/lemin.h ./includes/colored_str.h
EOC=\033[0m
BLUE=\033[1;34m
YELLOW=\033[1;33m
LGREEN=\033[1;32m
GREEN=\033[32m
RED=\033[31m
LRED=\033[91m
BRED=\033[1;31m
all: $(NAME)
$(NAME): $(LIBFT_DIR)libft.a $(OBJ) $(HEADER)
@$(CC) -o $(NAME) $(FLAGS) $(OBJ) $(LIBFT_DIR)libft.a
@printf " $(RED)>$(EOC) $(GREEN)$(NAME) is ready.$(EOC)\n"
$(LIBFT_DIR)libft.a:
@make --no-print-directory -j3 -C $(LIBFT_DIR)
$(OBJ): obj/%.o: src/%.c $(HEADER)
@$(CC) -o $@ $(FLAGS) $(HEADERS) -c $<
@printf "$(RED).$(EOC)"
clean:
@rm -f $(OBJ)
@make --no-print-directory -j3 -C $(LIBFT_DIR) clean
fclean: clean
@rm -f $(NAME)
@make --no-print-directory -j3 -C $(LIBFT_DIR) fclean
re: fclean all