AlphaGoku
AlphaGoku

Reputation: 1020

Variable in makefile needed in csh

I have a variable in a makefile that holds a value.

Example in MakefileA.mk:

VAR1 = 1

This value needs to be used in a csh file, for example CshA.csh:

if ($VAR1) then

How can you include the makefile in the csh or extract the value of VAR1 to be used in the csh file?

Upvotes: 0

Views: 420

Answers (1)

dash-o
dash-o

Reputation: 14452

Revised based on input from OP:

Consider adding a target to the make file to query the "var1"

query-var1:
    @echo $(VAR1)

Then in the CshA.csh script, use the target to query the variable

...
make -f MakefileA
set VAR1=`make -f MakefileA query-var1`
if ($VAR1) then
   ...
endif

Upvotes: 2

Related Questions