summaryrefslogtreecommitdiff
path: root/usr.bin/make
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-11-10 12:51:41 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-11-10 12:51:41 +0000
commit3e34efc03a6ecf96d66e3a2a3ddbca98634e59ba (patch)
treef45dc6156c1d74a79013f39bac5ce336e2b79d09 /usr.bin/make
parent07f3d5d8f6d929c17a675b8013993aec0a099a5f (diff)
rename make -> must_make, made -> built_status
to make them easier to find in source files.
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/arch.c6
-rw-r--r--usr.bin/make/compat.c50
-rw-r--r--usr.bin/make/engine.c16
-rw-r--r--usr.bin/make/gnode.h8
-rw-r--r--usr.bin/make/job.c6
-rw-r--r--usr.bin/make/make.c35
-rw-r--r--usr.bin/make/targ.c25
7 files changed, 75 insertions, 71 deletions
diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c
index ecd054b68b6..70661376d8f 100644
--- a/usr.bin/make/arch.c
+++ b/usr.bin/make/arch.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: arch.c,v 1.73 2007/11/03 15:30:04 deraadt Exp $ */
+/* $OpenBSD: arch.c,v 1.74 2007/11/10 12:51:40 espie Exp $ */
/* $NetBSD: arch.c,v 1.17 1996/11/06 17:58:59 christos Exp $ */
/*
@@ -922,11 +922,11 @@ Arch_MemMTime(GNode *gn)
} else
nameEnd = NULL;
- if (pgn->make && nameEnd != NULL &&
+ if (pgn->must_make && nameEnd != NULL &&
strncmp(nameStart, gn->name, nameEnd - nameStart)
== 0 && gn->name[nameEnd-nameStart] == '\0')
gn->mtime = Arch_MTime(pgn);
- } else if (pgn->make) {
+ } else if (pgn->must_make) {
/* Something which isn't a library depends on the
* existence of this target, so it needs to exist. */
ts_set_out_of_date(gn->mtime);
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c
index 8d51afe9f61..3fbeef302db 100644
--- a/usr.bin/make/compat.c
+++ b/usr.bin/make/compat.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: compat.c,v 1.66 2007/11/06 21:12:23 espie Exp $ */
+/* $OpenBSD: compat.c,v 1.67 2007/11/10 12:51:40 espie Exp $ */
/* $NetBSD: compat.c,v 1.14 1996/11/06 17:59:01 christos Exp $ */
/*
@@ -76,26 +76,26 @@ CompatMake(void *gnp, /* The node to make */
if (pgn->type & OP_MADE) {
(void)Dir_MTime(gn);
- gn->made = UPTODATE;
+ gn->built_status = UPTODATE;
}
if (gn->type & OP_USE) {
Make_HandleUse(gn, pgn);
- } else if (gn->made == UNMADE) {
+ } else if (gn->built_status == UNMADE) {
/* First mark ourselves to be made, then apply whatever
* transformations the suffix module thinks are necessary.
* Once that's done, we can descend and make all our children.
* If any of them has an error but the -k flag was given,
- * our 'make' field will be set false again. This is our
+ * our 'must_make' field will be set false again. This is our
* signal to not attempt to do anything but abort our
* parent as well. */
- gn->make = true;
- gn->made = BEINGMADE;
+ gn->must_make = true;
+ gn->built_status = BEINGMADE;
Suff_FindDeps(gn);
Lst_ForEach(&gn->children, CompatMake, gn);
- if (!gn->make) {
- gn->made = ABORTED;
- pgn->make = false;
+ if (!gn->must_make) {
+ gn->built_status = ABORTED;
+ pgn->must_make = false;
return;
}
@@ -106,7 +106,7 @@ CompatMake(void *gnp, /* The node to make */
if (DEBUG(MAKE))
printf("Examining %s...", gn->name);
if (!Make_OODate(gn)) {
- gn->made = UPTODATE;
+ gn->built_status = UPTODATE;
if (DEBUG(MAKE))
printf("up-to-date.\n");
return;
@@ -131,15 +131,15 @@ CompatMake(void *gnp, /* The node to make */
else
Job_Touch(gn);
} else
- gn->made = ERROR;
+ gn->built_status = ERROR;
- if (gn->made != ERROR) {
+ if (gn->built_status != ERROR) {
/* If the node was made successfully, mark it so,
* update its modification time and timestamp all
* its parents.
* This is to keep its state from affecting that of
* its parent. */
- gn->made = MADE;
+ gn->built_status = MADE;
/* This is what Make does and it's actually a good
* thing, as it allows rules like
*
@@ -166,7 +166,7 @@ CompatMake(void *gnp, /* The node to make */
Make_TimeStamp(pgn, gn);
}
} else if (keepgoing)
- pgn->make = false;
+ pgn->must_make = false;
else {
if (gn->lineno)
@@ -179,16 +179,16 @@ CompatMake(void *gnp, /* The node to make */
Var_Value(".CURDIR"));
exit(1);
}
- } else if (gn->made == ERROR)
- /* Already had an error when making this beastie. Tell the parent
- * to abort. */
- pgn->make = false;
+ } else if (gn->built_status == ERROR)
+ /* Already had an error when making this beastie. Tell the
+ * parent to abort. */
+ pgn->must_make = false;
else {
- switch (gn->made) {
+ switch (gn->built_status) {
case BEINGMADE:
Error("Graph cycles through %s\n", gn->name);
- gn->made = ERROR;
- pgn->make = false;
+ gn->built_status = ERROR;
+ pgn->must_make = false;
break;
case MADE:
if ((gn->type & OP_EXEC) == 0) {
@@ -223,8 +223,8 @@ Compat_Run(Lst targs) /* List of target nodes to re-create */
}
/* For each entry in the list of targets to create, call CompatMake on
- * it to create the thing. CompatMake will leave the 'made' field of gn
- * in one of several states:
+ * it to create the thing. CompatMake will leave the 'built_status'
+ * field of gn in one of several states:
* UPTODATE gn was already up-to-date
* MADE gn was recreated successfully
* ERROR An error occurred while gn was being
@@ -236,9 +236,9 @@ Compat_Run(Lst targs) /* List of target nodes to re-create */
while ((gn = (GNode *)Lst_DeQueue(targs)) != NULL) {
CompatMake(gn, gn);
- if (gn->made == UPTODATE)
+ if (gn->built_status == UPTODATE)
printf("`%s' is up to date.\n", gn->name);
- else if (gn->made == ABORTED) {
+ else if (gn->built_status == ABORTED) {
printf("`%s' not remade because of errors.\n",
gn->name);
errors++;
diff --git a/usr.bin/make/engine.c b/usr.bin/make/engine.c
index 76ed176fd2d..a31d9f2262e 100644
--- a/usr.bin/make/engine.c
+++ b/usr.bin/make/engine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: engine.c,v 1.13 2007/11/06 21:12:23 espie Exp $ */
+/* $OpenBSD: engine.c,v 1.14 2007/11/10 12:51:40 espie Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
* Copyright (c) 1988, 1989 by Adam de Boor
@@ -260,11 +260,11 @@ MakeAddAllSrc(void *cgnp, void *pgnp)
Varq_Append(ALLSRC_INDEX, target, parent);
if (parent->type & OP_JOIN) {
- if (child->made == MADE)
+ if (child->built_status == MADE)
Varq_Append(OODATE_INDEX, target, parent);
} else if (is_strictly_before(parent->mtime, child->mtime) ||
(!is_strictly_before(child->mtime, now) &&
- child->made == MADE)) {
+ child->built_status == MADE)) {
/*
* It goes in the OODATE variable if the parent is
* younger than the child or if the child has been
@@ -573,13 +573,13 @@ run_command(const char *cmd, bool errCheck)
*-----------------------------------------------------------------------
* setup_and_run_command --
* Execute the next command for a target. If the command returns an
- * error, the node's made field is set to ERROR and creation stops.
+ * error, the node's built_status field is set to ERROR and creation stops.
*
* Results:
* 0 in case of error, 1 if ok.
*
* Side Effects:
- * The node's 'made' field may be set to ERROR.
+ * The node's 'built_status' field may be set to ERROR.
*-----------------------------------------------------------------------
*/
static int
@@ -680,7 +680,7 @@ setup_and_run_command(char *cmd, GNode *gn, int dont_fork)
if (!WIFEXITED(reason) || status != 0) {
if (errCheck) {
- gn->made = ERROR;
+ gn->built_status = ERROR;
if (keepgoing)
/* Abort the current target,
* but let others continue. */
@@ -729,7 +729,7 @@ run_gnode(GNode *gn, int parallel)
LstNode ln, nln;
if (gn != NULL && (gn->type & OP_DUMMY) == 0) {
- gn->made = MADE;
+ gn->built_status = MADE;
for (ln = Lst_First(&gn->commands); ln != NULL; ln = nln) {
nln = Lst_Adv(ln);
if (setup_and_run_command(Lst_Datum(ln), gn,
@@ -738,7 +738,7 @@ run_gnode(GNode *gn, int parallel)
}
if (got_signal && !parallel)
handle_compat_interrupts(gn);
- return gn->made;
+ return gn->built_status;
} else
return NOSUCHNODE;
}
diff --git a/usr.bin/make/gnode.h b/usr.bin/make/gnode.h
index 6bd1687524b..fffe984b1dd 100644
--- a/usr.bin/make/gnode.h
+++ b/usr.bin/make/gnode.h
@@ -1,7 +1,7 @@
#ifndef GNODE_H
#define GNODE_H
/* $OpenPackages$ */
-/* $OpenBSD: gnode.h,v 1.8 2007/11/06 21:12:23 espie Exp $ */
+/* $OpenBSD: gnode.h,v 1.9 2007/11/10 12:51:40 espie Exp $ */
/*
* Copyright (c) 2001 Marc Espie.
@@ -88,10 +88,10 @@ struct Suff_;
struct GNode_ {
int special_op; /* special op to apply */
unsigned char special;/* type of special node */
- char make; /* true if this target needs to be remade */
+ char must_make; /* true if this target needs to be remade */
char childMade; /* true if one of this target's children was
* made */
- char made; /* Set to reflect the state of processing
+ char built_status; /* Set to reflect the state of processing
* on this node:
* UNMADE - Not examined yet
* BEINGMADE - Target is already being made.
@@ -106,7 +106,7 @@ struct GNode_ {
* CYCLE - Marked as potentially being part of
* a graph cycle. If we come back to a
* node marked this way, it is printed
- * and 'made' is changed to ENDCYCLE.
+ * and 'built_status' is changed to ENDCYCLE.
* ENDCYCLE - the cycle has been completely
* printed. Go back and unmark all its
* members.
diff --git a/usr.bin/make/job.c b/usr.bin/make/job.c
index 0a6df9f7d54..6d22e3bbb13 100644
--- a/usr.bin/make/job.c
+++ b/usr.bin/make/job.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: job.c,v 1.107 2007/11/06 21:09:42 espie Exp $ */
+/* $OpenBSD: job.c,v 1.108 2007/11/10 12:51:40 espie Exp $ */
/* $NetBSD: job.c,v 1.16 1996/11/06 17:59:08 christos Exp $ */
/*
@@ -627,7 +627,7 @@ JobFinish(Job *job, int status)
/* As long as we aren't aborting and the job didn't return a
* non-zero status that we shouldn't ignore, we call
* Make_Update to update the parents. */
- job->node->made = MADE;
+ job->node->built_status = MADE;
Make_Update(job->node);
free(job);
} else if (status != 0) {
@@ -953,7 +953,7 @@ prepare_job(GNode *gn, int flags)
*/
if (cmdsOK) {
if (aborting == 0) {
- job->node->made = MADE;
+ job->node->built_status = MADE;
Make_Update(job->node);
}
}
diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c
index 7cb4e75ffca..8ce21ee2fd7 100644
--- a/usr.bin/make/make.c
+++ b/usr.bin/make/make.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: make.c,v 1.47 2007/11/06 21:12:23 espie Exp $ */
+/* $OpenBSD: make.c,v 1.48 2007/11/10 12:51:40 espie Exp $ */
/* $NetBSD: make.c,v 1.10 1996/11/06 17:59:15 christos Exp $ */
/*
@@ -107,7 +107,7 @@ MakeAddChild(void *to_addp, void *lp)
GNode *to_add = (GNode *)to_addp;
Lst l = (Lst)lp;
- if (!to_add->make && !(to_add->type & OP_USE))
+ if (!to_add->must_make && !(to_add->type & OP_USE))
Lst_EnQueue(l, to_add);
}
@@ -153,7 +153,7 @@ Make_Update(GNode *cgn) /* the child node */
* now -- some rules won't actually update the file. If the file still
* doesn't exist, make its mtime now.
*/
- if (cgn->made != UPTODATE) {
+ if (cgn->built_status != UPTODATE) {
/*
* This is what Make does and it's actually a good thing, as it
* allows rules like
@@ -176,11 +176,11 @@ Make_Update(GNode *cgn) /* the child node */
for (ln = Lst_First(&cgn->parents); ln != NULL; ln = Lst_Adv(ln)) {
pgn = (GNode *)Lst_Datum(ln);
- if (pgn->make) {
+ if (pgn->must_make) {
pgn->unmade--;
if ( ! (cgn->type & (OP_EXEC|OP_USE))) {
- if (cgn->made == MADE) {
+ if (cgn->built_status == MADE) {
pgn->childMade = true;
if (is_strictly_before(pgn->cmtime,
cgn->mtime))
@@ -208,7 +208,8 @@ Make_Update(GNode *cgn) /* the child node */
for (ln = Lst_First(&cgn->successors); ln != NULL; ln = Lst_Adv(ln)) {
GNode *succ = (GNode *)Lst_Datum(ln);
- if (succ->make && succ->unmade == 0 && succ->made == UNMADE)
+ if (succ->must_make && succ->unmade == 0
+ && succ->built_status == UNMADE)
(void)Lst_QueueNew(&toBeMade, succ);
}
}
@@ -228,7 +229,7 @@ try_to_make_node(GNode *gn)
for (ln = Lst_First(&gn->preds); ln != NULL; ln = Lst_Adv(ln)){
GNode *pgn = (GNode *)Lst_Datum(ln);
- if (pgn->make && pgn->made == UNMADE) {
+ if (pgn->must_make && pgn->built_status == UNMADE) {
if (DEBUG(MAKE))
printf(
"predecessor %s not made yet.\n",
@@ -258,7 +259,7 @@ try_to_make_node(GNode *gn)
} else {
if (DEBUG(MAKE))
printf("up-to-date\n");
- gn->made = UPTODATE;
+ gn->built_status = UPTODATE;
if (gn->type & OP_JOIN) {
/*
* Even for an up-to-date .JOIN node, we need it
@@ -322,7 +323,7 @@ MakePrintStatus(
{
GNode *gn = (GNode *)gnp;
bool cycle = *(bool *)cyclep;
- if (gn->made == UPTODATE) {
+ if (gn->built_status == UPTODATE) {
printf("`%s' is up to date.\n", gn->name);
} else if (gn->unmade != 0) {
if (cycle) {
@@ -337,13 +338,13 @@ MakePrintStatus(
* will cause this to erroneously complain about a
* being in the cycle, but this is a good approximation.
*/
- if (gn->made == CYCLE) {
+ if (gn->built_status == CYCLE) {
Error("Graph cycles through `%s'", gn->name);
- gn->made = ENDCYCLE;
+ gn->built_status = ENDCYCLE;
Lst_ForEach(&gn->children, MakePrintStatus, &t);
- gn->made = UNMADE;
- } else if (gn->made != ENDCYCLE) {
- gn->made = CYCLE;
+ gn->built_status = UNMADE;
+ } else if (gn->built_status != ENDCYCLE) {
+ gn->built_status = CYCLE;
Lst_ForEach(&gn->children, MakePrintStatus, &t);
}
} else {
@@ -370,8 +371,8 @@ add_targets_to_make(Lst targs)
Lst_Clone(&examine, targs, NOCOPY);
while ((gn = (GNode *)Lst_DeQueue(&examine)) != NULL) {
- if (!gn->make) {
- gn->make = true;
+ if (!gn->must_make) {
+ gn->must_make = true;
numNodes++;
look_harder_for_target(gn);
@@ -408,7 +409,7 @@ add_targets_to_make(Lst targs)
* true if work was done. false otherwise.
*
* Side Effects:
- * The make field of all nodes involved in the creation of the given
+ * The must_make field of all nodes involved in the creation of the given
* targets is set to 1. The toBeMade list is set to contain all the
* 'leaves' of these subgraphs.
*-----------------------------------------------------------------------
diff --git a/usr.bin/make/targ.c b/usr.bin/make/targ.c
index 4dabe25f231..d02cb297e69 100644
--- a/usr.bin/make/targ.c
+++ b/usr.bin/make/targ.c
@@ -1,5 +1,5 @@
/* $OpenPackages$ */
-/* $OpenBSD: targ.c,v 1.50 2007/11/06 21:12:23 espie Exp $ */
+/* $OpenBSD: targ.c,v 1.51 2007/11/10 12:51:40 espie Exp $ */
/* $NetBSD: targ.c,v 1.11 1997/02/20 16:51:50 christos Exp $ */
/*
@@ -180,8 +180,8 @@ Targ_NewGNi(const char *name, const char *ename)
gn->special = SPECIAL_NONE;
gn->unmade = 0;
- gn->make = false;
- gn->made = UNMADE;
+ gn->must_make = false;
+ gn->built_status = UNMADE;
gn->childMade = false;
gn->order = 0;
ts_set_out_of_date(gn->mtime);
@@ -361,16 +361,19 @@ TargPrintNode(GNode *gn, int pass)
if (!is_out_of_date(gn->mtime)) {
printf("# last modified %s: %s\n",
time_to_string(gn->mtime),
- (gn->made == UNMADE ? "unmade" :
- (gn->made == MADE ? "made" :
- (gn->made == UPTODATE ? "up-to-date" :
+ (gn->built_status == UNMADE ? "unmade" :
+ (gn->built_status == MADE ? "made" :
+ (gn->built_status == UPTODATE ?
+ "up-to-date" :
"error when made"))));
- } else if (gn->made != UNMADE) {
+ } else if (gn->built_status != UNMADE) {
printf("# non-existent (maybe): %s\n",
- (gn->made == MADE ? "made" :
- (gn->made == UPTODATE ? "up-to-date" :
- (gn->made == ERROR ? "error when made" :
- "aborted"))));
+ (gn->built_status == MADE ? "made" :
+ (gn->built_status == UPTODATE ?
+ "up-to-date" :
+ (gn->built_status == ERROR ?
+ "error when made" :
+ "aborted"))));
} else {
printf("# unmade\n");
}