Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Oct 2002 09:45:16 +0200
From:      Mikhail Teterin <mi+celsius@aldan.algebra.com>
To:        Juli Mallett <jmallett@FreeBSD.org>, freebsd-bugs@FreeBSD.org
Subject:   Re: bin/31339: make's .if processing buggy
Message-ID:  <200210240945.16940.mi%2Bcelsius@aldan.algebra.com>
In-Reply-To: <200210240018.g9O0INVs066713@freefall.freebsd.org>
References:  <200210240018.g9O0INVs066713@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 24 October 2002 02:18 am, Juli Mallett wrote:

= Can the submitter verify general string compare support in NetBSD make(1)
= or similar?  We specifically don't support LHS being a bareword in string
= compares, it's been documented in comments in Makefiles that I've seen
= dating to the late 1980s...

I see. Well, I imagine that's Ok, since one should not need to compare two 
constants anyway. I only mentioned it, because I first discovered the second 
case:

	.if $o != a

not working if o is not defined...

= But if you can provide an example in a BSD make(1) implementation of
= this not working as it does, I'll do my best to merge in the required
= changes.

OpenBSD's make will not (easily) build on FreeBSD, but the NetBSD's builds and 
exhibits the same problem. Once again, my complaint is the inconsistency in 
the treatment of not defined variables -- the make(1)'s general philosofy is, 
they are always defined as empty. In the handling of .if, however, the 
treatment is different -- if a variable in the expression is not defined, it 
causes an error instead of automaticly defining it as an empty string... The 
workaround is to wrap each such potentially dangerous block in the 
!defined():

all:
.if !defined(o) || $o != a
        @echo "not equal"
.else
        @echo "equal"
.endif

	-mi

	-mi

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210240945.16940.mi%2Bcelsius>