"Maximus" <[EMAIL PROTECTED]> wrote: > I need to assign a variable which value is based on the operating system. It > looks like this (pseduo code): > > CMD_NAME = OS == WIN ? cmd.bat : cmd.sh > > How to write it in GNU make? I am a newbie here. Thanks!
I have the solution to your problem, but I don't have the file here at home, it is at work. If I remember right the Makefile looks something like this: OS = $(shell uname) ifeq ($OS,Linux) CMD_NAME = cmd.sh endif ifeq ($OS,MINGW) CMD_NAME = cmd.bat endif In mingw (msys) as well as cygwin you have access to the uname command. As you are using gnu make I guess that you are in one of those environments on Windows? If you don't have access to the uname command on Windows, maybe it would be possible to call ver instead. If I remember right I had to strip of some text from the $OS-variable in Windows, I think that both Cygwin and MINGW adds a lot of version information in the output from uname. regards Henrik -- The address in the header is only to prevent spam. My real address is: hc3(at)poolhem.se Examples of addresses which go to spammers: [EMAIL PROTECTED] [EMAIL PROTECTED]