mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-12 09:57:05 +03:00
f3f7980662
git-svn-id: svn://kolibrios.org@9411 a494cfbc-eb01-0410-851d-a64ba20cac60
38 lines
1.0 KiB
Python
38 lines
1.0 KiB
Python
import sys
|
|
import os
|
|
|
|
path_to_tools_workspace = os.path.dirname(os.path.abspath(__file__))
|
|
path_to_tools = os.path.dirname(path_to_tools_workspace)
|
|
sys.path.append(path_to_tools)
|
|
|
|
from lib.tupfile_parser import parse_required_compilers, parse_tupfile_outputs
|
|
from lib.logging import require_tools
|
|
|
|
def get_executable_file(output_file_list):
|
|
for name in output_file_list:
|
|
if name.endswith(".inc"):
|
|
continue
|
|
return name
|
|
|
|
def build():
|
|
required_compilers = parse_required_compilers("Tupfile.lua")
|
|
require_tools(required_compilers)
|
|
os.system("tup")
|
|
output_file_list = parse_tupfile_outputs("Tupfile.lua")
|
|
return get_executable_file(output_file_list)
|
|
|
|
def clean():
|
|
output_file_list = parse_tupfile_outputs("Tupfile.lua")
|
|
for output_file in output_file_list:
|
|
if os.path.exists(output_file):
|
|
os.remove(output_file)
|
|
|
|
def main(argv):
|
|
if len(argv) == 2 and argv[1] == "clean":
|
|
clean()
|
|
else:
|
|
build()
|
|
|
|
if __name__ == "__main__":
|
|
main(sys.argv)
|