help-make
[Top][All Lists]
Advanced

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

ifeq and $HOSTNAME


From: jody
Subject: ifeq and $HOSTNAME
Date: Tue, 22 Sep 2009 21:23:20 +0200

Hi
I've read about the ifeq command in my GNU make book and on the GNU
make web site,
but i don't get it to work according to my wishes.

What i want to do is assign different values to a make variable,
depending on what the host name is. In particular, when the host name
is "localhost" then the variables MAGIC_CFLAGS and MAGIC_LFLAGS are to be set
using the MagickWand-config utility.Here's what i do:

# set the name of the special case
sc=localhost
# if its the special case use MagickWand-config
ifeq "$(HOSTNAME)" "$(sc)"
  MAGIC_CFLAGS=`MagickWand-config --cflags --cppflags`
  MAGIC_LFLAGS=`MagickWand-config --ldflags --libs`
else
  MAGIC_CFLAGS=
  MAGIC_LFLAGS=-lWand -lMagick
endif

But no matter what the value of $HOSTNAME is, always the else-branch
is traversed.
I've also tried
  ifeq "HOSTNAME" "sc"
but this didn't change anything.

Can someone please explain where i have gone wrong and how i could get
the desired behaviour?
Thank You
  Jody




reply via email to

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