tech-pkg archive

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

Re: != vs :sh

On 2019-03-31 05:16, Roland Illig wrote:
Am 28.03.2019 um 10:33 schrieb Jonathan Perkin:
* On 2019-03-28 at 09:22 GMT, Edgar Fuß wrote:

Yes, joerg's right, :sh is preferable.
Could someone please elaborate why it is?
It defers evaluation of the command until it is used.  So with a
Makefile like the following:

   UNAME_EXCLAM!= uname
   UNAME_CMD=     uname

     @echo ${UNAME_EXCLAM}

     @echo ${UNAME_CMD:sh}

UNAME_EXCLAM will be executed for every invocation of the Makefile,
whereas UNAME_CMD will only be executed when the "cmd" target is
Thank you for this explanation. After the 2019Q1 branch, pkglint will
warn about cases like this and provide an even more detailed explanation.

That would be great, thanks!

Home | Main Index | Thread Index | Old Index