[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Setting an environment variable while inside a target
From: |
pip9ball |
Subject: |
Setting an environment variable while inside a target |
Date: |
Thu, 19 Feb 2009 19:42:42 -0800 (PST) |
Hi,
I'm looking for a way to export/set an environment variable while I'm inside
a target. I'm using gnuMake to launch several thousand simulation
regression runs and want to be able to know what target is currently being
executed. I have one external perl script which I would like to query an
environment variable named "CURRENT_TARGET" and perform conditional
statements based on the value. Below is some sample code of what I'm trying
to do.
test1:
export CURRENT_TARGET = $@
@printenv | grep CURRENT_TARGET
test2:
export CURRENT_TARGET = $@
@printenv | grep CURRENT_TARGET
What I want to happen is:
make test1
test1 <---- output from printenv command
make test2
test2
My perl script would be able to look at the CURRENT_TARGET env variable and
do some stuff.
Is this possible?
Thanks,
Phil
--
View this message in context:
http://www.nabble.com/Setting-an-environment-variable-while-inside-a-target-tp22114339p22114339.html
Sent from the Gnu - Make - Help mailing list archive at Nabble.com.
- Setting an environment variable while inside a target,
pip9ball <=