Skip to content

Commit

Permalink
Add build step to compile only linux toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
NoMore201 committed Jul 22, 2024
1 parent bd70e05 commit 671c74a
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions build-toolchain
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ options:
--clean-all Delete all build and install folders
Supported build steps are:
all Build both windows and linux toolchains
all Build both windows and linux toolchains (compiler + binutils + newlib)
linux Build linux toolchain (compiler + binutils + newlib)
binutils-mcs Build MCS version of binutils for linux
binutils-tc Build Tricore version of binutils for linux
gcc-stage1 Build stage1 GCC compiler for linux
Expand Down Expand Up @@ -72,12 +73,12 @@ task_string="$build_task-$build_step"

### Binutils MCS

if [[ "$task_string" == "clean-binutils-mcs" || "$task_string" == "clean-all" ]]; then
if [[ "$task_string" == "clean-binutils-mcs" || "$task_string" == "clean-all" || "$task_string" == "clean-linux" ]]; then
echo "Deleting $BUILD_FOLDER/binutils-mcs..."
rm -fr "$BUILD_FOLDER/binutils-mcs"
fi

if [[ "$task_string" == "build-binutils-mcs" || "$task_string" == "build-all" ]]; then
if [[ "$task_string" == "build-binutils-mcs" || "$task_string" == "build-all" || "$task_string" == "build-linux" ]]; then
BINUTILS_SRC_FOLDER=$TOOLCHAIN_ROOT/tricore-binutils-gdb
mkdir -p "$BUILD_FOLDER/binutils-mcs"
mkdir -p "$LOG_FOLDER"
Expand Down Expand Up @@ -126,12 +127,12 @@ fi

### Binutils

if [[ "$task_string" == "clean-binutils-tc" || "$task_string" == "clean-all" ]]; then
if [[ "$task_string" == "clean-binutils-tc" || "$task_string" == "clean-all" || "$task_string" == "clean-linux" ]]; then
echo "Deleting $BUILD_FOLDER/binutils-tc..."
rm -fr "$BUILD_FOLDER/binutils-tc"
fi

if [[ "$task_string" == "build-binutils-tc" || "$task_string" == "build-all" ]]; then
if [[ "$task_string" == "build-binutils-tc" || "$task_string" == "build-all" || "$task_string" == "build-linux" ]]; then
BINUTILS_SRC_FOLDER="$TOOLCHAIN_ROOT/tricore-binutils-gdb"
mkdir -p "$BUILD_FOLDER/binutils-tc"
mkdir -p "$LOG_FOLDER"
Expand Down Expand Up @@ -181,12 +182,12 @@ fi

### GCC stage1

if [[ "$task_string" == "clean-gcc-stage1" || "$task_string" == "clean-all" ]]; then
if [[ "$task_string" == "clean-gcc-stage1" || "$task_string" == "clean-all" || "$task_string" == "clean-linux" ]]; then
echo "Deleting $BUILD_FOLDER/gcc-stage1..."
rm -fr "$BUILD_FOLDER/gcc-stage1"
fi

if [[ "$task_string" == "build-gcc-stage1" || "$task_string" == "build-all" ]]; then
if [[ "$task_string" == "build-gcc-stage1" || "$task_string" == "build-all" || "$task_string" == "build-linux" ]]; then
GCC_SRC_FOLDER=$TOOLCHAIN_ROOT/tricore-gcc
# Download necessary dependencies if they don't exist
if [[ ! -d $GCC_SRC_FOLDER/gmp ]]; then
Expand Down Expand Up @@ -242,12 +243,12 @@ fi

### Newlib

if [[ "$task_string" == "clean-newlib" || "$task_string" == "clean-all" ]]; then
if [[ "$task_string" == "clean-newlib" || "$task_string" == "clean-all" || "$task_string" == "clean-linux" ]]; then
echo "Deleting $BUILD_FOLDER/newlib..."
rm -fr "$BUILD_FOLDER/newlib"
fi

if [[ "$task_string" == "build-newlib" || "$task_string" == "build-all" ]]; then
if [[ "$task_string" == "build-newlib" || "$task_string" == "build-all" || "$task_string" == "build-linux" ]]; then
NEWLIB_SRC_FOLDER="$TOOLCHAIN_ROOT/tricore-newlib-cygwin"
mkdir -p "$BUILD_FOLDER/newlib"
mkdir -p "$LOG_FOLDER"
Expand Down Expand Up @@ -287,12 +288,12 @@ fi

### GCC stage2

if [[ "$task_string" == "clean-gcc-stage2" || "$task_string" == "clean-all" ]]; then
if [[ "$task_string" == "clean-gcc-stage2" || "$task_string" == "clean-all" || "$task_string" == "clean-linux" ]]; then
echo "Deleting $BUILD_FOLDER/gcc-stage2..."
rm -fr "$BUILD_FOLDER/gcc-stage2"
fi

if [[ "$task_string" == "build-gcc-stage2" || "$task_string" == "build-all" ]]; then
if [[ "$task_string" == "build-gcc-stage2" || "$task_string" == "build-all" || "$task_string" == "build-linux" ]]; then
export GCC_SRC_FOLDER=$TOOLCHAIN_ROOT/tricore-gcc
mkdir -p "$BUILD_FOLDER/gcc-stage2"
mkdir -p "$LOG_FOLDER"
Expand Down

0 comments on commit 671c74a

Please sign in to comment.