Bug 766076 - shell command assignment error
Summary: shell command assignment error
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: make
Version: 14
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Machata
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-09 23:39 UTC by Curtis Doty
Modified: 2015-05-05 01:36 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-12 11:05:05 UTC
Type: ---


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.