From 025dee1276a39e447042cc52fd91ed001d9047d6 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Thu, 1 Aug 2019 12:48:15 +0100 Subject: 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). --- reproduce/analysis/make/initialize.mk | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'reproduce/analysis') diff --git a/reproduce/analysis/make/initialize.mk b/reproduce/analysis/make/initialize.mk index bf79c94..adaf407 100644 --- a/reproduce/analysis/make/initialize.mk +++ b/reproduce/analysis/make/initialize.mk @@ -120,6 +120,10 @@ export LD_LIBRARY_PATH := $(installdir)/lib # causes crashs (see bug #56682). So we'll just give it no value at all. export DYLD_LIBRARY_PATH := +# Recipe startup script, see `reproduce/software/bash/bashrc.sh'. +export PROJECT_STATUS := make +export BASH_ENV := $(shell pwd)/reproduce/software/bash/bashrc.sh + -- cgit v1.2.1