-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile
executable file
·50 lines (39 loc) · 968 Bytes
/
compile
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
#!/bin/bash
#! /bin/bash
PROJECT=jsonlikeql
EXT=jql
DIR=.
EXEC=$DIR/makefile-unix/$PROJECT
LOGFILE=build.log
LOGGALGAS=galgas.log
MAKEFILEUNIX=1
export PATH=$PATH:$DIR
rm -f $LOGFILE
galgas +${PROJECT}.galgasProject --emit-syntax-diagrams --output-html-grammar-file > $LOGFILE
Erreurs=`awk '/./{line=$0} END{print line}' $LOGFILE | grep -Eo '[0-9]{1,4}' | awk '/[0-9]+/{i++}i==1'`
echo "Erreurs or Warnings : " $Erreurs
if [[ $Erreurs -gt 0 ]]; then
echo "Errors found here !!"
cat $LOGFILE
exit
fi
if [ -f $EXEC ]; then
echo -e "Deleting old executable ..."
rm -f $EXEC*
echo -e "Done !"
fi
./makefile-unix/build.py
#run after compiling to accelerate the development
if [[ MAKEFILEUNIX -eq 1 && -f ./makefile-unix/$PROJECT ]]; then
for file in $DIR/files/*
do
if [[ -f $file ]]; then
echo -e "Testing file " $file " ..."
./makefile-unix/$PROJECT $file
if [ $? -ne "0" ]; then
exit
fi
echo -e "Done !" $?
fi
done
fi