starter code
This commit is contained in:
19
build.bash
Executable file
19
build.bash
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euxo pipefail
|
||||
umask 022
|
||||
|
||||
. config/global.env
|
||||
. config/utilities.bash
|
||||
|
||||
|
||||
if [ ! -d $SYSROOT ]; then
|
||||
create_sysroot
|
||||
fi
|
||||
|
||||
|
||||
STAGE=$1
|
||||
PKG=$2
|
||||
|
||||
|
||||
. build/$PKG/build.bash $STAGE
|
||||
10
config/global.env
Normal file
10
config/global.env
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
export SYSROOT=$PWD/sysroot
|
||||
export MAKEFLAGS=-j$(nproc)
|
||||
export LC_ALL=POSIX
|
||||
export TARGET=x86_64-axe-linux-gnu
|
||||
export SOURCES=$PWD/sources
|
||||
export BUILD=$PWD/build
|
||||
export PATH=$SYSROOT/cross/bin:/usr/bin:/usr/sbin
|
||||
export CONFIG_SITE=$SYSROOT/usr/share/config.site
|
||||
export PROJECTDIR=$PWD
|
||||
18
config/utilities.bash
Normal file
18
config/utilities.bash
Normal file
@@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
fetch() {
|
||||
wget -N -c --show-progress -q -P $SOURCES $1
|
||||
}
|
||||
|
||||
|
||||
create_sysroot() {
|
||||
mkdir -p $SYSROOT/{etc,cross,usr}
|
||||
mkdir -p $SYSROOT/usr/{bin,sbin,lib,include}
|
||||
|
||||
for directory in bin sbin lib; do
|
||||
ln -fs usr/$directory $SYSROOT/$directory
|
||||
done
|
||||
|
||||
ln -fs lib $SYSROOT/usr/lib64
|
||||
ln -fs usr/lib64 $SYSROOT/lib64
|
||||
}
|
||||
Reference in New Issue
Block a user