diff options
author | Mohammad Akhlaghi <mohammad@akhlaghi.org> | 2019-08-01 12:48:15 +0100 |
---|---|---|
committer | Mohammad Akhlaghi <mohammad@akhlaghi.org> | 2019-08-01 12:54:46 +0100 |
commit | 025dee1276a39e447042cc52fd91ed001d9047d6 (patch) | |
tree | 75585e7ab44e8abd634e9d53c87059c9684f768c /reproduce/software/bash/bashrc.sh | |
parent | 704fffcfb11d1b41e276bbb52624c393ff7e4428 (diff) |
Bash startup script for every recipe
Until now the only way to define the environment of the Make recipes was
through the exported Make variables (mostly in `initialize.mk' for the
analysis steps for example). However, there is only so much you can do with
environment variables! In some situations you want slightly more
complicated environment control, like setting an alias or running of
scripts (things that are commonly done in the `~/.bashrc' file of users to
configure their interactive, non-login shells).
With this commit, a `reproduce/software/bash/bashrc.sh' has been defined
for this job (which is currently empty!). Every major Make step of the
project adds this file as the `BASH_ENV' environment variable, so the shell
that is created to execute a recipe first executes this file, then the
recipe. Each top-level Makefile also defines a `PROJECT_STATUS' environment
variable that enables users to limit their envirnoment setup based on the
condition it is being setup (in particular in the early phase of
`basic.mk', where the user can't make any assumption about the programs and
has to write a portable shell script).
Diffstat (limited to 'reproduce/software/bash/bashrc.sh')
-rw-r--r-- | reproduce/software/bash/bashrc.sh | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/reproduce/software/bash/bashrc.sh b/reproduce/software/bash/bashrc.sh new file mode 100644 index 0000000..5a2ca2b --- /dev/null +++ b/reproduce/software/bash/bashrc.sh @@ -0,0 +1,45 @@ +# Bash startup file for better control of project environment. +# +# To have better control over the environment of each analysis step (Make +# recipe), besides having environment variables (directly included from +# Make), it may also be useful to have a Bash startup file (this file). All +# of the Makefiles set this file as the `BASH_ENV' environment variable, so +# it is loaded into all the Make recipes within the project. +# +# The special `PROJECT_STATUS' environment variable is defined in every +# top-level Makefile of the project. It defines the the state of the Make +# that is calling this script. It can have three values: +# +# configure_basic +# --------------- +# When doing basic configuration, therefore the executed steps cannot +# make any assumptions about the version of Bash (or any other +# program). Therefore it is important for any step in this step to be +# highly portable. +# +# configure_highlevel +# ------------------- +# When building the higher-level programs, so the versions of the +# most basic tools are set and you may safely assume certain +# features. +# +# make +# ---- +# When doing the project's analysis: all software have known +# versions. +# +# +# Copyright (C) 2019 Mohammad Akhlaghi <mohammad@akhlaghi.org> +# +# This script 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 script 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. +# +# A copy of the GNU General Public License is available at +# <http://www.gnu.org/licenses/>. |