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.
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)