且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

防止GNU make在环境变量中扩展美元符号

更新时间:2022-06-22 22:03:22

两种获得所需结果的方法,我可以看到.两者都需要权衡.

Two ways to get the result you want that I can see. Trade-offs with both.

$ cat Makefile
all: echoFOO echovFOO

echoFOO:
        echo '$(FOO)'

echovFOO:
        echo '$(value vFOO)'
$ FOO='a$$bc' vFOO='a$bc' make
echo 'a$bc'
a$bc
echo 'a$bc'
a$bc