I need to process all files with a particular extension, and package up the results into a single archive. Is there a way to have make
do this?
For example suppose I need to take all the .w files and produce a .n file for each one with any vowels turned to periods, then tar
up the results. If I create a Makefile
as follows:
novowels.tar: %.n
tar cf $@ $^
%.n: %.w
sed -e "s/[aeiou]/./g" > $@ < $<
make
(unsurprisingly) returns the following if there are no .n files in the directory:
make: *** No rule to make target '%.n', needed by 'novowels.tar'. Stop.
I can call make the.n
and it'll create the file from the.w (assuming that exists), and if I then call make
it'll get included in the archive.
The question is: how (best) to have make
realise that there are a whole load of .w files that need converting to .n files in the first place?