A cross-platform support middleware (CPSM) is a software abstraction layer that guarantees the existence, and correct implementation, of a set of services on top a set of platforms.
The most commonly used abstraction methods in CPSM development are: conditional compilation and directory separation of sources.
The second method takes advantage of the filesystem organization to divide the source code in different folders, one for each incompatible platform.
Some distributions like MSYS and Cygwin may help build the cross-platform code in a Unix-like environment even on Microsoft Windows.
Both distributions provide a decent version of GNU Make that can direct the build process in a cross-platform fashion.