Torsten Mohr wrote:
In a portable Makefile i have to set that command conditionally,
depending on the OS, which leads to the problem to determine
the underlying OS.  Is there a bullet-proof way to determine
it?  Environment variables could be set not properly or also
not at all set.  Also, i can't set it for every command.

If you are on a *nix of some sort (including CYGWIN on Windows) then uname will be able to give you a string representing the OS. I wrote an article for Dr Dobbs on cross-platform Make a while ago and you can find it on this web page http://www.electric-cloud.com/resources/.

Essentially if you get the output of uname via $(shell) in a variable then you can set things conditionally based on the OS.

John.
--
John Graham-Cumming
[EMAIL PROTECTED]

Home: http://www.jgc.org/
POPFile: http://getpopfile.org/

Sign up for my Spam and Anti-spam Newsletter
at http://www.jgc.org/


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to