tech-userlevel archive

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

Re: make: new modifyer :Y



 >> with a more elegant
 >> 
 >>   .if ${MKXXX:Y}
 >>   .endif

> If you're looking for brevity of Makefile expression, then I'm all for it.
> Unfortunately, the other side of the coin wrt brevity is comprehension,
> and I just don't see the merit of this change here.

One real life example.

pkgsrc/mk/check.check-interpreter.mk revision 1.23

     30 .if defined(PKG_DEVELOPER)
     31 CHECK_INTERPRETER?=             yes
     32 .else

Here PKG_DEVELOPER is defined/undefined boolean variables.
As I said bad@ "fixed" the problem in revision 1.24 Now the code looks
like

     30 .if defined(PKG_DEVELOPER) && ${PKG_DEVELOPER} != "no"
     31 CHECK_INTERPRETER?=             yes
     32 .else

There are two problems here:
1) too much code for so simple action! 54(!!!) characters for checking.
   Multiply 54 on a number of times PKG_DEVELOPER variable occurs in pkgsrc 
code.
2) check for PKG_DEVELOPER value is *case-sensitive*. Serious bug? No,
   just a side effect of the lack of functionality in our make.

Won't the following be better and easier?

     30 .if ${PKG_DEVELOPER:Y}
     31 CHECK_INTERPRETER?=             yes
     32 .else

:Y doesn't add new power to make(1). I'm able to use one trick or
another to workaround the problem. I propose to throw all such tricks
away and improve the language a little bit, not for a new power but for
better expressiveness and clearness.

> Regards,
> Alistair

-- 
Best regards, Aleksey Cheusov.


Home | Main Index | Thread Index | Old Index