[Top][All Lists]

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

Re: conditional statements

From: Oleksandr Gavenko
Subject: Re: conditional statements
Date: Thu, 29 Apr 2010 16:11:20 +0300
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20100317 Thunderbird/3.0.4

On 2010.04.29 12:55, Payal wrote:
Need some help in understaning below, please.

1. cat Makefile
.PHONY : all
ifndef $(one)
         one := 1
all :
         @echo $(one)

$ make

Why does it not print 1?

Don't know, I got "1" and always use ifndef pattern in my Makefiles.

2. I am unable to find a real simple example for understanding of $(if ...).
Can someone please give one?

I use $(if ...) in such case:

cmd ... | tee .log

save output into log. To control when use loggin I define:

LOG_CMD = $(if $(VERBOUSE), | tee $(LOG))

and in command wrote:

a: b
    cmd -o $@ $< $(LOG_CMD)

С уважением, Александр Гавенко.

reply via email to

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