summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/make/compat.c11
-rw-r--r--usr.bin/make/compat.h9
-rw-r--r--usr.bin/make/main.c4
-rw-r--r--usr.bin/make/make.c5
4 files changed, 18 insertions, 11 deletions
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c
index 389dd064050..e96d0f1fafa 100644
--- a/usr.bin/make/compat.c
+++ b/usr.bin/make/compat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: compat.c,v 1.88 2019/12/21 15:29:25 espie Exp $ */
+/* $OpenBSD: compat.c,v 1.89 2020/01/08 14:09:29 espie Exp $ */
/* $NetBSD: compat.c,v 1.14 1996/11/06 17:59:01 christos Exp $ */
/*
@@ -266,11 +266,12 @@ CompatMake(void *gnp, /* The node to make */
}
}
-void
+bool
Compat_Run(Lst targs) /* List of target nodes to re-create */
{
GNode *gn = NULL; /* Current root target */
int errors; /* Number of targets not built due to errors */
+ bool out_of_date = false;
/* For each entry in the list of targets to create, call CompatMake on
* it to create the thing. CompatMake will leave the 'built_status'
@@ -291,11 +292,15 @@ Compat_Run(Lst targs) /* List of target nodes to re-create */
else if (gn->built_status == ABORTED) {
printf("`%s' not remade because of errors.\n",
gn->name);
+ out_of_date = true;
errors++;
+ } else {
+ out_of_date = true;
}
}
/* If the user has defined a .END target, run its commands. */
- if (errors == 0)
+ if (errors == 0 && !queryFlag)
run_gnode(end_node);
+ return out_of_date;
}
diff --git a/usr.bin/make/compat.h b/usr.bin/make/compat.h
index fbdd66f2a94..f027e7ba9c7 100644
--- a/usr.bin/make/compat.h
+++ b/usr.bin/make/compat.h
@@ -1,6 +1,6 @@
#ifndef COMPAT_H
#define COMPAT_H
-/* $OpenBSD: compat.h,v 1.3 2010/07/19 19:46:43 espie Exp $ */
+/* $OpenBSD: compat.h,v 1.4 2020/01/08 14:09:29 espie Exp $ */
/*
* Copyright (c) 2001 Marc Espie.
@@ -35,8 +35,9 @@
* - friendly variable substitution.
*/
-/* Compat_Run(to_create);
- * Run the actual make engine, to create targets that need to. */
-extern void Compat_Run(Lst);
+/* out_of_date = Compat_Run(to_create);
+ * Run the actual make engine, to create targets that need to,
+ * return true if any target is out of date. */
+extern bool Compat_Run(Lst);
#endif
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index 2eef3a2a040..4d8a038ef43 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.123 2019/04/22 18:32:09 espie Exp $ */
+/* $OpenBSD: main.c,v 1.124 2020/01/08 14:09:29 espie Exp $ */
/* $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $ */
/*
@@ -804,7 +804,7 @@ main(int argc, char **argv)
if (compatMake)
/* Compat_Init will take care of creating all the
* targets as well as initializing the module. */
- Compat_Run(&targs);
+ outOfDate = Compat_Run(&targs);
else {
/* Traverse the graph, checking on all the targets. */
outOfDate = Make_Run(&targs);
diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c
index 02e048ac056..a1788ee6ac1 100644
--- a/usr.bin/make/make.c
+++ b/usr.bin/make/make.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: make.c,v 1.76 2019/12/21 15:31:54 espie Exp $ */
+/* $OpenBSD: make.c,v 1.77 2020/01/08 14:09:29 espie Exp $ */
/* $NetBSD: make.c,v 1.10 1996/11/06 17:59:15 christos Exp $ */
/*
@@ -572,7 +572,8 @@ Make_Run(Lst targs) /* the initial list of targets */
(void)MakeStartJobs();
}
- problem = Job_Finish();
+ if (!queryFlag)
+ problem = Job_Finish();
/*
* Print the final status of each target. E.g. if it wasn't made