Dear LazyWeb - FreeBSD makefiles
Mark Blackman
mark at blackmans.org
Thu Nov 19 21:46:28 GMT 2009
On 19 Nov 2009, at 15:55, Simon Wistow wrote:
> On Thu, Nov 19, 2009 at 11:24:59AM +0000, Mark Blackman said:
>> And that example unintentionally reversed the dependency order
>> as well as leaving out the 'do all such files' bit.
>>
>> It should have been '.pod.l' and needs a pseudo target like 'all'
>> to trigger the transformation rules.
>
> I was heartened at first because that was the direction I'd been heading
> in too except ... I've just tried every combination I can think of and
> it's still not working (although it's perfectly possible that I missed
> some out).
>
> *sigh*
The key is to generate the targets (foo|bar.man)
from the source names (foo|bar.pod), and then have the pseudo-target
all depend on those generated targets as below.
-------------- SNIP -----------------------
.SUFFIXES : .pod .man
PODSRC!=echo *.pod
MANPAGES=$(PODSRC:S/.pod$/.man/)
.pod.man :
echo transform $< to $@
all : $(MANPAGES)
-------------- SNIP -----------------------
Your requirement is slightly more complex because you
want a variety of suffixes (corresponding to man page sections).
So you'll want to find a way to deal with that requirement
using some kind of further substitution, probably a second step
that renames .X.man to .X
- Mark
More information about the london.pm
mailing list