Hi,
This patch (to be applied after the previous one) collects identical Makefile fragments to common files.
Known bugs: Cross compiling should be detected automatically. I should also revert the rules.xml change in the previous patch to avoid one extra link for each target.