[Top][All Lists]

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

String equality and make

From: Brian L. Troutwine
Subject: String equality and make
Date: Thu, 02 Aug 2007 07:47:46 -0700
User-agent: KNode/0.10.4

I'm relatively new to make and am having difficulty with string equality.
Browsing through this newgroup it seems that such questions are not
uncommon. I apologize for having to ask a slight variation of a repeated

I've a make file very much like the following: 

        TYPE := `cat /tmp/bag_type`

        .PHONY: default
        ifeq (foo,$(strip $(TYPE)))
                @echo "You win a whole bag of $(TYPE)!"
                @echo "Nope, no $(TYPE) for you."

If /tmp/bag_type does not contain `foo' the Makefile prints out the second
echo, a behavior I very much expected. However, if /tmp/bag_type does
contain `foo' the latter string is still echoed out. I do not understand
why. From the understanding of make I've gleaned from the make manual TYPE
should be set during the first phase of reading and, assuming it is set to
`foo', the ifeq branch evaluated as true. Upon the second read phase the
first @echo should, thus, be evaluated.

I am obviously confused, but how and where?

reply via email to

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