help-make
[Top][All Lists]
Advanced

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

Re: GNU Make feature request, pattern matching


From: Paul Smith
Subject: Re: GNU Make feature request, pattern matching
Date: Tue, 30 Sep 2008 15:08:18 -0400

On Tue, 2008-09-30 at 19:42 +0100, Noah Slater wrote:
> my idea was that they could configure the build process by
> exporting variables based on pattern rules like this:
> 
>   dir/dir/index.html: author = jim bob
> 
> When trying to create a set of rules for the distributed makefiles I
> initially
> had the software changing into the output directory to doing something
> similar to this:
> 
>   %.html: $(src)/%.txt
>       $(info example making html from txt)
> 
> The idea being that this would match the following:
> 
>   dir/dir/index.html: $(src)/dir/dir/index.txt


Have you considered using VPATH?  It looks to me (based on this example;
I didn't try to get the tarball) that you have a good fit for it here.
Try rewriting your rule like this:

        VPATH := $(src)

        %.html: %.txt
                $(info example making $@ from $<)

and see if that works.






reply via email to

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