Skip to content

Instantly share code, notes, and snippets.

@petewarden
Created January 21, 2019 21:34
Show Gist options
  • Save petewarden/c3c45e4819369d3da5595d61411109d2 to your computer and use it in GitHub Desktop.
Save petewarden/c3c45e4819369d3da5595d61411109d2 to your computer and use it in GitHub Desktop.
Call `make -f Makefile` on this gives the error `/tmp/Makefile:9: *** multiple target patterns. Stop.`. Pasting the content directly into the file instead of calling doesn't! Any ideas anyone?
define call_test
%: %
echo "foo"
foo/%: %
echo "foo"
endef
$(call call_test)
@petewarden
Copy link
Author

Most instances of this seem to be related to colons or spaces in filenames, but I think I've eliminated that with this minimal example?
https://stackoverflow.com/questions/2100448/multiple-target-patterns-makefile-error

@petewarden
Copy link
Author

Never mind, this was happening because I was forgetting to call eval! The last line should actually be:

$(eval $(call call_test))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment