Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible unintentional target invocation #5

Open
sio opened this issue Nov 10, 2019 · 1 comment · May be fixed by #8
Open

Possible unintentional target invocation #5

sio opened this issue Nov 10, 2019 · 1 comment · May be fixed by #8

Comments

@sio
Copy link

sio commented Nov 10, 2019

I think it should be noted somewhere in documentation that targets like "python-pip" may unintentionally trigger execution of other targets if their names match the command line arguments being used.

For example, let's add this rule to GNUmakefile:

ralc:
	touch $@

Now make python-pip search ralc will trigger both pip invocation and this rule. Using -- doesn't help either, the behavior remains exactly the same. That is the price of the clever hack (linked below): while there is a way to read $(MAKECMDGOALS) there is no way (afaik) to forbid execution of those ARGS as separate targets:

python-pip: ARGS := $(filter-out python-pip,$(MAKECMDGOALS))


Thanks for creating this project! I like the idea and I use somewhat similar Makefile in my projects :)

@jeffhung
Copy link
Owner

Hi @sio , thanks for raising this concern. I have got the idea to mitigate it. The mitigation method is not perfect - it still has drawback but at least have no side effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants