Or you could just use the autoconf stuff that is already there...

In configure.in:
--
AC_CANONICAL_HOST
case "${host}" in
        *-*-solaris*)   platform=SOLARIS ;;
        *-*-sysv5*)     platform=UNIXWARE ;;
        *-*-linux*)     platform=LINUX ;;
[etc...]
        *)              platform=UNKNOWN ;;
esac
AC_SUBST(platform)
AC_SUBST(osver)
--

Run autoconf and the produced "configure"-script will substitute all
@platform@ and @osver@ instances in the Makefile.in templates to
whatever the config.guess and the above case switch find out about the
platform.

Not that I am pushing autoconf here or anything. ;-)

Regards,
 Martin.
--
Martin Kalen
Software Engineer
TODAY Systems, Inc.
http://www.todaysystems.com.au/
Tel +61-3-9536 3900 - Fax +61-3-9536 3901

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 06, 2001 2:53 PM
Subject: Re: "uname" in makefile


> 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



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

Reply via email to