Subject: kern/1296: Makefile.inc for lib{kern,compat} uses " for passing variables to sub-make
To: None <netbsd-gnats@wizardz.com>
From: Daniel Hagerty <hag@wizardz.com>
List: netbsd-bugs
Date: 07/29/1995 22:11:57
>Number:         1296
>Category:       kern
>Synopsis:       Makefile.inc for lib{kern,compat} uses " for passing variables to sub-make
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 30 15:35:01 1995
>Last-Modified:
>Originator:     Daniel Hagerty
>Organization:
	
>Release:        gnats-3.2
>Environment:
    	
System: NetBSD zardoz.wizardz.com 1.0A NetBSD 1.0A (ZARDOZ) #27: Fri Jul 28 14:05:16 EDT 1995 hag@zardoz.wizardz.com:/src/netbsd/sys/arch/i386/compile/ZARDOZ i386


>Description:
	Makefile.inc for lib{kern,compat} uses double quotes (") to
quote variables passed to the submake. This means that quoted
variables in the IDENT variable of the kernel makefile get expanded by
the shell, and any quoted variable with a space in it expands into
targets for the sub-make.

>How-To-Repeat:
Given:
IDENT=-DFOO="variable with a space" -DBAR=$$SHELL
in the kernel Makefile, attempting to make libkern.a results in
results in the following make command being run
make -f <file> CC="-DFOO="variable with a space" -DBAR="$SHELL" "
which expands to
make -f <file> CC="-DFOO=variable with a space -DBAR=/bin/sh"
and outputs

This is clearly the wrong thing.
>Fix:
	In the Makefile.inc for libkern and libcompat, pass
sub-variables with single quotes.

>Audit-Trail:
>Unformatted: