-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
99 lines (84 loc) · 2.81 KB
/
Makefile
File metadata and controls
99 lines (84 loc) · 2.81 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: rbeaufre <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/06/03 14:03:16 by rbeaufre #+# #+# #
# Updated: 2019/12/03 17:23:18 by rbeaufre ### ########.fr #
# #
# **************************************************************************** #
NAME = lem-in
MAKEFILE = Makefile
BIN_DIR = .
SRC_DIR = .
OBJ_DIR = obj
LIBFT_DIR = libft
LIBFT = $(LIBFT_DIR)/libft.a
SRC_RAW = get_next_line.c \
lem_in.c \
lem_in_2.c \
lem_in_3.c \
print_adjacent_list.c \
initialize_adjacent_list.c \
free_adjacent_list.c \
split_utils.c \
list_sort.c \
initialize_params.c \
free_params.c \
print_general_details.c \
fill_adjacent_list_2.c \
list_utils.c \
parse_fatal_errors_check.c \
check_start_connected_to_end_bfs.c \
check_start_connected_to_end_bfs_2.c \
check_start_connected_to_end_dfs.c \
hash_utils.c \
ft_lstnew_revisited.c \
list_utils_reset.c \
check_ants.c \
parser_check_modifier_rooms.c \
parser_check_comments_tunnels.c \
fill_adjacent_list_add_room.c \
fill_adjacent_list_add_tunnel.c \
fill_adjacent_list_handle_modifier.c \
map_output_utils.c \
print_ant_moves.c \
print_ant_moves_utils.c \
print_ant_moves_inits.c \
print_ant_moves_rounds.c \
algo.c \
bfs_gaspard.c \
ft_put_bibli.c \
ft_put_arcw.c \
free_bib.c \
free_str.c
SRC = $(addprefix $(SRC_DIR)/, $(SRC_RAW))
OBJ = $(addprefix $(OBJ_DIR)/, $(subst .c,.o,$(SRC_RAW)))
HEADERS = lem_in.h
CCC = gcc
CFLAGS = -g -Wall -Wextra -Werror -I$(LIBFT_DIR)
GREEN := "\033[0;32m"
CYAN := "\033[0;36m"
RESET :="\033[0m"
all:
@(cd $(LIBFT_DIR) && $(MAKE))
@mkdir -p $(OBJ_DIR)
@make $(BIN_DIR)/$(NAME)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(HEADERS) $(MAKEFILE)
@$(CCC) -c $< -o $@ $(CFLAGS)
$(BIN_DIR)/$(NAME): $(OBJ_DIR) $(OBJ) $(LIBFT)
@$(CCC) $(CFLAGS) $(OBJ) $(LIBFT) -o $(NAME)
@echo ${GREEN}"Compiled $(NAME) with success"${RESET}
clean:
@rm -f $(OBJ)
@rm -Rf $(OBJ_DIR)
@(cd $(LIBFT_DIR) && $(MAKE) $@)
@echo ${CYAN}"Cleaned $(NAME) objects with success"${RESET}
fclean: clean
@rm -f $(NAME)
@(cd $(LIBFT_DIR) && $(MAKE) $@)
@echo ${CYAN}"Removed $(BIN_DIR)/$(NAME) with success"${RESET}
re: fclean all
.PHONY: clean fclean