-
Notifications
You must be signed in to change notification settings - Fork 1
/
buildLibUpnpCil.py
executable file
·70 lines (56 loc) · 1.79 KB
/
buildLibUpnpCil.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#! /usr/bin/env python
import os
import sys
import subprocess
def usage():
print "usage:"
print "$0 variant [target] [-c]"
print "variant: scons configuration (ex variant=release)"
print "target: optional target for all subdirs (ex Lib)"
print "-c: optional clean"
if (sys.argv[1] == "--help"):
usage()
sys.exit()
if (sys.argv[1] == "-h"):
usage()
sys.exit()
def build(path, extraArgs=None):
externalProgram = 'scons'
#navigate to folder to build at
for folder in path:
os.chdir(folder)
#pass args that are specific for build script
if extraArgs:
for i in range(0, len(extraArgs)):
externalProgram += ' ' + extraArgs[i]
#pass command arguments
for i in range(1, len(sys.argv)):
#if build arguemnts override command line arguements use build arguements
key = sys.argv[i].split('=')[0]
if externalProgram.find(key) != -1:
continue
externalProgram += ' ' + sys.argv[i]
retcode = subprocess.call(externalProgram, shell=True)
#return to path before function call
for folder in path:
os.chdir('..')
#if an error occurred in the build exit
if not retcode == 0:
exit()
#get hardware command line argument
hardware = 'hardware=Windows'
for i in range(1, len(sys.argv)):
if sys.argv[i].startswith('hardware'):
hardware = sys.argv[i]
break
build(['Docs'])
build(['External'])
build(['Xml'])
build(['Kodegen'])
build(['LibUpnpCil','Core'],[hardware])
build(['LibUpnpCil','Toolkit'], [hardware])
build(['LibUpnpCil','SysLib'],[hardware])
build(['LibUpnpCil','Control'],[hardware])
build(['LibUpnpCil','Services'],[hardware])
build(['LibUpnpCil','DidlLite'],[hardware])
build(['LibUpnpCil','Topology'],[hardware])