Are OS X installs specific to a machine type? When OS X is installed, does the installer:


write only generic files (that will work on any machine supported by that OS), or 
customise the installation to a specific machine type in any way?  (If so, presumably this is based on the machine that the installer is running on?)


In the past, I have assumed that the answer is "OS X installs are generic", and used various tricks based on that assumption.  But I've only ever done this in various temporary workarounds, because I don't really trust that assumption.

If I had a trustworthy (so preferably referenced) answer "OS X installs are generic", here are some examples of what I could do:


Boot a Mac Pro using the software on a MacBook Pro (ie laptop is in target disk mode, connected to desktop via FireWire, I hold down alt when booting the desktop and choose the laptop drive).
Run an installer on one machine, writing to a hard drive that I intend to install in a different machine.
Create an installation in a virtual machine (via VirtualBox etc), then write it to a standard volume for use in a physical machine, or vice-versa.
etc


To try and limit the question:


Considering Intel only: let's ignore older PPC hardware
Let's say this is about 10.8 onwards
Apple hardware only: I'm not asking about Hackintosh
I understand that some applications may be confused in various ways by a change in the underlying hardware environment, but I'm just wondering about the OS itself here.
Yes and no.

In regards to retail installation discs / upgrades "purchased" from the Mac App Store, no, they are typically not machine specific.  These are general builds that are meant to install on any supported hardware.

Machine specific builds DO exist although at this point of time they aren't an issue for most people.  When Macs shipped with physical restore media (multiple CDs/DVDs) that media was very specific to that particular generation/model of Mac.  What this meant was that you could have an early 2008 MacBook and an early 2008 MacBook Pro, the MacBook media would display an error when booting the MacBook Pro and vice versa.

In regards to the actual installed files, yes, these days the installations are pretty generic.  I don't want to say that the installed files on a MacBook Pro Retina are the exact same as those on a MacBook Air, but for the most part this will be true.  In the past (early/mid PowerPC days) there were some differences but even then you could usually use one Mac to boot another.  The main problem we used to run into was remotely installing Tiger or Leopard using a mix of Intel and PowerPC Macs.  In those situations it was best to use PowerPC to PowerPC or Intel to Intel.

The only time this may not hold true is if you're trying to boot a newer Mac using the disk of an older Mac that has an older (older than the system the newer Mac shipped with) system installed.  For instance, if a new iMac was released tomorrow and I tried to boot it using 10.9.1 installed on my MacBook Pro Retina there's a good chance that it wouldn't boot because the iMac requires 10.9.3 or above.