First toolflow version
This commit is contained in:
29
init-workspace.sh
Normal file
29
init-workspace.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
if [ -n "$BASH_VERSION" ]; then
|
||||
command -v xargs > /dev/null || { echo >&2 "ERROR: xargs program not available."; }
|
||||
|
||||
if [ "`uname`" = "Darwin" ]; then
|
||||
export TGC_HAMMER_HOME=`dirname ${BASH_SOURCE[0]} | xargs cd | pwd`
|
||||
else
|
||||
command -v realpath > /dev/null || command -v readlink > /dev/null || { echo "ERROR: neither realpath nor readlink programs are available."; }
|
||||
command -v xargs > /dev/null && command -v realpath > /dev/null && export TGC_HAMMER_HOME=`dirname ${BASH_SOURCE[0]} | xargs realpath`
|
||||
command -v xargs > /dev/null && command -v readlink > /dev/null && export TGC_HAMMER_HOME=`dirname ${BASH_SOURCE[0]} | xargs readlink -f`
|
||||
fi
|
||||
elif [ -n "$ZSH_VERSION" ]; then
|
||||
command -v realpath > /dev/null || command -v readlink > /dev/null || { echo "ERROR: neither realpath nor readlink programs are available."; }
|
||||
command -v xargs > /dev/null && command -v realpath > /dev/null && export TGC_HAMMER_HOME=`dirname ${(%):-%x} | xargs realpath`
|
||||
command -v xargs > /dev/null && command -v readlink > /dev/null && export TGC_HAMMER_HOME=`dirname ${(%):-%x} | xargs readlink -f`
|
||||
else
|
||||
echo "ERROR: unknown shell"
|
||||
elif [ -f "source.sh" ]; then
|
||||
echo "Directory already seems to be workspace."
|
||||
elif [ -f "init-workspace.sh" ]; then
|
||||
echo "Cannot create workspace in TGC-Hammer directly, use different directory."
|
||||
else
|
||||
echo "Creating workspace ..."
|
||||
echo "export TGC_HAMMER_HOME=\"${TGC_HAMMER_HOME}\"" > source.sh
|
||||
echo "export TGC_HAMMER_WORKDIR=\"$PWD\"" >> source.sh
|
||||
echo "export PATH=\"${TGC_HAMMER_HOME}/toolflow/target/universal/stage/bin:$PATH\"" >> source.sh
|
||||
|
||||
mkdir -p output
|
||||
fi
|
Reference in New Issue
Block a user