Files
linux-kernel-module-cheat/build-all
Ciro Santilli 六四事件 法轮功 bc73cebff1 Build the Linux kernel independently from Buildroot
This will allow for other types of root filesystems that don't rely on Buildroot
to be added and used in the future.

Propagate --verbose on all build scripts to see full GCC commands.

build-all: allow for neat subsets

also 9p share rootfs_overlay. TODO document.
2018-10-12 09:30:33 +01:00

90 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# Build everything, or a subset of everything.
#
# Without any args, build everything for all archs:
#
# ./build-all
#
# This will build QEMU, gem5, Buildroot, Linux, etc.
# for x86_64, arm and aarch64.
#
# With --archs, build everything for just the given archs:
#
# ./build-all --archs 'arm aarch64'
#
# Other options make this script build only the given projects. E.g., to build
# just Linux and QEMU for all archs, but not gem5, Buildroot, etc.:
#
# ./build-all --linux --qemu
set -eu
archs='x86_64 arm aarch64'
baremetal=false
buildroot=false
gem5=false
linux=false
qemu=false
while [ $# -gt 0 ]; do
case "$1" in
--archs)
archs="$2"
shift 2
;;
--baremetal)
baremetal=true
shift
;;
--buildroot)
buildroot=true
shift
;;
--gem5)
gem5=true
shift
;;
--linux)
linux=true
shift
;;
--qemu)
qemu=true
shift
;;
esac
done
if ! (
"$baremetal" || \
"$buildroot" || \
"$gem5" || \
"$linux" || \
"$qemu"
)
then
baremetal=true
buildroot=true
gem5=true
linux=true
qemu=true
fi
for arch in $archs; do
if "$qemu"; then
./build-qemu --arch "$arch"
fi
if "$baremetal" && [ ! "$arch" = x86_64 ]; then
./build-crosstool-ng --arch "$arch"
./build-baremetal --arch "$arch"
./build-baremetal --arch "$arch" --gem5
./build-baremetal --arch "$arch" --gem5 --machine RealViewPBX
fi
if "$buildroot"; then
./build-buildroot --arch "$arch" --gem5 --kernel-modules "$@"
fi
if "$gem5"; then
./build-gem5 --arch "$arch"
fi
if "$linux"; then
./build-linux --arch "$arch"
fi
done