Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How not to remove "get make: *** No rule to make target" for goals

I have the following target:

.PHONY: echo
echo:
    @echo "parameters:" $(filter-out $@,$(MAKECMDGOALS))

When I execute it, I get not just the target I specified, but also an error when Make tries to run make hello:

$ make echo hello world
parameters: hello world
make: *** No rule to make target `hello'.  Stop.

How do I fix or suppress the error in the last line?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

The error occurs because Make doesn’t know what to do about targets like hello and world. You want it to do nothing, but it doesn’t know that.

So add a "match anything" rule that does nothing:

%:
    @:
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading