2 from __future__ import with_statement
8 <!-- Put board documentation here -->\n\
15 description='Full working example projects.'\n\
21 description = 'Use these as a starting point for your BeRTOS project.'\n\
27 description='Projects to measure different aspects of BeRTOS performance.'\n\
30 def makeBoardDir(dir_path, spec_tpl):
31 #spec_tpl is a template for .spec file
33 with open(dir_path + '.spec', 'w') as f:
38 print "Usage: %s <board_dir> <board_image> <prj_source_dir>" % sys.argv[0]
41 board_dir = sys.argv[1] + os.sep
42 board_img = sys.argv[2]
43 source_dir = sys.argv[3]
45 # create board directory
46 if not os.path.exists(board_dir):
49 print "Board directory exists"
52 with open(board_dir + ".spec", 'w') as f:
53 f.write(SPEC_TEMPLATE)
56 shutil.copy(board_img, board_dir + ".image.png")
58 # create hw/ directory
59 shutil.copytree(source_dir + "hw", board_dir + 'hw')
61 #create examples, templates and benchmark directories together with .spec files
62 makeBoardDir(board_dir + "templates" + os.sep, TEMPLATE)
63 makeBoardDir(board_dir + 'examples' + os.sep, EXAMPLE)
64 makeBoardDir(board_dir + 'benchmark' + os.sep, BENCHMARK)
66 print 'Done. Remember to fill in the description of your board in %s' % (board_dir + '.spec')