Reputation: 3218
I am trying to have a prompt in Makefile.am
if a condition is not true.
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:
*** missing separator. Stop.
Is it not valid to put an echo statement in the loop? What is going wrong here? any idea please?
I am using:
$ make --version
GNU Make 4.0
Built for x86_64-redhat-linux-gnu
Upvotes: 1
Views: 1356
Reputation: 80931
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.
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).
Upvotes: 2