aboutsummaryrefslogtreecommitdiff
path: root/scripts/build-all.py
diff options
context:
space:
mode:
authorAndrew Walker <andreww@codeaurora.org>2012-10-23 18:43:11 -0700
committerStephen Boyd <sboyd@codeaurora.org>2013-09-04 14:17:55 -0700
commit4ea29113de2fdeb85d1224d5f49866c68cd5b156 (patch)
tree1628f1ae1d4b27f6ffb340eaf2bf7e1cbfd6c974 /scripts/build-all.py
parente94b0e8fd3158432107d3b4a3de1a0cf957e9725 (diff)
scripts: build-all: Build make targets sequentially.
Added omap2 to the list of defconfigs to scan. Install headers and kernel modules to separate staging directories by setting values for INSTALL_HDR_PATH and INSTALL_MOD_PATH. Build make targets sequentially instead all on one invocation. Signed-off-by: Andrew Walker <andreww@codeaurora.org> Change-Id: I87dae363bd536808a74ff368b905d18ae11607b2
Diffstat (limited to 'scripts/build-all.py')
-rwxr-xr-xscripts/build-all.py54
1 files changed, 38 insertions, 16 deletions
diff --git a/scripts/build-all.py b/scripts/build-all.py
index fff37360578..f5048e02252 100755
--- a/scripts/build-all.py
+++ b/scripts/build-all.py
@@ -35,6 +35,7 @@ from optparse import OptionParser
import subprocess
import os
import os.path
+import re
import shutil
import sys
@@ -83,12 +84,15 @@ def update_config(file, str):
def scan_configs():
"""Get the full list of defconfigs appropriate for this tree."""
names = {}
- for n in glob.glob('arch/arm/configs/[fm]sm[0-9-]*_defconfig'):
- names[os.path.basename(n)[:-10]] = n
- for n in glob.glob('arch/arm/configs/qsd*_defconfig'):
- names[os.path.basename(n)[:-10]] = n
- for n in glob.glob('arch/arm/configs/apq*_defconfig'):
- names[os.path.basename(n)[:-10]] = n
+ arch_pats = (
+ r'[fm]sm[0-9]*_defconfig',
+ r'apq*_defconfig',
+ r'qsd*_defconfig',
+ r'omap2*_defconfig',
+ )
+ for p in arch_pats:
+ for n in glob.glob('arch/arm/configs/' + p):
+ names[os.path.basename(n)[:-10]] = n
return names
class Builder:
@@ -142,23 +146,41 @@ def build(target):
savedefconfig = '%s/defconfig' % dest_dir
shutil.copyfile(defconfig, dotconfig)
+ staging_dir = 'install_staging'
+ modi_dir = '%s' % staging_dir
+ hdri_dir = '%s/usr' % staging_dir
+ shutil.rmtree(os.path.join(dest_dir, staging_dir), ignore_errors=True)
+
devnull = open('/dev/null', 'r')
subprocess.check_call(['make', 'O=%s' % dest_dir,
'%s_defconfig' % target], env=make_env, stdin=devnull)
devnull.close()
if not all_options.updateconfigs:
- build = Builder(log_name)
-
- result = build.run(['make', 'O=%s' % dest_dir] + make_command)
-
- if result != 0:
- if all_options.keep_going:
- failed_targets.append(target)
- fail_or_error = error
+ # Build targets can be dependent upon the completion of previous
+ # build targets, so build them one at a time.
+ cmd_line = ['make',
+ 'INSTALL_HDR_PATH=%s' % hdri_dir,
+ 'INSTALL_MOD_PATH=%s' % modi_dir,
+ 'O=%s' % dest_dir]
+ build_targets = []
+ for c in make_command:
+ if re.match(r'^-{1,2}\w', c):
+ cmd_line.append(c)
else:
- fail_or_error = fail
- fail_or_error("Failed to build %s, see %s" % (target, build.logname))
+ build_targets.append(c)
+ for t in build_targets:
+ build = Builder(log_name)
+
+ result = build.run(cmd_line + [t])
+ if result != 0:
+ if all_options.keep_going:
+ failed_targets.append(target)
+ fail_or_error = error
+ else:
+ fail_or_error = fail
+ fail_or_error("Failed to build %s, see %s" %
+ (target, build.logname))
# Copy the defconfig back.
if all_options.configs or all_options.updateconfigs: