-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·59 lines (41 loc) · 1.12 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
NAME = lem-in
CC = gcc
FLAGS = -Wall -Wextra -Werror
MKDIR_P = mkdir -p
DIR_S = sources
DIR_O = obj
SOURCES = main.c free.c data.c input.c utils.c algo_utils.c dinics_algo.c \
get_paths.c input_utils.c buckets.c move_ants.c path_funcs.c \
antprint.c print_funcs.c brute.c brute_combis.c brute_utils.c \
data_utils.c
LIBFT = libft/libft.a
INC = includes/
OBJ = $(addprefix $(DIR_O)/,$(SOURCES:.c=.o))
PROGRESS_CHAR = "\e[92m█\e[0m"
all: dirs $(NAME)
$(NAME): $(OBJ)
@echo "\nCompiling library..."
@cd libft && make
@echo "Creating executable..."
@$(CC) -o $(NAME) $(FLAGS) $(OBJ) $(LIBFT)
@echo "\e[1m$(NAME) created!\e[0m"
dirs:
@echo "Creating object dir..."
@${MKDIR_P} ${DIR_O}
$(DIR_O)/%.o: $(DIR_S)/%.c
@$(CC) $(FLAGS) -I $(INC) -o $@ -c $<
@echo $(PROGRESS_CHAR)"\c"
clean:
@echo "Removing libft objects..."
@cd libft && make clean
@echo "Removing project objects..."
@rm -f $(OBJ)
@echo "Removing object directory..."
@rm -rf $(DIR_O)
fclean: clean
@echo "Removing libft.a..."
@cd libft && make fclean
@echo "Removing executable..."
@rm -f $(NAME)
re: fclean all
.PHONY: all clean fclean re dirs