看例子:

.SECONDEXPANSION:

ONE=onefile
TWO=twofile

myfile: $(ONE)  $$(TWO)
    echo "myfile"

onefile:
    echo "onefile"

twofile:
    echo "twofile"

执行结果:

onefile

twofile

myfile

如果把 .SECONDEXPANSION: 一行去掉:

#.SECONDEXPANSION:

ONE=onefile
TWO=twofile

myfile: $(ONE)  $$(TWO)
    echo "myfile"

onefile:
    echo "onefile"

twofile:
    echo "twofile"

运行时显示:

make: *** No rule to make target '$(TWO)', needed by 'myfile'. Stop.

这基本说明了 .SECONDEXPANSION: 的作用。

相关文章:

  • 2022-12-23
  • 2021-12-24
  • 2021-06-18
  • 2022-12-23
  • 2021-05-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-29
  • 2021-10-13
  • 2021-08-22
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
相关资源
相似解决方案