简体   繁体   English

如果循环则在makefile.am中回显

[英]echo in makefile.am if loop

I am trying to have a prompt in Makefile.am if a condition is not true. 如果条件不成立,我试图在Makefile.am提示。 I am trying as: 我正在尝试:

if FOUND_MAKEDEPF90
<compilation condition if true>
else
@echo "Create the dependencies Manually\n"
@echo "e.g. ./src/main.o:./src/main.f90"
endif

The true branch is working properly, but, while running the else branch, I am getting error: true分支正常工作,但是在运行else分支时,出现错误:

 *** missing separator.  Stop.

Is it not valid to put an echo statement in the loop? 将echo语句放入循环中无效吗? What is going wrong here? 这是怎么了? any idea please? 有什么想法吗?

I am using: 我在用:

$ make --version
GNU Make 4.0
Built for x86_64-redhat-linux-gnu

You don't have a loop here. 您在这里没有循环。 You have an make level if statement and yes, echo is a shell command and cannot be at the top-level of a makefile. 您具有make级别的if语句,是的, echo是shell命令,不能位于makefile的顶层。

If you are just trying to display a message (at make run time) if that condition isn't met then you can use the make $(info) function (or $(warning) or $(error) which causes make to exit with an error). 如果你只是想显示一条信息(在make如果条件不符合,那么你可以使用make运行时间) $(info)函数(或$(warning)$(error)这将导致使与退出一个错误)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM