Why GNU Make canned recipe doesn't work?

微笑、不失礼 提交于 2019-11-30 06:29:50
Carl Norum

I think you don't want the = at the end of the define line. This makefile works here for me:

define make-foo
echo making $@
touch $@
endef

.PHONY: foo1
foo1:
    $(make-foo)

Example:

$ make
echo making foo1
making foo1
touch foo1
$ ls
Makefile  foo1

The GNU make manual seems to indicate that the = should be just fine, but like you, I get different behaviour if I have it there.

Edit: I just asked:

GNU make differences in multiline variable declarations

To get some clarification on what's happening here...

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!