Skip to content

#: task description doesn't work if target is prefixed with .PHONY declaration #144

@falko

Description

@falko

The best practice is to:

add each phony target as a prerequisite of .PHONY immediately before the target declaration, rather than listing all the phony targets in a single place.

However, if I put a remake task description in front of it, remake --tasks won't show it because .PHONY is a target of its own.

Example:

#: This is the main target
.PHONY: all
all:
    echo "Executing all ..."

Workarounds:

  1. Leave out the .PHONY declaration as in your example and risk hard to debug behavior when a file with the name of the target exists.
  2. Put the .PHONY declaration below the target or elsewhere and risk name mismatches or forgetting to declare phony targets. I've seen that happening even with .PHONY directly above the target.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions