Hi,
I have the following makefile snipped that does not work as expected:
OSVERSION=`uname -r`
OSPLATFORM=`uname -p`
#OSVERSION=9.0.0
#OSPLATFORM=ppc
ifeq ($(OSVERSION), 9.0.0)
. # should go here so I could
see the correctness of the detection.
OSNAME=Leopard
else
OSNAME=Panther
endif
But this does not work. I also have tried ´ instead of `.
I am using Mac OS X 10.5 (Leopard) and the XCode tools from the
orginal installation DVD.
Any ideas ?
Thanks
Lothar
Paul Russell - 21 Jul 2008 11:48 GMT
> Hi,
>
[quoted text clipped - 24 lines]
>
> Lothar
I get 9.4.0 for OS X 10.5.4.
Also note that you should not have a space after the comma in the ifeq test.
Paul
David Phillip Oster - 22 Jul 2008 06:42 GMT
> > Hi,
> >
[quoted text clipped - 30 lines]
>
> Paul
on my OS X 10.4.11, uname -v says:
Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007;
root:xnu-792.24.17~1/RELEASE_PPC
so, as expected, uname -r says:
8.11.0
Martin Knelleken - 22 Jul 2008 15:11 GMT
Lothar Behrens schrieb:
> Hi,
>
[quoted text clipped - 20 lines]
>
> Any ideas ?
You should use
ifeq ($(shell uname -r),9.0.0)
# ...
else
#...
endif
instead of the ` ` call.
And further I would prefer sw_vers (piped to grep) instead of
uname -r to detect the OS Version.
ifeq ($(shell sw_vers | grep 10.5),)
# for Leopard
else
# for Tiger or less
endif
And last but not least I would use arch instead if uname -p to detect
the architecture
ifeq ($(shell arch),i386)
# Intel stuff
else
# PowerPC
endif
Kind regards
Martin