[buug] GNU make unexpected behavior - any experts here?

Ian Zimmerman itz at buug.org
Thu Jan 31 10:51:41 PST 2013


On Wed, 30 Jan 2013 13:35:53 -0800
"Michael Paoli" <Michael.Paoli at cal.berkeley.edu> wrote:

> minimal case reproducing the (presumed) bug or unexpected behavior?

#!/usr/bin/make -f
# -*- makefile-gmake -*-

define spit_foo =
cat foo
endef

all: do_foo
	cat bar

do_foo:
	$(spit_foo)

.PHONY: do_foo all

# expected:
# cat foo
# cat bar
# got instead:
# cat bar

> version & source (compiled from GNU or distribution's packaging)?

 [10+0]~$ dpkg --status make
Package: make
Status: install ok installed
Priority: optional
Section: devel
Installed-Size: 1145
Maintainer: Manoj Srivastava <srivasta at debian.org>
Architecture: amd64
Source: make-dfsg
Version: 3.81-8.2
Depends: libc6 (>= 2.3)
Suggests: make-doc
Description: An utility for Directing compilation.
 GNU Make is an utility which controls the generation of executables and
 other target files of a program from the program's source files. It
 determines automatically which pieces of a large program need to be
 (re)created, and issues the commands to (re)create them. Make is not
 limited to programs and executable, it can be applied to any task
 where a set of target files must be created based on a set of input
 files, based on dependency and processing rules. Indeed, Make is a
 general purpose dependency solver.
Homepage: http://www.gnu.org/software/make/

> What bit in the documentation does the behavior not match as expected?

Manual section 6.8, Defining Multi-Line Variables and 5.8, Defining
Canned Recipes

> Does GNU already have a "bug" filed on it (or it reported on
> applicable list, if/where proper bug tracking system doesn't exist)?
> And sometimes the bug "fix" is to match the documentation to the
> behavior.  8-O

Well, a search (on gmane) of bug-make at gnu.org for "multi-line variables"
doesn't match anything recent (like at least 8 years or so).

-- 
Ian Zimmerman
gpg public key: 1024D/C6FF61AD
fingerprint: 66DC D68F 5C1B 4D71 2EE5  BD03 8A00 786C C6FF 61AD
http://www.gravatar.com/avatar/c66875cda51109f76c6312f4d4743d1e.png
Rule 420: All persons more than eight miles high to leave the court.


More information about the buug mailing list