[Top][All Lists]

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

Re: ifeq and $HOSTNAME

From: Paul Smith
Subject: Re: ifeq and $HOSTNAME
Date: Tue, 22 Sep 2009 15:50:57 -0400

On Tue, 2009-09-22 at 21:23 +0200, jody wrote:

> # 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_LFLAGS=-lWand -lMagick
> endif
> But no matter what the value of $HOSTNAME is, always the else-branch
> is traversed.

You must not have the value of HOSTNAME that you expect.

How is HOSTNAME getting set?  Are you setting in the makefile, or
inheriting it through your environment?

This worked as expected for me:

        $ cat Makefile
        $(warning HOSTNAME is $(HOSTNAME))
        ifeq "$(HOSTNAME)" "$(sc)"
        $(warning is $(sc))
        $(warning is not $(sc))
        all: ; @echo done
        $ HOSTNAME=notlocal make
        Makefile:3: HOSTNAME is notlocal
        Makefile:8: is not localhost
        $ HOSTNAME=local make
        Makefile:3: HOSTNAME is local
        Makefile:8: is not localhost

Maybe you can try something similar and report what HOSTNAME was set to
for you?

reply via email to

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