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

1. cat Makefile
.PHONY : all
ifndef $(one)
         one := 1
endif
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)

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


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to