help-make
[Top][All Lists]
Advanced

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

Re: "No targets" message with pattern rule


From: August Karlstrom
Subject: Re: "No targets" message with pattern rule
Date: Mon, 06 Feb 2006 04:31:31 +0100
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051013)

Nick Patavalis wrote:
On Sun, Feb 05, 2006 at 11:14:47PM +0100, August Karlstrom wrote:
.PHONY: main

main: $(wildcard *.suffix2)

I guess it is obvious why it doesn't work. The wildcard function
expands to a list of all the files ending in ".suffix2" present in the
current directory.

Yes, of course. I found out just after pressing the send button. <:(

What you described in your text, though, is correct: You need to make
a ".suffix2" file for every corresponding ".suffix1" file present in
the current directory. A possible solution is this:

  .PHONY: main
  main: $(patsubst %.suffix1,%.suffix2,$(wildcard *.suffix1))

Or, written in a more readable, though essentially identical, manner:

  s1list := $(wildcard *.suffix1)
  s2list := $(s1list:.suffix1=.suffix2)

  .PHONY: main
  main: $(s2list)

OK, thanks a lot for your help, Nick.


August




reply via email to

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