help-make
[Top][All Lists]
Advanced

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

Re: Recursive rules (Mike Gray)


From: Martin d'Anjou
Subject: Re: Recursive rules (Mike Gray)
Date: Fri, 17 Jan 2003 09:00:59 -0500 (EST)

> e.g.
> A/B/C/d.html is generated from A/B/C/txt/d.txt
> 
> I've been looking thru the documentation, but I can't find an obvoius way of 
> writing that dependancy (I'd prefer to have just one rule, since they all 
> follow the same pattern).

Use a pattern rule. You may want to experiment where you locate the 
makefile (i.e. along with the txt or along with the html).

%.html: txt/%.txt
        txt2html $*.txt

If you place the makefile way up, you'd have to do something like

A/B/C/%.html: A/B/C/txt/%.txt
        txt2html A/B/C/txt/$*.txt

(Note the line with txt2html starts with a <tab>).

The "%" means it will match any pattern as long as it ends with .html and
as long as it can find the same file in txt/ and ending with .txt

I found the following link useful when architecting my project makefile 
structure:
http://atlas.web.cern.ch/Atlas/GROUPS/SOFTWARE/DOCUMENTS/srt_html/c24702884.html

I found the book Managing Projects with make to be nearly completely 
useless as it does not explain how to manage projects bigger than a single 
compile.

Martin d'Anjou





reply via email to

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