How do you generate file dependence when writing Makefile?

On further exploration, it appears I must retract my earlier statement that you can’t have a rule that produces multiple files. I don’t know if this is a new(er) capability or if I just missed it the last time I was trying to research it, but there is a section in the GNU Make manual: Multiple Targets (GNU make)

Particularly, you’ll want to look at the “Rules with Grouped Targets” which uses &: to separate the targets and dependencies. You’ll almost certainly still need a specific rule for each source file, making this a significant maintenance headache, but it’s apparently possible.

But, it being possible is good news for the desire to have fpm generate Makefiles.

Also, that means I owe @leetaylor an apology for dismissing his contribution. He is correct that it is possible. Sorry.

1 Like