bin/139601: make(1): variable substitution for $@ in dependency
source fails
FUCHIGAMI Masachika
masatic at mbs.sphere.ne.jp
Wed Oct 14 13:30:03 UTC 2009
>Number: 139601
>Category: bin
>Synopsis: make(1): variable substitution for $@ in dependency source fails
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Oct 14 13:30:02 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator: FUCHIGAMI Masachika
>Release: FreeBSD 7.0-RELEASE i386
>Organization:
>Environment:
FreeBSD inca 7.0-RELEASE FreeBSD 7.0-RELEASE #15: Tue Aug 25 08:58:13 JST 2009 root at inca:/usr/src/sys/i386/compile/INCA i386
>Description:
local variable substitution in dependency source fails when $@ is used in another variable name ( e.g. ${$(@)_SRC} ).
make(1) delayes load-time variable substitution for local variables by expanding local variables to itself ( $@ -> $@ ), but make(1) does not delay variables containing local variables.
>How-To-Repeat:
-- Makefile
foo=bar
foo: $($@).txt
--
% touch bar.txt
% make foo
make: don't know how to make .txt. Stop
>Fix:
*** var.c 2006-07-18 06:05:27.000000000 +0900
--- var.c 2009-10-14 21:43:55.000000000 +0900
***************
*** 1924,1929 ****
--- 1924,1937 ----
return (value);
}
}
+ if( vlen >=1 && strchr( vname, '$' ) != NULL ) {
+ value = emalloc( consumed + 1 );
+ strncpy(value, vp->input, consumed);
+ value[consumed] = '\0';
+
+ *freeResult = TRUE;
+ return (value);
+ }
*freeResult = FALSE;
return (vp->err ? var_Error : varNoError);
***************
*** 2019,2024 ****
--- 2027,2040 ----
return (value);
}
}
+ if( vlen >=1 && strchr( vname, '$' ) != NULL ) {
+ value = emalloc( consumed + 1 );
+ strncpy(value, vp->input, consumed);
+ value[consumed] = '\0';
+
+ *freeResult = TRUE;
+ return (value);
+ }
} else {
/*
* Check for D and F forms of local variables since we're in
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list