-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
77 lines (56 loc) · 2.37 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: vhazelnu <vhazelnu@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/05/16 11:34:51 by vhazelnu #+# #+# #
# Updated: 2019/11/13 14:20:13 by vhazelnu ### ########.fr #
# #
# **************************************************************************** #
LOG_NOCOLOR = \033[0m
LOG_GREEN = \033[32m
ARCHIVE = libftlemin.a
NAME = lem-in
LIB = libft/ft_printf
LIB_A = libft/libft.a $(LIB)/libftprintf.a
VISUAL = ./vizualizer
INCLUDES = -I ./ -I libft/ft_printf -I libft/
SOURCES = lem_in.c hash_func.c bfs.c bellman_ford.c run_ants.c unvisit_rooms.c delete_dup_rooms.c \
sort_paths.c create_new_arr_path.c create_paths.c create_dup_rooms.c push_ant.c print_path.c \
manage_directions.c change_link_room.c count_optimal_paths.c create_linkwith_list.c \
isint.c validation.c validate_rooms.c write_data_in_sroom.c validate_links.c validate_ants.c \
work_with_data.c validate_coords.c find_and_connect_rooms.c \
SRCDIR = src
OBJDIR = obj
SRC = $(addprefix $(SRCDIR)/, $(SOURCES))
OBJ = $(addprefix $(OBJDIR)/, $(SOURCES:.c=.o))
CCFL = -Wall -Wextra -Werror
.PHONY: all clean fclean re library viz obj_dir
all: obj_dir library $(ARCHIVE) $(NAME)
obj_dir:
@mkdir -p $(OBJDIR)
library:
@make -sC $(LIB)
$(OBJDIR)/%.o: $(SRCDIR)/%.c
@gcc $(CCFL) -o $@ -c $< $(INCLUDES)
$(ARCHIVE): $(OBJ)
@ar rc $(ARCHIVE) $(OBJ)
@ranlib $(ARCHIVE)
$(NAME): $(OBJ)
@gcc $(CCFL) -o $(NAME) $(ARCHIVE) $(LIB_A)
@echo "$(LOG_GREEN)Lem_in has compiled successfully!$(LOG_NOCOLOR)"
viz:
@make -sC $(VISUAL)
@echo "$(LOG_GREEN)Visual has compiled successfully!$(LOG_NOCOLOR)"
clean:
@make clean -sC $(LIB)
@make clean -sC $(VISUAL)
@/bin/rm -rf $(OBJDIR)
fclean: clean
@/bin/rm -f $(ARCHIVE)
@/bin/rm -f $(NAME)
@make fclean -sC $(LIB)
@make fclean -sC $(VISUAL)
re: fclean all