String equality and make

"Brian L. Troutwine" <[email protected]>
Newsgroups gmane.comp.gnu.utils
Message-ID <[email protected]>
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
questions.

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

        TYPE := `cat /tmp/bag_type`

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

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?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.