Files
xtchain/scripts/xtchain
Aiken Harris 317fedec34
Some checks failed
Builds / XTchain (full, linux) (push) Has started running
Builds / XTchain (full, windows) (push) Has started running
Builds / XTchain (minimal, linux) (push) Has been cancelled
Builds / XTchain (minimal, windows) (push) Has been cancelled
Fix script compatibility with MSYS2 environment
2025-07-16 22:25:08 +02:00

45 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# PROJECT: XTchain
# LICENSE: See the COPYING.md in the top level directory
# FILE: scripts/xtchain
# DESCRIPTION: XTchain Entry Script
# DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
# Get the absolute path to the XTchain
export XTCDIR="$(realpath $(dirname "${0}"))"
# Read the XTchain version
export XTCVER="$(cat "${XTCDIR}/Version")"
# Load the library
source "${XTCDIR}/lib/xtchain/xtclib"
# Set the target architecture
: ${TARGET:=${1}}
: ${TARGET:=amd64}
# Save the source directory
export SRCDIR="${2:-${PWD}}"
# Make sure the compiler flags are clean
export HOST=
export CFLAGS=
export CXXFLAGS=
export LDFLAGS=
# Update PATH
export PATH="${XTCDIR}/bin:${PATH}"
# Display banner
version
# Invoke shell with fancy prompt
export PFMAT1="\[\033[0;1;97;44m\]"
export PFMAT2="\[\033[0;34;104m\]"
export PFMAT3="\[\033[0;1;97;104m\]"
export PFMAT4="\[\033[0;94;49m\]"
export PFMAT5="\[\033[1;38;5;74m\]"
export PROMPT="\n${PFMAT1} XT Toolchain ${PFMAT2}${PFMAT3} \w ${PFMAT4}${PFMAT5} "
bash --rcfile <(echo 'export PS1="${PROMPT}" && cd "${SRCDIR}"')