help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie question - testing for OS. . .


From: Ken Smith
Subject: Re: Newbie question - testing for OS. . .
Date: Wed, 20 Dec 2006 18:18:27 -0800

On 12/20/06, bC <address@hidden> wrote:
Thanks for the prompt replies, everyone.
  Are you always this way, or was I just lucky?   ;-)

You were lucky :)

####################
test:

   osver := $(shell uname -r)
  #osname := $(shell uname -s)
  #cpuarch := $(shell uname -m)
  #youname := $(shell uname -o)
  ifeq ($(osver),2.6.15-1.2054_FC5)
      unzip ksh.zip
  else
      unzip ksh2.zip
  endif
###################

Try one of these.  Replace the <TAB>s with real tab characters.  Both
of these approaches will work equally well.  For some reason, I always
tend to use the $(if) function rather than the ifeq construct but
different strokes for different folks.

osver := $(shell uname -r)

.PHONY: test
test:
                <TAB>$(if $(filter $(osver),2.6.15-1.2054_FC5), \
  echo unzip ksh.zip, \
  echo unzip ksh2.zip \
 )

.PHONY:test2
ifeq ($(osver),2.6.15-1.2054_FC5)
test2:
<TAB>echo unzip ksh.zip
else
test2:
<TAB>echo unzip ksh2.zip
endif




reply via email to

[Prev in Thread] Current Thread [Next in Thread]