On 08Nov2019 10:30, David <bouncingc...@gmail.com> wrote:
On Fri, 8 Nov 2019 at 09:43, Cameron Simpson <c...@cskk.id.au> wrote:
[...]

    _help:
            @echo '_build: make $(py_static_bundle)'
            @echo '_deploy_tip: formally deploy the current tip to the dev host 
dev tree:'
            @echo '_sync_dev: rsync the current working files into the dev tip 
tree'

[...]

Things to note:

"Virtual targets" are actions rather than result files, and start with
an underscore.

The default target is _help, which recites a description of the other
targets.

Hi, as you might be aware, the above recipe will not be run if a file
named '_help' exists.

Hence the funny name. I don't make files whole names begin with underscores.

The Gnu make documentation term for what you call "virtual targets"
is "phony targets", and it discusses them here:
https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets

I would add the line:
.PHONY: _help
And similar for all the other phony targets.

If you're using GNU make, go right ahead. But that approach treats .PHONY like a label to be applied to _its_ dependents. Probably that's exactly what it does. However, that is the inverse of the normal target:dependent relationship one puts in Makefiles.

My personal approach is this:

   _always:
       :

   _help:  _always

i.e. make the "phony" targets depend on "_always", which are thus always out of date and thus will always run. You've still to avoid making a "_always", but that is a smaller thing than the whole "_*" space, if that is a concern.

Cheers,
Cameron Simpson <c...@cskk.id.au>
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to