I'm trying to do something like:
wt=$(sed -n ... file1)
sed -i "s/temp/$(wt)/" file2
wt is a variable which is getting it's value from file1 and I want to replace "temp" in file2 wth the value of wt.
The sed commands work as I tried to do the same thing in terminal and it works, but when I run "make", it's giving output as:
wt=
sed -i "s/temp//" file2
I'm using GNU Make 4.3.
Edit: I'm trying to do this in a function in my Makefile, like this:
define func
wt=$(sed -n ... $(2))
sed -i "s/temp/$(wt)/" $(1)
endef