FPS measurement in debugscript, more python analysis
[ipdf/code.git] / tools / build.py
1 #!/usr/bin/python
2
3 from common import *
4
5 import subprocess
6
7 def Build(real_type, quadtree=False, controlpanel=False):
8     global options
9     real_name = ""
10     if (type(real_type) == str):
11         quadtree = "enabled" if (real_type.split("-")[-1] == "qtree") else quadtree
12         real_type = real_type.split("-")[0]
13         real_name = real_type
14         real_type = options["real_names"].index(real_type)
15     else:
16         real_name = options["real_names"][real_type]
17         
18     quadtree = "enabled" if quadtree else "disabled"
19     controlpanel = "enabled" if controlpanel else "disabled"
20     if (os.system("make -C %s clean" % options["ipdf_src"]) != 0):
21         raise Exception("Make clean failed.")
22     if (os.system("make -C %s REALTYPE=%d QUADTREE=%s CONTROLPANEL=%s" % (options["ipdf_src"], real_type, quadtree, controlpanel)) != 0):
23         raise Exception("Make failed.")
24         
25     q = "-qtree" if quadtree == "enabled" else ""
26     os.rename(options["ipdf_bin"], options["local_bin"]+real_name+q)
27
28
29 def BuildAll():
30         p = ProgressBar(len(options["tobuild"]))
31         print("Building: %s" % str(options["tobuild"]))
32         p.animate(0)
33         for (i,b) in enumerate(options["tobuild"]): #options["real_names"]:
34                 if b in options["ignore"]:
35                         continue
36                 try:
37                         Build(b, False, False)
38                         options["built"] += [b]
39                 except:
40                         display("Failed to build %s" % b)
41                 p.animate(i+1)
42
43 if __name__ == "__main__":
44         BuildAll()

UCC git Repository :: git.ucc.asn.au