help-make
[Top][All Lists]
Advanced

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

doing a string comparison with an extra level of variable reference?


From: Robert P. J. Day
Subject: doing a string comparison with an extra level of variable reference?
Date: Fri, 28 Jan 2005 08:21:49 -0500 (EST)

  if i want to do a simple check for a non-empty string, i know i can
use (as the simplest variation):

  ifneq "${VAR}" ""

but i have the following simplified makefile:

  SUBDIRS = d1 d2 d3
  .PHONY: ${SUBDIRS}

  ${SUBDIRS}:
        @echo "My target is address@hidden"
        @echo "My makefile variable contains address@hidden"
  ifneq "address@hidden" ""
        @echo "Yup, that variable is set."
  endif

i want to call this with something like:

  $ make d2_MAKEFILE=d2make d2

and be able to test whether the corresponding variable is set within
the rule.

  what i get is:

-------
$ make d2_MAKEFILE=d2make d2
My target is d2.
My makefile variable contains d2make
-------

  so the "ifneq" doesn't give me the result i expect, and i assume
it's because of how "ifneq" does variable evaluation.  what's the
proper syntax for that kind of check?  thanks.

rday






reply via email to

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