-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
85 lines (67 loc) · 1.73 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
##
## EPITECH PROJECT, 2023
## amazed
## File description:
## The main Makefile of our project
##
NAME = amazed
BUILDDIR = ./build
SRCDIR = ./src
SRCS += main.c
SRCS += amazed.c
SRCS += init_maze.c
SRCS += parse_file.c
SRCS += rooms.c
SRCS += doors.c
SRCS += path_finding.c
SRCS += robots.c
OBJS = $(addprefix $(BUILDDIR)/, $(notdir $(SRCS:.c=.o)))
CFLAGS = -Werror -Wextra -I./include/
DEBUGFLAGS = -g3
OPTIMIZEFLAGS = -O3
LDFLAGS = -L./lib/ -lmymemory -lmylist -lmy
all: create-build libs $(BUILDDIR) $(NAME)
@echo -e "\033[1;33m$(NAME) compiled.\033[0m"
libs:
@make --no-print-directory -C ./lib/my/
@make --no-print-directory -C ./lib/mylist/
@make --no-print-directory -C ./lib/mymemory/
@echo -e "\033[1;33mLibs made.\033[0m"
create-build:
@mkdir -p $(BUILDDIR)
$(BUILDDIR)/%.o: $(SRCDIR)/%.c
$(CC) $(CFLAGS) $(OPTIMIZEFLAGS) $(LDFLAGS) -c $< -o $@
debug: CFLAGS += $(DEBUGFLAGS)
debug: OPTIMIZEFLAGS =
debug: all
$(NAME): $(OBJS)
@$(CC) $(OBJS) $(CFLAGS) $(OPTIMIZEFLAGS) $(LDFLAGS) -o $(NAME)
@rm -rf ./lib/my/*.a
@rm -rf ./lib/mylist/*.a
@rm -rf ./lib/mymemory/*.a
clean:
@rm -rf $(BUILDDIR)
@echo -e "\033[1;31mAll .o deleted.\033[0m"
fclean: clean
@rm -rf ./lib/*.a
@rm -rf unit_tests*
@rm -rf tests/unit_tests*
@rm -rf vgcore*
@rm -rf *.log
@rm -rf $(NAME)
@echo -e "\033[1;31mProject cleaned.\033[0m"
re: fclean all
# Unit tests Makefile
unit_tests:
@make unit_tests --no-print-directory -C./tests/
tests_run:
@make tests_run --no-print-directory -C./tests/
@gcovr
# Documentation
doc: tests_run
@doxygen Doxyfile
@gcovr \
--branch --html-details docs/tests/test.html
@echo -e "\033[1;33mDocumentation generated.\033[0m"
@google-chrome docs/html/index.html
@google-chrome docs/tests/test.html