mirror of
https://github.com/usatiuk/ficus.git
synced 2025-10-28 16:17:51 +01:00
CI: a bit more streamlined scripts
This commit is contained in:
@@ -1,16 +1,9 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euxo pipefail
|
|
||||||
|
|
||||||
if [ -z "$FICUS_ROOT" ]; then
|
|
||||||
echo "$FICUS_ROOT" is blank
|
|
||||||
fi
|
|
||||||
export SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
export SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||||
|
|
||||||
export PREFIX="$FICUS_ROOT/toolchain/gcc-x86_64-ficus-prefix/"
|
|
||||||
export TARGET=x86_64-ficus
|
|
||||||
export PATH="$PREFIX/bin:$PATH"
|
|
||||||
|
|
||||||
cd "$SCRIPT_DIR"
|
cd "$SCRIPT_DIR"
|
||||||
|
source buildenv.sh
|
||||||
|
|
||||||
|
set -euxo pipefail
|
||||||
|
|
||||||
if [ $# -eq 0 ]
|
if [ $# -eq 0 ]
|
||||||
then
|
then
|
||||||
@@ -18,28 +11,35 @@ if [ $# -eq 0 ]
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${BUILD_PARALLEL}" ]
|
|
||||||
then
|
|
||||||
export BUILD_PARALLEL=$(nproc)
|
|
||||||
fi
|
|
||||||
if [ -z "${BUILD_PARALLEL}" ]
|
|
||||||
then
|
|
||||||
export BUILD_PARALLEL=$BUILD_PARALLEL
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$1" != "s2only" ]]
|
|
||||||
then
|
|
||||||
"$SCRIPT_DIR"/build-s1.sh
|
|
||||||
cd "$SCRIPT_DIR"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$1" = "s1only" ]]
|
|
||||||
then exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p "$FICUS_ROOT/sysroot"
|
mkdir -p "$FICUS_ROOT/sysroot"
|
||||||
|
|
||||||
"$SCRIPT_DIR"/build-newlib.sh
|
case "$1" in
|
||||||
cd "$SCRIPT_DIR"
|
"newlib")
|
||||||
"$SCRIPT_DIR"/build-s2.sh
|
"$SCRIPT_DIR"/build-newlib.sh noconf
|
||||||
cd "$SCRIPT_DIR"
|
;;
|
||||||
|
"newlib-conf")
|
||||||
|
"$SCRIPT_DIR"/build-newlib.sh conf
|
||||||
|
;;
|
||||||
|
"s2only")
|
||||||
|
"$SCRIPT_DIR"/build-newlib.sh conf
|
||||||
|
cd "$SCRIPT_DIR"
|
||||||
|
"$SCRIPT_DIR"/build-s2.sh
|
||||||
|
cd "$SCRIPT_DIR"
|
||||||
|
;;
|
||||||
|
"s1only")
|
||||||
|
"$SCRIPT_DIR"/build-s1.sh
|
||||||
|
cd "$SCRIPT_DIR"
|
||||||
|
;;
|
||||||
|
"all")
|
||||||
|
"$SCRIPT_DIR"/build-s1.sh
|
||||||
|
cd "$SCRIPT_DIR"
|
||||||
|
"$SCRIPT_DIR"/build-newlib.sh conf
|
||||||
|
cd "$SCRIPT_DIR"
|
||||||
|
"$SCRIPT_DIR"/build-s2.sh
|
||||||
|
cd "$SCRIPT_DIR"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown command"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|||||||
@@ -1,20 +1,44 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
||||||
if [ -z "$FICUS_ROOT" ]; then
|
if [ -z "$SCRIPT_DIR" ]; then
|
||||||
echo "$FICUS_ROOT" is blank
|
echo "SCRIPT_DIR" is blank! Run this via build-all
|
||||||
fi
|
fi
|
||||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
|
||||||
|
|
||||||
export PREFIX="$FICUS_ROOT/toolchain/gcc-x86_64-ficus-prefix/"
|
|
||||||
export TARGET=x86_64-ficus
|
|
||||||
export PATH="$PREFIX/bin:$PATH"
|
|
||||||
cd "$SCRIPT_DIR"
|
cd "$SCRIPT_DIR"
|
||||||
|
|
||||||
|
if [ $# -eq 0 ]
|
||||||
|
then
|
||||||
|
echo "No arguments supplied"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
"conf")
|
||||||
|
;;
|
||||||
|
"noconf")
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown option"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
cd newlib
|
cd newlib
|
||||||
# rm -rf build
|
|
||||||
|
if [[ "$1" = "conf" ]]
|
||||||
|
then
|
||||||
|
rm -rf build
|
||||||
|
fi
|
||||||
|
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
cd build
|
cd build
|
||||||
../newlib-4.4.0.20231231/configure --enable-newlib-supplied-syscalls --prefix=/usr --target=$TARGET
|
|
||||||
|
if [[ "$1" = "conf" ]]
|
||||||
|
then
|
||||||
|
../newlib-4.4.0.20231231/configure --enable-newlib-supplied-syscalls --prefix=/usr --target=$TARGET
|
||||||
|
fi
|
||||||
|
|
||||||
make -j$BUILD_PARALLEL all
|
make -j$BUILD_PARALLEL all
|
||||||
make DESTDIR="$FICUS_ROOT/sysroot" install
|
make DESTDIR="$FICUS_ROOT/sysroot" install
|
||||||
cp -r "$FICUS_ROOT/sysroot/usr"/x86_64-ficus/* "$FICUS_ROOT/sysroot/usr"
|
cp -r "$FICUS_ROOT/sysroot/usr"/x86_64-ficus/* "$FICUS_ROOT/sysroot/usr"
|
||||||
|
|||||||
19
ficus-toolchain/buildenv.sh
Executable file
19
ficus-toolchain/buildenv.sh
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ -z "$FICUS_ROOT" ]; then
|
||||||
|
echo "$FICUS_ROOT" is blank
|
||||||
|
fi
|
||||||
|
|
||||||
|
export PREFIX="$FICUS_ROOT/toolchain/gcc-x86_64-ficus-prefix/"
|
||||||
|
export TARGET=x86_64-ficus
|
||||||
|
export PATH="$PREFIX/bin:$PATH"
|
||||||
|
|
||||||
|
if [ -z "${BUILD_PARALLEL}" ]
|
||||||
|
then
|
||||||
|
export BUILD_PARALLEL=$(nproc)
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${BUILD_PARALLEL}" ]
|
||||||
|
then
|
||||||
|
export BUILD_PARALLEL=$BUILD_PARALLEL
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user