[Makefile] The apices inside a file are lost

whired123

Member
Joined
Nov 15, 2021
Messages
71
Reaction score
4
Credits
539
Code:
$ tree
├── makefile
├── template
├── var1
└── var2

$ cat var1
xxx="true"

$ cat var2
yyy="false"

$ cat template
$config

$ cat makefile
var1 := $(shell cat var1)
var2 := $(shell cat var2)

default:
    sh -c "config='$(var1) $(var2)' envsubst < template"

$ make
sh -c "config='xxx="true" yyy="false"' envsubst < template"
xxx=true yyy=false

Observe the output last line

Code:
xxx=true yyy=false

But I expected

Code:
xxx="true" yyy="false"

Practically macan the apices.
Why?
 

Members online


Latest posts

Top