-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.py
49 lines (40 loc) · 1.03 KB
/
deploy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/python
import argparse
from os import getcwd, chdir, path, environ
from subprocess import call
from qkthings.utils import cmd
targets = [
"arduino.uno",
"arduino.nano",
"efm32.dev_tg"
]
libs = [
"qkperipheral",
"qkprogram",
"qkdsp"
]
def unset_all():
environ["TARGET"] = ""
environ["LIB"] = ""
environ["TEST"] = ""
environ["APP"] = ""
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-v","--verbose", action="store_true", default=False, help='verbose')
args = parser.parse_args()
print "=== Deploy embedded"
rootdir = getcwd()
for target in targets:
for lib in libs:
chdir(path.join(rootdir,lib))
print " > Deploy %s %s" % (target, lib)
cmd(["python", "deploy.py"], args.verbose)
for target in targets:
for lib in libs:
chdir(rootdir)
unset_all()
print " > Build %s %s" % (target, lib)
cmd(["make","clean","LIB=%s" % lib,"TARGET=%s" % target], args.verbose)
cmd(["make","lib","LIB=%s" % lib,"TARGET=%s" % target], args.verbose)
if __name__ == "__main__":
main()