But to be correct, yes, makefiles
are OS-dependant. Which is why people find them such a pain.
They are most typical of *nix environments, and to help manage complexity between those environments, are often managed with the
automake and
autoconf tools, which will build you scary-looking makefiles that make sure your project compiles properly on any flavor of *nix (including OSX).
Outside of nixen (typically meaning on Windows), you need another set of makefiles, or you require your users to use a *nix emulation layer, like Cygwin or MinGW, which can mitigate most (but not all) of the difficulties in OS architecture. (For
compiling. It does nothing for your code unless you specifically design the makefiles to handle the platform-specific branches in your source code, as needed.)
Many efforts to make a better make exist, all with varying degress of success, but make is so entrenched that you will always have it available. (Correct me if I'm wrong, but I don't think there are very many systems left where gmake is not available over the [inferior] system makes.)
Some of the more popular make replacements are CMake, Scons, and Jam.
(Here, I figured I'd google just in case I missed anything. Here's some good reading:
http://freecode.com/articles/make-alternatives)
Yes, it's a mess.