I disagree with the characterization that this is "not very hard" (and my initial assessment was "questionable incantations" which I think is also accurate):
https://www.gnu.org/software/automake/manual/html_node/Multi...
Definitely not handled "simple and well" as posited by the OP.