Bug 766076

Summary: shell command assignment error
Product: [Fedora] Fedora Reporter: Curtis Doty <curtis>
Component: makeAssignee: Petr Machata <pmachata>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 14CC: mnewsome, pmachata
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-12 11:05:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Curtis Doty 2011-12-09 23:39:39 UTC
A simple Makefile:
WTF != pwd

Generates this error:
Makefile:1: *** missing separator.  Stop.

GNU make appears to be wrongly interpreting WTF as a target name instead of as a variable name. This appears to be a portability issue as it apparently works with FreeBSD make.

Workaround:
WTF!= pwd

Comment 1 Curtis Doty 2011-12-09 23:43:16 UTC
It looks like I last used that Makefile on Fedora 13. It didn't error back then.

Comment 2 Petr Machata 2011-12-12 11:05:05 UTC
This never worked, shell assignment was never supported in GNU make that I know of.  It's just semi-properly reported now.  What happened on F13 was that make would assume that "WTF !" was wariable name.  With the workaround, it just assumes that "WTF!" is a variable name.

(The following is make from F13.)

$ ./make -f /dev/stdin <<EOF
XXX != pwd
all:; echo .\$(XXX).
EOF
echo ..
..
$ ./make -f /dev/stdin <<EOF
XXX != pwd
all:; echo .\$(XXX !).
EOF

echo .pwd.
.pwd.

(And now with the work-around and a recent make.)

$ make -f /dev/stdin <<EOF
XXX!= pwd
all:; echo .\$(XXX).
EOF

echo ..
..

$ make -f /dev/stdin <<EOF
XXX!= pwd
all:; echo .\$(XXX!).
EOF

echo .pwd.
.pwd.