]>
src.bluestatic.org Git - armadillo.git/blob - build.py
1 #!/usr/bin/env python2.5
7 ROOT
= os
.path
.dirname(os
.path
.realpath(__file__
))
8 SRC_PATH
= os
.path
.join(ROOT
, 'src')
9 PROD_PATH
= os
.path
.join(ROOT
, 'out')
10 FE_PATH
= os
.path
.join(ROOT
, 'web_frontend')
16 PRODUCT_NAME
= 'armadillo'
22 def _ObjFileName(gofile
):
23 gofile
= os
.path
.basename(gofile
)
24 return os
.path
.join(PROD_PATH
, os
.path
.splitext(gofile
)[0] + '.' + O_EXTENSION
)
27 print '=== Starting Build ==='
31 for gofile
in SOURCES
:
32 gofile
= os
.path
.join(SRC_PATH
, gofile
)
33 args
= [ COMPILER
, gofile
]
34 print ' ' + ' '.join(args
)
35 handle
= subprocess
.Popen(args
, stdout
= sys
.stdout
, stderr
= sys
.stderr
)
39 objects
= map(_ObjFileName
, SOURCES
)
40 args
= [ LINKER
, '-o', os
.path
.join(PROD_PATH
, PRODUCT_NAME
), 'main.8' ]
41 print ' ' + ' ' .join(args
)
42 handle
= subprocess
.Popen(args
, stdout
= sys
.stdout
, stderr
= sys
.stderr
)
46 fe_resources
= os
.path
.join(PROD_PATH
, 'fe')
47 handle
= subprocess
.Popen([ 'rm', '-rf', fe_resources
])
49 shutil
.copytree(FE_PATH
, fe_resources
)
52 if __name__
== '__main__':