Rev 9377 | Rev 9380 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
9367 | Boppan | 1 | import sys |
2 | import os |
||
3 | |||
9374 | Boppan | 4 | path_to_tools_workspace = os.path.dirname(os.path.abspath(__file__)) |
5 | path_to_tools = os.path.dirname(path_to_tools_workspace) |
||
9370 | Boppan | 6 | sys.path.append(path_to_tools) |
9367 | Boppan | 7 | |
9377 | Boppan | 8 | from lib.tupfile_parser import parse_tupfile_outputs |
9367 | Boppan | 9 | |
9379 | Boppan | 10 | def get_executable_file(output_file_list): |
11 | for name in output_file_list: |
||
9377 | Boppan | 12 | if name.endswith(".inc"): |
13 | continue |
||
14 | return name |
||
9367 | Boppan | 15 | |
9379 | Boppan | 16 | def build(): |
17 | os.system("tup") |
||
18 | output_file_list = parse_tupfile_outputs("Tupfile.lua") |
||
19 | return get_executable_file(output_file_list) |
||
20 | |||
21 | def clean(): |
||
22 | output_file_list = parse_tupfile_outputs("Tupfile.lua") |
||
23 | for output_file in output_file_list: |
||
24 | os.remove(output_file) |
||
25 | |||
26 | def main(argv): |
||
27 | if len(argv) == 2 and argv[1] == "clean": |
||
28 | clean() |
||
29 | else: |
||
30 | build() |
||
31 | |||
9367 | Boppan | 32 | if __name__ == "__main__": |
9379 | Boppan | 33 | main(sys.argv) |