export var in Makefile

shell

在shell中,可以使用export修改当前进程的环境变量:

export PATH=.:$PATH
  • 1

就可以将当前路径加入可执行文件查找路径中,这样你就不要敲命令的时候就不用敲路径了。

makefile

export的作用是传递该变量到下级的Makefile中。

不放在目标的时候才会执行。

例如:

a:
        export A
  • 1
  • 2

不行,而下面可以:

export A
a:

from:https://blog.csdn.net/LU_ZHAO/article/details/104953958?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param
原文地址:https://www.cnblogs.com/aspirs/p/13409786.html