commit changes
This commit is contained in:
46
build.sh
Normal file → Executable file
46
build.sh
Normal file → Executable file
@@ -1,6 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
if [[ -v DEBUG ]]; then
|
||||
set -euox pipefail
|
||||
else
|
||||
set -euo pipefail
|
||||
fi
|
||||
|
||||
umask 022
|
||||
|
||||
@@ -8,8 +12,42 @@ umask 022
|
||||
. flags.bash
|
||||
. utilities.bash
|
||||
|
||||
create_sysroot
|
||||
|
||||
STAGE="$1"
|
||||
PACKAGE="$2"
|
||||
bootstrap_builds() {
|
||||
for build in binutils gcc linux glibc libstc++; do
|
||||
. "stage/bootstrap/${build}.bash"
|
||||
cd "$PROJDIR"
|
||||
done
|
||||
}
|
||||
|
||||
. "stage/${MODE}/${PACKAGE}.bash"
|
||||
toolchain_builds() {
|
||||
for build in m4 ncurses bash coreutils diffutils file findutils gawk grep gzip make patch sed tar xz binutils gcc; do
|
||||
. "stage/toolchain/${build}.bash"
|
||||
cd "$PROJDIR"
|
||||
done
|
||||
}
|
||||
|
||||
usage() {
|
||||
echo "usage: build.bash <stage> <package>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ $# -eq 1 ]; then
|
||||
|
||||
case $1 in
|
||||
bootstrap)
|
||||
bootstrap_builds
|
||||
;;
|
||||
toolchain)
|
||||
toolchain_builds
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
elif [ $# -eq 2 ]; then
|
||||
. "stage/$1/$2.bash"
|
||||
else
|
||||
usage
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user