help-make
[Top][All Lists]
Advanced

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

RE: Impossible to do this in make :-(


From: Rakesh Sharma
Subject: RE: Impossible to do this in make :-(
Date: Wed, 12 Feb 2014 06:12:00 -0800

#                 |<--------------------------- subst 
-------------------------------------------->|
#                 |                                      |<-------------------- 
call --------------------------->|
#                 |                                                             
                 |<------- wordlist ------>|   ||
#                 |            |<---------->|                                   
                               |<------>|       |   ||
# $(if $1,\$$(subst $(firstword $1),$(call lowercase_internal,$(wordlist 
2,$(words $1),$1),$2)),$2)
#  |     |<----------------------- then 
-------------------------------------------------------------------------------|^
 |
#  |                                                                            
                                                                     |^ |
#  |                                                                            
                                                     else------->^


Hello Tim,
 
I find the flmtools to be a real delight to use in terms of encapusation 
capabilities of gnu make. it was almost an eye opener in make code/coding.
 
The use of recursive macros was feature unknown to me. I am not sure whether 
the GNU Make Manual talks about that. 
 
I had a query of the very basic kind in the use of recurisve macro 
lowercase_internal in the flmtools. A picure is shown above, which shows the 
extent of the vasious braces & funcctions used.
 
What I find perplexing here is the function of the left parenthesis just before 
the subst function. To me it is just a piece of text & not related to subst 
since at this point in time we are just building the gnu make command to be 
used later. Also equally confusing is the place of the ending parenthesis for 
this subst function. Since it's also a piece of text at this point in time, I 
should be able to change it to any thing. But, if I change the ) to something 
different, say a closing angular bracket > then I am getting an error.
 
So does that mean it is impossible to generate strings from gnu make which 
contain imbalanced ( ... ) pairs?
 
Hope I was clear in getting across my query. In case not, then you can just 
play with the ( before the subst & it's corresponding closing ) by chaniging it.
 
Thanks,
Rakesh Sharma

 
> Date: Wed, 5 Feb 2014 19:56:36 +0000
> Subject: Re: Impossible to do this in make :-(
> From: address@hidden
> To: address@hidden
> CC: address@hidden; address@hidden
> 
> https://bitbucket.org/tnmurphy/raptor/src/fbb2e624d320e5eabc0689105e2f2b80d131ca03/lib/flm/flmtools.mk?at=default
> 
> e.g.
> 
> $(call lowercase,ABCDEFGHIJKLMNOPQRSTUVWXYZ AA BB CC)
> 
> It's also a demonstration of how to make these various functions
> callable and eval-able.
> 
> This collection of macros proved useful but like the GMSL it's just a
> lot of hacks around the dreadful lack of exceedingly obviously
> required builtin functions.
> 
> The load directive in 4.0 is a godsend since it lets your write your
> own make functions in C and load them up.
> 
> Regards,
> 
> Tim
> 
> On 5 February 2014 19:03, Paul Smith <address@hidden> wrote:
> > On Wed, 2014-02-05 at 10:55 -0800, Rakesh Sharma wrote:
> >> Wanted to do a lowercase => uppercase conversion so wrote this (picked
> >> from stackoverflow)
> >>
> >> lc = $(subst a,A,$(subst b,B,$(subst c,C,.....,$(subst z,Z,$1))....)
> >>
> >> As is, the above works. But I wanted to bring in "eval" here to avoid
> >> typing this whole thing.😎
> >>
> >> But to my utter surprise & then dismay, I found it impossible to write
> >> the RHS in any manner amenable to be eval-ed.
> >
> > Go get GMSL and be amazed and gratified:
> >
> > http://gmsl.sourceforge.net/
> >
> >
> >
> > _______________________________________________
> > Help-make mailing list
> > address@hidden
> > https://lists.gnu.org/mailman/listinfo/help-make
> 
> 
> 
> -- 
> You could help some brave and decent people to have access to
> uncensored news by making a donation at:
> 
> http://www.thezimbabwean.co.uk/friends/
                                          

reply via email to

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