[Top][All Lists]

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

Re: simple pattern rules

From: Greg Chicares
Subject: Re: simple pattern rules
Date: Tue, 06 Apr 2010 13:00:43 +0000
User-agent: Thunderbird (Windows/20100228)

On 2010-04-06 12:20Z, Payal wrote:
> I have many files like a.tcp, b.tcp ... To compile each one I have
> individual rules like,
> a.cdb : a.tcp
>       tcprules $@ a.tcp.tmp < $^
> b.cdb : b.tcp
>       tcprules $@ b.tcp.tmp < $^
> ......
> My question is how to write one general rule, so that if any of .tcp
> file change, the respective cdb file should be rebuild.

Add a target that depends on everything that needs to be kept current,
and use a pattern rule to indicate how to build whatever isn't current:

# What to build (if outdated).
.PHONY: all
all: a.tcp b.tcp

# How to build it (if necessary).
%.cdb : %.tcp
        tcprules $@ $*.tcp.tmp < $^

reply via email to

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