Subject: Re: bug in handling of != in make?
To: None <tech-userlevel@NetBSD.org>
From: Roland Illig <rillig@NetBSD.org>
List: tech-userlevel
Date: 06/09/2006 08:53:21
Klaus Heinz wrote:
> Hi,
> 
> given a file test.txt containing the line
> 
>   $NetBSD$
> 
> and the Makefile
> 
> ----------------
>   VERSION!= sed -ne 's/^.*\(\$$NetBSD.*\$$\).*$$/\1/p' test.txt > /tmp/sed.txt; cat /tmp/sed.txt
> 
>   all:
> 	@echo '${VERSION}'
> 	@cat /tmp/sed.txt
> ----------------

VERSION_cmd=    echo '$$NetBSD$$'
VERSION=        ${VERSION_cmd:sh}

all:
         echo ${VERSION:Q}

This is the BSD Make equivalent to using $(shell echo '$$NetBSD$$') in 
GNU Make. They both do not further expand '$' characters from the output.

The question whether someone might rely on the current behaviour of the 
!= operator to mangle the output remains valid though.

Roland