forked from aixp/pycoco
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmakepi.how
173 lines (140 loc) · 5.11 KB
/
makepi.how
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
import os
import os.path
import sys
os.chdir( '..' )
ROOT_DIR = os.getcwd( )
sys.path.append( ROOT_DIR )
RFLAGS = '-cn'
DFLAGS = '-acfgijmnpsx'
FLAGS = DFLAGS
SUBDIRS = [ 'pimaker', 'examples', 'frames', 'sources', 'testSuite' ]
GENERATED = [ 'Coco.py', 'Parser.py', 'Scanner.py' ]
COCO = 'python %s/Coco.py' % ROOT_DIR
target: backup (Backup all coco sources files.)
needs: Coco.py Parser.py Scanner.py
todo:
deleteFiles( 'backup/*.py', 'backup/MANIFESST.in', 'backup/README.txt' )
copyFilesTo( 'backup', '*.py', 'MANIFEST.in', 'README.txt' )
$$$
target: restore (Restore the backup)
needs: backup/Coco.py backup/Parser.py backup/Scanner.py
todo:
deleteFiles( '*.py', 'MANIFEST.in', 'README.txt' )
copyFilesTo( '.', 'backup/*.py', 'backup/MANIFEST.in', 'backup/README.txt' )
$$$
target: bootstrap (Rebuild everything.)
needs: sources/Coco.py sources/Parser.py sources/Scanner.py
todo:
$$$
target: sources/Coco.py sources/Parser.py sources/Scanner.py
needs: sources/Coco.atg
sources/Coco.frame sources/Parser.frame sources/Scanner.frame
todo:
changeDir( '${TARGET.dir}' )
shell( COCO, FLAGS, 'Coco.atg' )
changeDir( ROOT_DIR )
$$$
target: testbootstrap (Compare bootstrapped files to current Coco files.)
needs: sources/Coco.py sources/Parser.py sources/Scanner.py
todo:
print 'Comparing newly generated coco files to existing ones.\n'
failed = False
for name in [ 'Coco.py', 'Parser.py', 'Scanner.py' ]:
print ' Checking %s...' % name
orig = name
generated = os.path.join( 'sources', name )
if len(compareFiles( orig, generated )) != 0:
print ' !!! Failed !!!'
failed = True
if not failed:
print 'Congratulations! All generated files verified.\n'
$$$
target: install (Install newly generated files.)
needs: sources/Coco.py sources/Parser.py sources/Scanner.py
todo:
changeDir( ROOT_DIR )
renameFile( 'Coco.py', 'Coco-save.py' )
renameFile( 'Parser.py', 'Parser-save.py' )
renameFile( 'Scanner.py', 'Scanner-save.py' )
moveFilesTo( '.', 'sources/*.py' )
changeDir( 'sources' )
$$$
target: clean (Delete all generated files.)
needs:
todo:
deleteFiles( '*.pyc', 'trace.txt', 'listing.txt' )
changeDir( 'pimaker' )
deleteFiles( '*.pyc', 'trace.txt', 'listing.txt' )
changeDir( ROOT_DIR )
for dir in [ 'sources', 'frames', 'examples', 'testSuite' ]:
changeDir( dir )
deleteFiles( '*.py', '*.pyc', 'trace.txt', 'listing.txt' )
changeDir( ROOT_DIR )
$$$
target: purge (Delete old Coco files and local backups.)
needs:
todo:
deleteFiles( '*-save.py', '*.old', '*.*~' )
for dir in SUBDIRS:
changeDir( dir )
deleteFiles( '*-save.py', '*.old', '*.*~' )
changeDir( ROOT_DIR )
$$$
target: scrub (clean and purge)
needs:
todo:
bld.build('clean')
bld.build('purge')
$$$
target: predistribute (Try creating a distribution.)
needs: sources/Coco.atg
sources/Coco.frame sources/Parser.frame sources/Scanner.frame
Coco.py Parser.py Scanner.py CharClass.py
CodeGenerator.py Core.py DriverGen.py Errors.py
ParserGen.py Trace.py
pimaker/pimaker.py pimaker/pimakerlib.py pimaker/makepi.how
setup.py setupInfo.py MANIFEST.in README.txt
todo:
shell( 'python setup.py sdist' )
$$$
target: distribute (Create and upload the cocop distribution.)
needs: sources/Coco.atg
sources/Coco.frame sources/Parser.frame sources/Scanner.frame
Coco.py Parser.py Scanner.py CharClass.py
CodeGenerator.py Core.py DriverGen.py Errors.py
ParserGen.py Trace.py
pimaker/pimaker.py pimaker/pimakerlib.py pimaker/makepi.how
setup.py setupInfo.py MANIFEST.in README.txt
todo:
os.environ[ 'HOME' ] = 'C:/Documents and Settings/ron'
shell( 'python setup.py sdist upload' )
$$$
target: examples/CDECL1.py examples/CDECL2.py examples/CDECL3.py
examples/structs.py examples/C.py
examples/PASCAL.py examples/PASCAL2.py
examples/MOD2.py examples/PIMMOD2.py examples/OBERON.py
examples/ADACS.py examples/MICROADA.py
examples/CLANG1.py examples/CLANG2.py
examples/PRETTY.py examples/TASTE.py
examples/UMBRIEL1.py examples/UMBRIEL2.py
examples/EXPR.py examples/CALC.py
needs: ${TARGET,py=atg}
todo:
changeDir( '${TARGET.dir}' )
shell( '@echo "" >> testlog.txt' )
shell( '@echo "##### TESTING ${TARGET.name} #####" >> testlog.txt' )
shell( COCO, '-cn ${TARGET.base}.atg >> testlog.txt')
shell( '@echo "----------------------------------" >> testlog.txt' )
shell( 'python ${TARGET.name} >> testlog.txt')
changeDir( ROOT_DIR )
$$$
target: test (compile the example projects)
needs: examples/CDECL1.py examples/CDECL2.py examples/CDECL3.py
examples/CLANG1.py examples/CLANG2.py examples/TASTE.py
examples/MOD2.py examples/OBERON.py examples/PASCAL.py examples/PASCAL2.py
examples/UMBRIEL1.py examples/UMBRIEL2.py
examples/PIMMOD2.py examples/PRETTY.py examples/structs.py
examples/EXPR.py examples/C.py examples/CALC.py
examples/ADACS.py examples/MICROADA.py
todo:
$$$