Reputation: 671
I have a bash script (like A.sh) which includes a variable like:
ToBeRead=$(sed -n '$=' LogFile)
I was wondering how can I use this variable in a makefile which is called from A.sh like:
make -f Makefile SayHello
Upvotes: 2
Views: 416
Reputation: 4469
Forgive me if this is a dumb noob answer, but couldn't you use an environment variable?
In A.sh:
export VARIABLE=value
In makefile:
# sets VARIABLE if not already set
VARIABLE?=other_value
I could be wrong I'm new to makefiles as well.
Upvotes: 1
Reputation: 34618
You can explicitly set make
variables:
make ToBeRead:="$(sed -n '$=' Logfile)" SayHello
Upvotes: 4