August Karlstrom wrote:
OK I see. So what should I add to the makefile to tell make to create a
.suffix2 file for each .suffix1 file? I have tried the following but it
doesn't seem to work:
.PHONY: main
main: $(wildcard *.suffix2)
%.suffix2: %.suffix1
cp $< $@
That's because $(wildcard *.suffix2) ends up being an empty list and
hence the Makefile is equivalent to:
.PHONY: main
main:
%.suffix2: %.suffix1
cp $< $@
(i.e. because there are currently no .suffix2 files there are no prereqs
to main). You can solve this in a couple of ways. The simplest is to
take the output of the $(wildcard) and change the suffix on every file:
.PHONY: main
main: $(subst .suffix2,.suffix1,$(wilcard *.suffix2))
%.suffix2: %.suffix1
cp $< $@
John.
--
John Graham-Cumming
[EMAIL PROTECTED]
Home: http://www.jgc.org/
Blog: http://www.jgc.org/blog/
POPFile: http://getpopfile.org/
GNU Make Standard Library: http://gmsl.sf.net/
GNU Make Debugger: http://gmd.sf.net/
Fast, Parallel Builds: http://www.electric-cloud.com/
Sign up for my Spam and Anti-spam Newsletter
at http://www.jgc.org/
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make