view more/ @ 1344:6a04a89a0d19

Add BUILD_NATIVE_ONLY and NO_CLEAN controls to Also break out the hdb.img creation and do that single threaded for all targets, then reuse the scratch drives. (Avoids triggering due to disk thrashing on large FORK=1 builds.)
author Rob Landley <>
date Sun, 03 Apr 2011 15:08:35 -0500
parents dadbb8873a36
children 7eabfa815c90
line wrap: on
line source

# Build every target architecture, saving log files to build/log.
# If $FORK is set, build them in parallel.

. sources/ || exit 1

[ -z "$CROSS_HOST_ARCH" ] && export CROSS_HOST_ARCH=i686

trap "killtree $$" EXIT

# Build the host architecture.  This has to be built first so the other
# architectures can canadian cross static compilers to run on the host using
# this toolchain to link against a host version of uClibc.

# This also performs the and steps, which don't
# parallelize well if many instances try to call them at once.

# If this fails, don't bother trying to build the other targets.

if [ -z "$BUILD_NATIVE_ONLY" ]
  [ -z "$NO_CLEAN" ] && blank_tempdir build

  mkdir -p build/logs &&
  (EXTRACT_ALL=1 ./ 2>&1 &&
   ./ 2>&1 &&
   ./ 2>&1 "$CROSS_HOST_ARCH" ||
   dienow) | tee build/logs/build-host-cc.txt | maybe_quiet

  cp packages/MANIFEST build || dienow

  # Build all non-hw targets, possibly in parallel

  more/ \
    './ $TARGET 2>&1 | tee build/logs/build-${TARGET}.txt'


  # Run for each non-hw target.

  more/ \
    'more/ $TARGET 2>&1 | tee build/logs/smoketest-$TARGET.txt'


# Build the hdb images sequentially without, to avoid potential
# I/O storm triggering timeouts

FORK= more/ \
  '. sources/toys/; HDBMEGS=2048; HDB=build/system-image-$TARGET/hdb.img; echo "$HDB"; rm -f "$HDB"; make_hdb'

# Build static-tools (dropbear and strace) for each target

mkdir -p build/native-static || dienow
more/ \
  'ln -sf ../native-static build/system-image-$TARGET/upload'

more/ \
  'more/ 60 "HDB=hdb.img more/ $TARGET build/control-images/static-tools.hdc | tee build/logs/native-$TARGET.txt"'

# If using a test version of busybox, run busybox test suite.

is_in_list busybox "$USE_UNSTABLE" &&
  more/ \
    'more/ 60 "HDB=hdb.img more/ $TARGET build/control-images/busybox-test.hdc" | tee build/logs/busybox-test-$TARGET.txt'

# Create a file containing simple pass/fail results for all architectures.

more/ --logs | tee build/logs/status.txt