Hi,
On 8/10/22 22:19, Jean-Baptiste Poittevin wrote:
By using a lot of PHONY targets, I think you're closing a door to one
make greatest feature : not redoing those things that are already up to
date.
If you consider that every rule can generate a useful file (file
containing container image for example) or a dummy file, you can benefit
from the date comparison between it and its pre-requisites and diminish
greatly the need for PHONY targets. In my opinion, PHONY targets should
just be used for comfort of the user launching make, and those targets
have simply a dependency to a real file.
Agree. The Linux man-pages project has a lot of Makefile code for
linting, and we use dummy files to benefit from make(1)'s date
comparison. You might want to have a look at the code:
<https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/>
Cheers,
Alex
Le 10 août 2022 21:08:55 GMT+02:00, Katherine Pata <m...@kitty.sh> a écrit :
I often find myself using makefiles to handle things like project
linting, container images, various scripts, initiating tests, and
other misc tasks. Sometimes these include tasks that have real
dependencies that make should keep track of, but often the vast
majority of targets are phony.
Something like --reverse-phony or a variable like .GENUINE or .REAL
that is mutually exclusive with .PHONY would be really helpful.
Would there be interest in developing this for GNU Make? If someone
creates a patch, would this be accepted?
Has this been discussed before?