mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-09-21 04:00:29 +00:00
build-all: some convenience fixes
* mkdir -p build_dir instead of just failing * Add perf / noperf targets since building "all" is often unnecessary Change-Id: I3216f59338ca37e87b464cccbb9c1cc766356a6c Signed-off-by: Patrick Pannuto <ppannuto@codeaurora.org> (cherry picked from commit b4f13cfa5a53633c0246b2136decc5d210cfcd70)
This commit is contained in:
parent
440d6ed608
commit
c95d227f7a
|
@ -66,7 +66,13 @@ def check_kernel():
|
|||
def check_build():
|
||||
"""Ensure that the build directory is present."""
|
||||
if not os.path.isdir(build_dir):
|
||||
fail("Build directory doesn't exist, please create: %s" % build_dir)
|
||||
try:
|
||||
os.makedirs(build_dir)
|
||||
except OSError as exc:
|
||||
if exc.errno == errno.EEXIST:
|
||||
pass
|
||||
else:
|
||||
raise
|
||||
|
||||
def update_config(file, str):
|
||||
print 'Updating %s with \'%s\'\n' % (file, str)
|
||||
|
@ -171,8 +177,11 @@ def main():
|
|||
|
||||
configs = scan_configs()
|
||||
|
||||
usage = ("usage: %prog [options] all\n" +
|
||||
" %prog [options] target target ...")
|
||||
usage = ("""
|
||||
%prog [options] all -- Build all targets
|
||||
%prog [options] target target ... -- List specific targets
|
||||
%prog [options] perf -- Build all perf targets
|
||||
%prog [options] noperf -- Build all non-perf targets""")
|
||||
parser = OptionParser(usage=usage, version=version)
|
||||
parser.add_option('--configs', action='store_true',
|
||||
dest='configs',
|
||||
|
@ -220,6 +229,18 @@ def main():
|
|||
|
||||
if args == ['all']:
|
||||
build_many(configs, configs.keys())
|
||||
elif args == ['perf']:
|
||||
targets = []
|
||||
for t in configs.keys():
|
||||
if "perf" in t:
|
||||
targets.append(t)
|
||||
build_many(configs, targets)
|
||||
elif args == ['noperf']:
|
||||
targets = []
|
||||
for t in configs.keys():
|
||||
if "perf" not in t:
|
||||
targets.append(t)
|
||||
build_many(configs, targets)
|
||||
elif len(args) > 0:
|
||||
targets = []
|
||||
for t in args:
|
||||
|
|
Loading…
Reference in a new issue