-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (61 loc) · 1.81 KB
/
Makefile
File metadata and controls
74 lines (61 loc) · 1.81 KB
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
##
## EPITECH PROJECT, 2024
## MyPandoc
## File description:
## Makefile
##
## Config
NAME = mypandoc
BONUS_NAME = mypandoc_bonus
STACK_PATH = $(shell stack path --local-install-root)
STACK_BIN = $(STACK_PATH)/bin/${NAME}-exe
# Colors and formatting
GREEN = \033[1;32m
YELLOW = \033[1;33m
RED = \033[1;31m
BLUE = \033[1;36m
GOLD = \033[1;33m
MAGENTA = \033[1;35m
RESET = \033[0m
RUNNING = [$(YELLOW)~$(RESET)]
SUCCESS = [$(GREEN)✔$(RESET)]
FAILURE = [$(RED)✘$(RESET)]
SKIPPED = [$(MAGENTA)@$(RESET)]
## Rules
all:
@printf "$(RUNNING)$(BLUE) 🚧 Building mypandoc$(RESET)\r";
@stack build 2> /tmp/mypandocbuild.log \
&& printf \
"$(SUCCESS)$(GREEN) 🚀 Build successfully mypandoc$(RESET)\n" \
|| (printf "$(FAILURE)$(RED) 🚨 Build failed!\
$(RESET)\n" && cat /tmp/mypandocbuild.log && false);
@printf \
"$(RUNNING)$(BLUE) 📦 Moving built binary (${NAME})$(RESET) \r";
@cp $(STACK_BIN) $(NAME) && \
printf \
"$(SUCCESS)$(GREEN) 📦 Moved binary successfully$(RESET) \n" || \
printf \
"$(FAILURE)$(RED) 🚨 \Failed to move binary$(RESET) \n";
clean:
@stack clean
@printf "$(RUNNING)$(RED) 🗑️ Cleaning all stack files$(RESET)\n";
fclean: clean
@rm -fr $(NAME)
@printf "$(RUNNING)$(RED) 🗑️ Fcleaning mypandoc$(RESET)\n";
log:
@cat /tmp/mypandocbuild.log
tests_run:
@stack test --coverage
@printf "$(SUCCESS)$(GREEN) 🎉 Tests passed successfully$(RESET)\n";
@stack hpc report --all --destdir=test/coverage
@printf "$(RUNNING)$(BLUE) 📊 Generating coverage report$(RESET)\n";
re: fclean all
easteregg:
@make -C bonus
@cp bonus/$(BONUS_NAME) $(BONUS_NAME)
@printf "$(RUNNING)$(GOLD) 🐣 \
Easter egg: $(RESET)$(YELLOW)🐇$(RESET)\n";
ftest_run:
@ftest
@printf "$(SUCCESS)$(GREEN) 🎉 \
Functional tests passed successfully$(RESET)\n";