Rajesh,

Although I don't use it in the makefile, I do use it in a
wrapper script that I run to set up the development
environment for one of my projects. Of course, this could
be used in the makefile too, as part of a shell command.

You could create a dummy dependancy that is always run
before any real tasks, and the dependency runs the correct
shell statements to setup what ever you need.

Here's an example from a c-shell script. Once this has been
run, you can then make the correct platform-dependent choices.
It's also easy to add other platforms to the list.

Hope this helps a little,
--Carl
-------------------------------------------------------------------------------------------

set SYSTEM=`uname -s`
set CHIP=`uname -m`      # only used by Solaris at this time...

if (( ${SYSTEM} == "SunOS" ) && (( ${CHIP} == "sun4d" ) || ( ${CHIP} == "sun4u" ))) 
then
   setenv PLATFORM SUN
else if ( ${SYSTEM} == "AIX" ) then
   setenv PLATFORM AIX
else if ( ${SYSTEM} == "HP-UX" ) then
   setenv PLATFORM HPUX
else if ( ${SYSTEM} == "Linux" ) then
   setenv PLATFORM LINUX
else if ( ${SYSTEM} == "SunOS"  &&  ${CHIP} == "i86pc" ) then
   setenv PLATFORM X86
else
   setenv PLATFORM UNKNOWN
   printf "You are attempting to build on an unsupported platform!\n"
   exit
endif






"Rajesh Kommineni" <[EMAIL PROTECTED]> on 06/04/2001 02:50:04 PM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  "uname" in makefile


Hi all,
I am just curious whether using uname in makefile will make our life
easier.
I am trying to modify the makefile with "uname" so that it figures out
OS-type itself and correspondingly does platform specific things. Any
thoughts/comments?
rajesh
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]








---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to