24

How do I write a rule to generate set of files using a single action.

Example: Files x, y, z are generated as a result of single execution of script t.sh which takes file a as input.

x y z: a
    t.sh $@

GNU make tries to execute t.sh 3 times.

shoban
  • 650
  • 1
  • 9
  • 14

1 Answers1

14

You could implement one of the solutions specified in the automake manual.

Because you've tagged this gnumake, I should also point out that using a GNU make pattern rule (the ones with %) with multiple targets WILL consider both generated from one execution of the rule: see the GNU make manual.

Jack Kelly
  • 18,264
  • 2
  • 56
  • 81