summaryrefslogtreecommitdiff
path: root/web/yacco2/bld_bash_GNU
blob: e31e382b62c10b59aafe5a26592876c00fa98ddc (plain)
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
#! /bin/sh
# File: bld_bash_GNU
# Why: builds the yacco2 package for a GNU environment like Ubuntu
# Note: set the proper path of package by variable O2
# How to run:
# cd /usr/local/yacco2
# . bld_bash_GNU
#
# U can edit/comment out the Gnu_bash_file make lines not wanted
# Happy ccing
#

# determine base folder 
# and set it as a global bash variable for downstream bash makefiles
O2=/usr/local/yacco2/
export O2

echo "----------->Building yacco2 library<-----------"
cd "$O2"/library
make Rlse -f makefile_GNU
#make Dbg -f makefile_GNU
#make Genw -f makefile_GNU

echo "----------->Building yacco2's grammars library<-----------"
cd "$O2"/compiler/grammars
make Rlse -f makefile_GNU
#make Dbg -f makefile_GNU
#make Genw -f makefile_GNU

echo "----------->Building o2 program --- the compiler / compiler<-----------"
cd "$O2"/compiler/o2
make Rlse -f makefile_GNU
#make Dbg -f makefile_GNU
#make Genw -f makefile_GNU

echo "----------->Building o2linker program --- the companion to o2 compiler / compiler<-----------"
cd "$O2"/o2linker
make Rlse -f makefile_GNU
#make Dbg -f makefile_GNU
#make Genw -f makefile_GNU

###
# testing H2Os by gening all options
# the gened eol*.* c++ code is left in the /tmp account
# See yacco2/compiler/grammars/o2grammars.bat for gening properly all the grammars
###
echo "----------->Simple test on self<-----------"
echo "----will only run successfully----"
echo "----when default /yacco2 is used.----------"
echo "----This is due to the include statements in the grammar being compiled----------"
cd /tmp
"$O2"/bin/o2 -t -err "$O2"/compiler/grammars/eol.lex

echo "----------->Exercise the test suite of grammars<-----------"
cd /yacco2/grammar-testsuite
. test-out-grammars.sh -p

###
### If u have cweave / ctangle then comment out below bash commands
### 
#cweave Err
#pdftex Err
#cweave T
#pdftex T
#cweave Lrk
#pdftex Lrk
#mv Err.pdf "$O2"/docs/
#mv T.pdf "$O2"/docs/
#mv Lrk.pdf "$O2"/docs/