-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
68 lines (52 loc) · 2.03 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: cphillip <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/06/25 09:12:39 by cphillip #+# #+# #
# Updated: 2021/01/04 14:54:53 by cphillip ### ########.fr #
# #
# **************************************************************************** #
NAME = lem-in
FLAGS = -Wall -Wextra -Werror
LIBFT = ./libft/
LINK_LIBFT = -L $(LIBFT) -lft -I$(LIBFT)/includes
FT_PRINTF = ./ft_printf/
LINK_FT_PRINTF = -L $(FT_PRINTF) -lft_printf -I$(FT_PRINTF)/includes
SRC = *.c
SRC_DIR = ./src/
DATA_DIR = $(SRC_DIR)data/
EK_DIR = $(SRC_DIR)edmonds_karp/
AM_DIR = $(SRC_DIR)ants_marching/
IO_DIR = $(SRC_DIR)io/
SRC_FILES = $(addprefix $(SRC_DIR), $(SRC))\
$(addprefix $(DATA_DIR), $(SRC))\
$(addprefix $(EK_DIR), $(SRC))\
$(addprefix $(AM_DIR), $(SRC))\
$(addprefix $(IO_DIR), $(SRC))\
OBJ_FILES = $(SRC:.c=.o)
INC = ./includes
all: $(NAME)
$(NAME): $(SRC_FILES) $(INC)/lem_in.h
@if git submodule status | egrep -q '^[-]' ; then \
echo "INFO: Initializing git submodules"; \
git submodule update --init --recursive; \
fi
@make -C $(LIBFT)
@make -C $(FT_PRINTF)
@echo "Compiling $(NAME)..."
@gcc $(FLAGS) -o $(NAME) $(SRC_FILES) -I$(INC) \
$(LINK_LIBFT) $(LINK_FT_PRINTF)
clean:
@rm -rf obj/
@rm -rf $(LIBFT)/obj
@rm -rf $(FT_PRINTF)/obj
@rm -rf $(FT_PRINTF)/libft/obj
fclean: clean
@rm -rf $(NAME)
@rm -rf $(LIBFT)/libft.a
@rm -rf $(FT_PRINTF)/libft_printf.a
re: fclean all
.PHONY: all clean fclean re