Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed mbed API helper
tools/make.py@3:085cd7710765, 2014-05-23 (annotated)
- Committer:
- sam_grove
- Date:
- Fri May 23 17:54:50 2014 -0500
- Revision:
- 3:085cd7710765
- Child:
- 6:1922f216f192
Update to main
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sam_grove | 3:085cd7710765 | 1 | """ |
sam_grove | 3:085cd7710765 | 2 | |
sam_grove | 3:085cd7710765 | 3 | Build programs in this project |
sam_grove | 3:085cd7710765 | 4 | |
sam_grove | 3:085cd7710765 | 5 | """ |
sam_grove | 3:085cd7710765 | 6 | import os, errno |
sam_grove | 3:085cd7710765 | 7 | |
sam_grove | 3:085cd7710765 | 8 | |
sam_grove | 3:085cd7710765 | 9 | def build_program(args): |
sam_grove | 3:085cd7710765 | 10 | path = os.getcwd() |
sam_grove | 3:085cd7710765 | 11 | parent_path = os.sep.join(path.split(os.sep)[:-1]) |
sam_grove | 3:085cd7710765 | 12 | parent_path += "\\output\\" |
sam_grove | 3:085cd7710765 | 13 | odir = " --destdir " + parent_path |
sam_grove | 3:085cd7710765 | 14 | |
sam_grove | 3:085cd7710765 | 15 | mbeduser = " --user sam_grove" |
sam_grove | 3:085cd7710765 | 16 | preprocessor = " --extra_symbols" + " ONE,TWO" |
sam_grove | 3:085cd7710765 | 17 | |
sam_grove | 3:085cd7710765 | 18 | string = "python ./mbed-API-helper/mbedapi.py --repo http://mbed.org/teams/HDK-Development/code/CMSIS-DAP/ --api http://mbed.org --platform FRDM-KL05Z" |
sam_grove | 3:085cd7710765 | 19 | string += odir |
sam_grove | 3:085cd7710765 | 20 | string += mbeduser |
sam_grove | 3:085cd7710765 | 21 | string += preprocessor |
sam_grove | 3:085cd7710765 | 22 | |
sam_grove | 3:085cd7710765 | 23 | try: |
sam_grove | 3:085cd7710765 | 24 | os.makedirs(parent_path) |
sam_grove | 3:085cd7710765 | 25 | except OSError, e: |
sam_grove | 3:085cd7710765 | 26 | if e.errno != errno.EEXIST: |
sam_grove | 3:085cd7710765 | 27 | raise |
sam_grove | 3:085cd7710765 | 28 | |
sam_grove | 3:085cd7710765 | 29 | #print string |
sam_grove | 3:085cd7710765 | 30 | os.system(string) |
sam_grove | 3:085cd7710765 | 31 | |
sam_grove | 3:085cd7710765 | 32 | |
sam_grove | 3:085cd7710765 | 33 | if __name__ == "__main__": |
sam_grove | 3:085cd7710765 | 34 | import argparse |
sam_grove | 3:085cd7710765 | 35 | parser = argparse.ArgumentParser(description='configure a mbed repository build.') |
sam_grove | 3:085cd7710765 | 36 | parser.add_argument('--username', type=str, help='What is your mbed username', required=False) |
sam_grove | 3:085cd7710765 | 37 | parser.add_argument('--odir', type=str, help='Where does the output go', required=False) |
sam_grove | 3:085cd7710765 | 38 | |
sam_grove | 3:085cd7710765 | 39 | args = parser.parse_args() |
sam_grove | 3:085cd7710765 | 40 | build_program(args) |
sam_grove | 3:085cd7710765 | 41 | |
sam_grove | 3:085cd7710765 | 42 |