summaryrefslogtreecommitdiff
path: root/read.c
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2013-09-22 12:13:28 -0400
committerPaul Smith <psmith@gnu.org>2013-09-22 17:10:35 -0400
commit0296e40fc73d88b33e78899f95ef7b6c1a957d06 (patch)
tree9d37ecd654330e2208421534e9d2d88896b779f9 /read.c
parentf69922b335df7c5879142f5732f481d4f52548c6 (diff)
downloadgunmake-0296e40fc73d88b33e78899f95ef7b6c1a957d06.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 a4ca72d..7f90b9b 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;