summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2013-09-22 17:10:35 -0400
committerPaul Smith <psmith@gnu.org>2013-09-22 17:10:35 -0400
commit1a1624b03ebf0f520758d670545e97867ff1a799 (patch)
tree9d37ecd654330e2208421534e9d2d88896b779f9 /read.c
parent6f64c399845d6187cf0bf2b6486e1089ebd239a4 (diff)
downloadmake-1a1624b03ebf0f520758d670545e97867ff1a799.tar.gz
Allow loaded objects to opt out of the "auto-rebuild" feature.
Diffstat (limited to 'read.c')
-rw-r--r--read.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/read.c b/read.c
index a4ca72d6..7f90b9b9 100644
--- a/read.c
+++ b/read.c
@@ -947,19 +947,27 @@ eval (struct ebuffer *ebuf, int set_default)
PARSEFS_NOAR);
free (p);
- /* Load each file and add it to the list "to be rebuilt". */
+ /* Load each file. */
while (files != 0)
{
struct nameseq *next = files->next;
const char *name = files->name;
struct dep *deps;
+ int r;
+
+ /* Load the file. 0 means failure. */
+ r = load_file (&ebuf->floc, &name, noerror);
+ if (! r && ! noerror)
+ fatal (&ebuf->floc, _("%s: failed to load"), name);
free_ns (files);
files = next;
- if (! load_file (&ebuf->floc, &name, noerror) && ! noerror)
- fatal (&ebuf->floc, _("%s: failed to load"), name);
+ /* Return of -1 means a special load: don't rebuild it. */
+ if (r == -1)
+ continue;
+ /* It succeeded, so add it to the list "to be rebuilt". */
deps = alloc_dep ();
deps->next = read_files;
read_files = deps;