I'm trying to get GNU make to produce multiple outputs from a single input. The most simple example I can demonstrate is:
a b : test
cp $< $@
which, I believe, should copy the file test
to the files name a
and b
. However, it only makes the file a
, which seems to me to be contrary to the instructions listed here:
http://www.gnu.org/software/automake/manual/make/Multiple-Targets.html
Am I doing something wrong?
Thanks, Tom
If you run a rule that depends on a
, it will run your rule with $<
as test
and $@
as a
. If you run a rule that depends on b
, $@
will be b
instead. If you make a rule above your current rule like:
all: a b
It will run the rules for a
and b
, which is that same rule twice. Otherwise, if your rule is the first in the file it will run it with the first target only, which is a
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With