[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Evaluation of shell functions in recipes

From: Stefan Tauner
Subject: Evaluation of shell functions in recipes
Date: Sun, 14 Aug 2011 21:43:18 +0200


please keep our CC:s because we are not subscribed.
i have found a bug in our (flashrom.org) makefile which may be a bug in
make or its documentation.
attached is a small test case makefile.

the related documentation is

the problem is that the shell function runs before any other commands
(i.e. immediate).
the documentation of the shell function states:
"The commands run by calls to the shell function are run when the
function calls are expanded."
and from the "reading makefiles" section i would say that this should
be deferred i.e. the commands of the recipe should be evaluated
sequently. instead the shell functions are run first:
- 2 is written to the test file
- 4 is written to the test file (overwriting 2)
after that the normal execution starts.
this leads to the output (among other things) of "1 4 4 3 4".
the expected output is "1 <file not found> 2 3 4"

could someone please explain if the observed behavior is "right" and if
we just read the docs wrong, or if they *are* wrong.
Kind regards/Mit freundlichen Grüßen, Stefan Tauner

Attachment: makefile
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]