bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Making makefiles with primarily phony targets more friendly


From: Alejandro Colomar
Subject: Re: Making makefiles with primarily phony targets more friendly
Date: Wed, 10 Aug 2022 22:38:13 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.1.0

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 <me@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?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]