Sharing makefiles between UNIX or Linux and Windows

You can share makefiles between UNIX, Linux, and Windows.

clearmake is available on UNIX, Linux, and Windows. In principle, you can write portable makefiles, but in practice, the obstacles are substantial. The variations in tool and argument names between systems make writing portable build scripts particularly challenging. If you choose to pursue portable makefiles, use the following general procedures to produce usable results.

  • Start on UNIX or Linux; avoid most compatibility modes: On Windows, clearmake supports Gnu compatibility mode but does not support others (for example, Sun compatibility mode). Instead, it supports basic make syntax. To write or tailor transportable makefiles, begin makefile development on UNIX or Linux, without compatibility modes other than Gnu in effect. Gnu generates errors and warnings for problematic syntax. When things work cleanly on UNIX or Linux, move your makefiles to Windows for testing.
  • Use a makefile-generating utility, such as imake, to generate makefiles: Use imake or some other utility to generate the makefiles you will need, including clearmake makefiles for Windows.