One way we are trying to achieve this in GRUB 2 is, by using nested projects feature. In grub 2 some parts needs to be compiled using HOST_CC and others using TARGET_CC. All sources that need TARGET_CC are moved into a sub-directory and we a separate configure.ac file for them. Top-level directory's configure.ac uses AC_CONFIG_SUBDIRS macro to invoke the sub-directories' configure.
I too found that subdir-objects option didn't work when a source is shared by two Makefile.am files, but I could get around this by setting DEPDIR to an unique name in every Makefile.am. -- bvk.chaitanya
