-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (54 loc) · 2.1 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: npimenof <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/10/06 14:31:52 by npimenof #+# #+# #
# Updated: 2020/11/19 17:26:58 by npimenof ### ########.fr #
# #
# **************************************************************************** #
NAME = lem-in
FLAGS = -Wall -Werror -Wextra
SRC = src/main.c src/lem_in.c\
src/parser/parser.c src/parser/parser_helper.c\
src/lexer/lexer.c src/lexer/lexer_helper.c\
src/network_flow/edge.c src/network_flow/node.c\
src/network_flow/path.c\
src/network_flow/edmons_karp.c\
src/network_flow/queue.c\
src/output/cost.c src/output/output.c\
src/output/write.c
INCL = ./includes
LIBFT = ./libft
FT_HASH = ./ft_hash
FT_GRAPH = ./ft_graph
LIBFT_INCL = $(LIBFT)/includes
FT_HASH_INCL = $(FT_HASH)/includes
FT_GRAPH_INCL = $(FT_GRAPH)/includes
all: $(NAME)
$(NAME): $(SRC) $(INCL)/lem_in.h
@if git submodule status | egrep -q '^[-]' ; then \
echo "INFO: Initializing git submodules"; \
git submodule update --init; \
fi
make -C $(LIBFT)
make -C $(FT_HASH)
make -C $(FT_GRAPH)
gcc -g $(FLAGS) -o $(NAME) $(SRC) -I$(INCL) \
-L$(LIBFT) -lft -I$(LIBFT_INCL) \
-L$(FT_HASH) -lhashft -I$(FT_HASH_INCL) \
-L$(FT_GRAPH) -lgraph -I$(FT_GRAPH_INCL) \
clean:
make clean -C $(LIBFT)
make clean -C $(FT_HASH)
make clean -C $(FT_GRAPH)
fclean: clean
rm -f $(NAME)
make fclean -C $(LIBFT)
make fclean -C $(FT_HASH)
make fclean -C $(FT_GRAPH)
re: fclean all
test:
gcc main.c -L. -lgraph -I./includes -I./libft/includes -I./ft_hash/includes