Skip to content

Possible unintentional target invocation #5

Open
@sio

Description

@sio

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions