From 78f0fccb9e57f17b55291f138fd179a698358fce Mon Sep 17 00:00:00 2001 From: donker <donker@astron.nl> Date: Wed, 7 Aug 2019 09:09:41 +0200 Subject: [PATCH] add init_hdl.sh --- init_hdl.sh | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 init_hdl.sh diff --git a/init_hdl.sh b/init_hdl.sh new file mode 100644 index 0000000000..b57e5f36d9 --- /dev/null +++ b/init_hdl.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash -e +############################################################################### +# +# Copyright (C) 2018 +# ASTRON (Netherlands Institute for Radio Astronomy) <http://www.astron.nl/> +# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +# $Id$ +# +############################################################################### + +# +# Initialisation script to setup the environment variables for this branch +# + +# +# Make sure it is sourced and no one accidentally gave the script execution rights and just executes it. +if [ "${0}" != "bash" ]; then + echo "ERROR: Use this command with '. ' or 'source '" + exit +fi + +# Figure out where this script is located and set environment variables accordingly +export RADIOHDL_WORK="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# setup paths to build and config dir if not already defined by the user. +export HDL_BUILD_DIR=${HDL_BUILD_DIR:-${RADIOHDL_WORK}/build} +echo "RadioHDL environment will be setup for" $RADIOHDL_WORK + +. ../radiohdl/init_radiohdl.sh -- GitLab