help-make
[Top][All Lists]
Advanced

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

Re: simple pattern rules


From: Stephan Beal
Subject: Re: simple pattern rules
Date: Wed, 7 Apr 2010 10:23:13 +0200

On Wed, Apr 7, 2010 at 9:47 AM, Payal <address@hidden> wrote:
2 questions on this,
1. Why does this not work?
all : $(wildcard *.cdb)

That can only work if the .cdb files already exist. Wildcard does not generate strings for non-existent files. To do that you could use:

all: $(patsubst %,%.cdb, a b)

or, assuming all of your input files already exist:

all: $(patsubst %.tcp, %.cdb, $(wildcard *.tcp))


2. How can I avoid listing explicitly?
a.cdb :
b.cdb :

You can also pass them on the command line:

   make a.cdb

but of course that's annoying.

Your makefile must SOMEHOW get the list. Whether you specify it on the command line or via $(patsubst) or something else is up to you.

--
----- stephan beal
http://wanderinghorse.net/home/stephan/

reply via email to

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