Suppose that I use the following rule pattern a lot in my makefile,
where <filename> has to be the same in each block of the three rules.
<some1> <some2> ... <some_n> can be any files.
all: <filename>.RData
clean: <filename>.RData
$(RM) $^
<filename>.RData: <filename>.R <some1> <some2> ... <some_n>
Rscript $<
For example, I might have a makefile that has the following rules.
Since the 3-rule pattern appears multiple times. I'm wondering if
there is a way to define a new rule that capture the thre rules so
that I can write my makefile simpler.
all: xxx.RData
clean: xxx.RData
$(RM) $^
xxx.RData: xxx.R a.txt b.txt
Rscript $<
all: uuu.RData
clean: uuu.RData
$(RM) $^
uuu.RData: uuu.R x.txt y.txt z.txt
Rscript $<
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make