tech-toolchain archive

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

Lazy ${${VAR} != "no":? ... : ...}



Hallo, Roland.

Is this form now deprecated?

  CPPFLAGS += ${${USE_INET6} != "no":? -DINET6 :}

which used to be lazy, instead of:

  .if (${USE_INET6} != "no")
  CPPFLAGS += -DINET6
  .endif

that requires the variable to be defined and so requires inclusion of
bsd.init.mk early.


On Sun, Aug 30, 2020 at 19:04:44 -0400, Christos Zoulas wrote:

> > On Aug 30, 2020, at 7:01 PM, Valery Ushakov <uwe%stderr.spb.ru@localhost> wrote:
> > 
> > On Sun, Aug 30, 2020 at 17:12:45 -0400, Christos Zoulas wrote:
> > 
> >> Module Name:	src
> >> Committed By:	christos
> >> Date:		Sun Aug 30 21:12:45 UTC 2020
> >> 
> >> Modified Files:
> >> 	src/usr.sbin/puffs/mount_9p: Makefile
> >> 
> >> Log Message:
> >> include bsd.init.mk to avoid:
> >> make: Bad conditional expression ` != "no"' in  != "no"? -DINET6 :
> > 
> > This worked and the :? for was specifically used to so that the ugly
> > early include (required for an ifdef) can be avoided.  I don't
> > remember who pointed out this form to me (joerg@ or mrg@ I'd guess).
> > We have more forms like this in the tree, so not much.
> > 
> > Is this a recent regression?  Is that fallout from make rototill?  Are
> > other similar :? use cases broken too?
> 
> I think it is a new warning added with the make changes.  We must
> have more code like this in the tree.  I think it is a good practice
> (for consistency also) to have the bsd.init.mk included first, so
> that variables used by the rules are defined.



-uwe


Home | Main Index | Thread Index | Old Index