-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmakefile
executable file
·78 lines (68 loc) · 2.04 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
############################
# Style Variables #
###########################
GREENBOX = \033[0;42m
REDBOX = \033[0;41m
END = \033[0m
BOLD = \033[0;01m
YELLOW = \033[1;33m
GREEN = \033[0;32m
CYAN = \033[0;36m
LIGHT_CYAN = \033[1;36m
ORANGE= \033[0;33m
SPRED = \n\-------------------------------------------------------\n\n
COLUMN = \033[10C
############################
# Files Variables #
###########################
EXEC = sprint1
LEX = sprint1.lex
YACC = sprint1.y
ARBRE_C = arbre.c
ARBRE_H = arbre.h
SYMBOLE_C = table_symbole.c
SYMBOLE_H = table_symbole.h
GENERATIONCI_C = generationCI.c
FILE_C = arbre.c table_symbole.c generationCI.c genAssembleur.c
############################
# Makefile Action #
###########################
all: ${LEX} ${YACC} ${FILE_C}
@printf "${BOLD}${SPRED}${END}"
@printf "${ORANGE}Compiling in process ... ${END} \n\n"
@printf "${YELLOW}YACC Compiling... \n${END}"
@bison -d ${YACC}
@printf "${CYAN}\t\t YACC Compiled ${END} \n"
@#######
@printf "${YELLOW}LEX Compiling... \n${END}"
@flex ${LEX}
@printf "${CYAN}\t\t LEX Compiled ${END} \n"
@#######
@printf "${YELLOW}Project Compiling... ${END} \n"
@gcc -o ${EXEC} lex.yy.c ${EXEC}.tab.c ${FILE_C} -ly -lm -g
@printf "\n${CYAN}\t\t Project Compiled ${END} \n\n"
@#######
# Pass test
test: all
@printf "${BOLD}${SPRED}${END} \n"
@printf "${ORANGE}Testing in process ... ${END}\n\n"
@for i in Test_Script/*.txt; do \
./sprint1 $$i >> /dev/null \
&& printf "%s""$$i ${GREENBOX} PASSED ${END} \n"\
|| printf "%s""$$i ${REDBOX} FAILED ${END} \n" ; \
done
@printf "\n${GREEN}Great success can commit now ! ${END}\n\n"
# Clean repository
clean:
@rm Test_Script/*.s
@rm *.yy.*
@rm *.tab.*
@rm ${EXEC}
@printf " \n ${BOLD}Répertoire Nettoyer ! ${END}\n\n"
#help makefile
help:
@echo "\n ${BOLD} Action disponible :"
@echo "\t ${ORANGE}make ${END}-> Compile le projet"
@echo "\t ${ORANGE}make test ${END}-> Passe les tests"
@echo "\t ${ORANGE}make clean ${END}-> Nettoie le repertoire"
@echo "\t ${ORANGE}make help ${END}-> Information Makefile \n"