help-make
[Top][All Lists]
Advanced

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

Re: Simulating multiple wildcards in a match using .SECONDEXPANSION?


From: Michael R. Head
Subject: Re: Simulating multiple wildcards in a match using .SECONDEXPANSION?
Date: Mon, 06 Apr 2009 12:16:56 -0400

On Mon, 2009-04-06 at 14:15 +0200, Danny Boelens wrote:
> Michael R. Head wrote:
> > I'd like to make a rule that generates a output file for each pair in
> > the cross product of two lists of input files. I have a simple makefile
> > that does what I want, but it's ugly. 
> > 
> > I'm wondering if anyone has any suggestions on improving it. At a
> > minimum, I'd like to get rid of the foreachs in the targets.
> 
> You can do that because you know how you constructed the cross product 
> targets. In your case: if you replace the underscore ('_') with a space 
> (' '), the cross product target falls apart into its components again:

True. But spaces in filenames are evil!

> But looking at your original problem description, I think I'd use 
> another approach to solve it. One using a define as 'rule template', 
> because it's a bit easier to read and understand in my opinion - but 
> that might be just me. Something like this (untested):

Ah! I didn't know about rule templates. That is definitely much nicer,
and something I will have to incorporate into my Make repertoire.

> Hope this helps,
> Danny

thanks,
mike

-- 
Michael R. Head <address@hidden>
http://www.cs.binghamton.edu/~mike/

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

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