更改makefile中的PATH

问题描述 投票:0回答:1

我的简单makefile

#export PATH=/xxx/bin:$$PATH

$(info $(PATH))

export ABC=123

t:
        echo $${PATH}

        echo $${ABC}

运行正常。直到我取消第一行的注释。以下是之前和之后的输出之前:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
echo ${PATH}
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
echo ${ABC}
123
echo 123
123

之后:

/xxx/bin:$PATH
echo ${PATH}
/xxx/bin:$PATH
echo ${ABC}
123
echo 123
make: echo: Command not found
make: *** [t.mk:13: t] Error 127  
linux makefile
1个回答
2
投票

您想要export PATH := /xxx/bin:$(PATH)

© www.soinside.com 2019 - 2024. All rights reserved.