-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (41 loc) · 968 Bytes
/
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
NAME = lem-in
CC = gcc
FLAGS = -g -Wall -Wextra -Werror
SRC_DIR = src/
LIB_DIR = includes/libft/
SRC_FILES = main.c \
print_utils.c \
lem_in.c \
parsing_utils.c \
room.c \
edge.c \
anthill.c \
graph.c \
algo.c \
algo_utils.c \
queue.c \
ant.c \
bfs.c \
print.c \
garbage_collector.c
INC_FILES = $(shell find includes -regex ".\{1,200\}\.h" | xargs) \
$(shell find includes/libft -regex ".\{1,200\}\.h" | xargs)
SRC = $(addprefix $(SRC_DIR), $(SRC_FILES))
OBJ = $(addprefix $(SRC_DIR), $(SRC_FILES:.c=.o))
.PHONY: clean fclean re
all: $(NAME)
$(NAME): $(OBJ)
make -C includes/libft/
$(CC) $(FLAGS) -Lincludes/libft -lft -o $@ $^
make -C checker/
%.o: %.c $(INC_FILES)
$(CC) $(FLAGS) -I includes/libft -o $@ -c $<
clean:
make -C includes/libft clean
make -C checker/ clean
rm -f $(OBJ)
fclean: clean
make -C includes/libft fclean
make -C checker/ fclean
rm -f $(NAME)
re: fclean all