Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make make(1): indent make.c with tabs instead of spaces



details:   https://anonhg.NetBSD.org/src/rev/35d2147a09d1
branches:  trunk
changeset: 1017178:35d2147a09d1
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Dec 15 20:17:08 2020 +0000

description:
make(1): indent make.c with tabs instead of spaces

diffstat:

 usr.bin/make/make.c |  1389 ++++++++++++++++++++++++++------------------------
 1 files changed, 720 insertions(+), 669 deletions(-)

diffs (truncated from 1590 to 300 lines):

diff -r b4e03c9548d9 -r 35d2147a09d1 usr.bin/make/make.c
--- a/usr.bin/make/make.c       Tue Dec 15 19:47:02 2020 +0000
+++ b/usr.bin/make/make.c       Tue Dec 15 20:17:08 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.c,v 1.228 2020/12/15 19:47:02 rillig Exp $        */
+/*     $NetBSD: make.c,v 1.229 2020/12/15 20:17:08 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -102,7 +102,7 @@
 #include "job.h"
 
 /*     "@(#)make.c     8.1 (Berkeley) 6/6/93"  */
-MAKE_RCSID("$NetBSD: make.c,v 1.228 2020/12/15 19:47:02 rillig Exp $");
+MAKE_RCSID("$NetBSD: make.c,v 1.229 2020/12/15 20:17:08 rillig Exp $");
 
 /* Sequence # to detect recursion. */
 static unsigned int checked_seqno = 1;
@@ -135,39 +135,39 @@
 }
 
 ENUM_VALUE_RTTI_8(GNodeMade,
-                 UNMADE, DEFERRED, REQUESTED, BEINGMADE,
-                 MADE, UPTODATE, ERROR, ABORTED);
+    UNMADE, DEFERRED, REQUESTED, BEINGMADE,
+    MADE, UPTODATE, ERROR, ABORTED);
 
 ENUM_FLAGS_RTTI_31(GNodeType,
-                  OP_DEPENDS, OP_FORCE, OP_DOUBLEDEP,
-                  /* OP_OPMASK is omitted since it combines other flags */
-                  OP_OPTIONAL, OP_USE, OP_EXEC, OP_IGNORE,
-                  OP_PRECIOUS, OP_SILENT, OP_MAKE, OP_JOIN,
-                  OP_MADE, OP_SPECIAL, OP_USEBEFORE, OP_INVISIBLE,
-                  OP_NOTMAIN, OP_PHONY, OP_NOPATH, OP_WAIT,
-                  OP_NOMETA, OP_META, OP_NOMETA_CMP, OP_SUBMAKE,
-                  OP_TRANSFORM, OP_MEMBER, OP_LIB, OP_ARCHV,
-                  OP_HAS_COMMANDS, OP_SAVE_CMDS, OP_DEPS_FOUND, OP_MARK);
+    OP_DEPENDS, OP_FORCE, OP_DOUBLEDEP,
+/* OP_OPMASK is omitted since it combines other flags */
+    OP_OPTIONAL, OP_USE, OP_EXEC, OP_IGNORE,
+    OP_PRECIOUS, OP_SILENT, OP_MAKE, OP_JOIN,
+    OP_MADE, OP_SPECIAL, OP_USEBEFORE, OP_INVISIBLE,
+    OP_NOTMAIN, OP_PHONY, OP_NOPATH, OP_WAIT,
+    OP_NOMETA, OP_META, OP_NOMETA_CMP, OP_SUBMAKE,
+    OP_TRANSFORM, OP_MEMBER, OP_LIB, OP_ARCHV,
+    OP_HAS_COMMANDS, OP_SAVE_CMDS, OP_DEPS_FOUND, OP_MARK);
 
 ENUM_FLAGS_RTTI_10(GNodeFlags,
-                  REMAKE, CHILDMADE, FORCE, DONE_WAIT,
-                  DONE_ORDER, FROM_DEPEND, DONE_ALLSRC, CYCLE,
-                  DONECYCLE, INTERNAL);
+    REMAKE, CHILDMADE, FORCE, DONE_WAIT,
+    DONE_ORDER, FROM_DEPEND, DONE_ALLSRC, CYCLE,
+    DONECYCLE, INTERNAL);
 
 void
 GNode_FprintDetails(FILE *f, const char *prefix, const GNode *gn,
                    const char *suffix)
 {
-    char type_buf[GNodeType_ToStringSize];
-    char flags_buf[GNodeFlags_ToStringSize];
+       char type_buf[GNodeType_ToStringSize];
+       char flags_buf[GNodeFlags_ToStringSize];
 
-    fprintf(f, "%smade %s, type %s, flags %s%s",
+       fprintf(f, "%smade %s, type %s, flags %s%s",
            prefix,
            Enum_ValueToString(gn->made, GNodeMade_ToStringSpecs),
            Enum_FlagsToString(type_buf, sizeof type_buf,
-                              gn->type, GNodeType_ToStringSpecs),
+               gn->type, GNodeType_ToStringSpecs),
            Enum_FlagsToString(flags_buf, sizeof flags_buf,
-                              gn->flags, GNodeFlags_ToStringSpecs),
+               gn->flags, GNodeFlags_ToStringSpecs),
            suffix);
 }
 
@@ -228,112 +228,120 @@
 Boolean
 GNode_IsOODate(GNode *gn)
 {
-    Boolean         oodate;
-
-    /*
-     * Certain types of targets needn't even be sought as their datedness
-     * doesn't depend on their modification time...
-     */
-    if (!(gn->type & (OP_JOIN|OP_USE|OP_USEBEFORE|OP_EXEC))) {
-       Dir_UpdateMTime(gn, TRUE);
-       if (DEBUG(MAKE)) {
-           if (gn->mtime != 0)
-               debug_printf("modified %s...", Targ_FmtTime(gn->mtime));
-           else
-               debug_printf("non-existent...");
-       }
-    }
+       Boolean oodate;
 
-    /*
-     * A target is remade in one of the following circumstances:
-     * its modification time is smaller than that of its youngest child and
-     *     it would actually be run (has commands or is not GNode_IsTarget)
-     * it's the object of a force operator
-     * it has no children, was on the lhs of an operator and doesn't exist
-     *     already.
-     *
-     * Libraries are only considered out-of-date if the archive module says
-     * they are.
-     *
-     * These weird rules are brought to you by Backward-Compatibility and
-     * the strange people who wrote 'Make'.
-     */
-    if (gn->type & (OP_USE|OP_USEBEFORE)) {
        /*
-        * If the node is a USE node it is *never* out of date
-        * no matter *what*.
+        * Certain types of targets needn't even be sought as their datedness
+        * doesn't depend on their modification time...
         */
-       DEBUG0(MAKE, ".USE node...");
-       oodate = FALSE;
-    } else if ((gn->type & OP_LIB) && (gn->mtime == 0 || Arch_IsLib(gn))) {
-       DEBUG0(MAKE, "library...");
+       if (!(gn->type & (OP_JOIN | OP_USE | OP_USEBEFORE | OP_EXEC))) {
+               Dir_UpdateMTime(gn, TRUE);
+               if (DEBUG(MAKE)) {
+                       if (gn->mtime != 0)
+                               debug_printf("modified %s...",
+                                   Targ_FmtTime(gn->mtime));
+                       else
+                               debug_printf("non-existent...");
+               }
+       }
 
        /*
-        * always out of date if no children and :: target
-        * or non-existent.
-        */
-       oodate = (gn->mtime == 0 || Arch_LibOODate(gn) ||
-                 (gn->youngestChild == NULL && (gn->type & OP_DOUBLEDEP)));
-    } else if (gn->type & OP_JOIN) {
-       /*
-        * A target with the .JOIN attribute is only considered
-        * out-of-date if any of its children was out-of-date.
-        */
-       DEBUG0(MAKE, ".JOIN node...");
-       DEBUG1(MAKE, "source %smade...", gn->flags & CHILDMADE ? "" : "not ");
-       oodate = (gn->flags & CHILDMADE) != 0;
-    } else if (gn->type & (OP_FORCE|OP_EXEC|OP_PHONY)) {
-       /*
-        * A node which is the object of the force (!) operator or which has
-        * the .EXEC attribute is always considered out-of-date.
+        * A target is remade in one of the following circumstances:
+        *
+        *      its modification time is smaller than that of its youngest
+        *      child and it would actually be run (has commands or is not
+        *      GNode_IsTarget)
+        *
+        *      it's the object of a force operator
+        *
+        *      it has no children, was on the lhs of an operator and doesn't
+        *      exist already.
+        *
+        * Libraries are only considered out-of-date if the archive module
+        * says they are.
+        *
+        * These weird rules are brought to you by Backward-Compatibility
+        * and the strange people who wrote 'Make'.
         */
-       if (DEBUG(MAKE)) {
-           if (gn->type & OP_FORCE) {
-               debug_printf("! operator...");
-           } else if (gn->type & OP_PHONY) {
-               debug_printf(".PHONY node...");
-           } else {
-               debug_printf(".EXEC node...");
-           }
+       if (gn->type & (OP_USE | OP_USEBEFORE)) {
+               /*
+                * If the node is a USE node it is *never* out of date
+                * no matter *what*.
+                */
+               DEBUG0(MAKE, ".USE node...");
+               oodate = FALSE;
+       } else if ((gn->type & OP_LIB) && (gn->mtime == 0 || Arch_IsLib(gn))) {
+               DEBUG0(MAKE, "library...");
+
+               /*
+                * always out of date if no children and :: target
+                * or non-existent.
+                */
+               oodate = (gn->mtime == 0 || Arch_LibOODate(gn) ||
+                         (gn->youngestChild == NULL &&
+                          (gn->type & OP_DOUBLEDEP)));
+       } else if (gn->type & OP_JOIN) {
+               /*
+                * A target with the .JOIN attribute is only considered
+                * out-of-date if any of its children was out-of-date.
+                */
+               DEBUG0(MAKE, ".JOIN node...");
+               DEBUG1(MAKE, "source %smade...",
+                   gn->flags & CHILDMADE ? "" : "not ");
+               oodate = (gn->flags & CHILDMADE) != 0;
+       } else if (gn->type & (OP_FORCE | OP_EXEC | OP_PHONY)) {
+               /*
+                * A node which is the object of the force (!) operator or
+                * which has the .EXEC attribute is always considered
+                * out-of-date.
+                */
+               if (DEBUG(MAKE)) {
+                       if (gn->type & OP_FORCE) {
+                               debug_printf("! operator...");
+                       } else if (gn->type & OP_PHONY) {
+                               debug_printf(".PHONY node...");
+                       } else {
+                               debug_printf(".EXEC node...");
+                       }
+               }
+               oodate = TRUE;
+       } else if (IsOODateRegular(gn)) {
+               oodate = TRUE;
+       } else {
+               /*
+                * When a non-existing child with no sources
+                * (such as a typically used FORCE source) has been made and
+                * the target of the child (usually a directory) has the same
+                * timestamp as the timestamp just given to the non-existing
+                * child after it was considered made.
+                */
+               if (DEBUG(MAKE)) {
+                       if (gn->flags & FORCE)
+                               debug_printf("non existing child...");
+               }
+               oodate = (gn->flags & FORCE) != 0;
        }
-       oodate = TRUE;
-    } else if (IsOODateRegular(gn)) {
-       oodate = TRUE;
-    } else {
-       /*
-        * When a non-existing child with no sources
-        * (such as a typically used FORCE source) has been made and
-        * the target of the child (usually a directory) has the same
-        * timestamp as the timestamp just given to the non-existing child
-        * after it was considered made.
-        */
-       if (DEBUG(MAKE)) {
-           if (gn->flags & FORCE)
-               debug_printf("non existing child...");
-       }
-       oodate = (gn->flags & FORCE) != 0;
-    }
 
 #ifdef USE_META
-    if (useMeta) {
-       oodate = meta_oodate(gn, oodate);
-    }
+       if (useMeta) {
+               oodate = meta_oodate(gn, oodate);
+       }
 #endif
 
-    /*
-     * If the target isn't out-of-date, the parents need to know its
-     * modification time. Note that targets that appear to be out-of-date
-     * but aren't, because they have no commands and are GNode_IsTarget,
-     * have their mtime stay below their children's mtime to keep parents from
-     * thinking they're out-of-date.
-     */
-    if (!oodate) {
-       GNodeListNode *ln;
-       for (ln = gn->parents.first; ln != NULL; ln = ln->next)
-           GNode_UpdateYoungestChild(ln->datum, gn);
-    }
+       /*
+        * If the target isn't out-of-date, the parents need to know its
+        * modification time. Note that targets that appear to be out-of-date
+        * but aren't, because they have no commands and are GNode_IsTarget,
+        * have their mtime stay below their children's mtime to keep parents
+        * from thinking they're out-of-date.
+        */
+       if (!oodate) {
+               GNodeListNode *ln;
+               for (ln = gn->parents.first; ln != NULL; ln = ln->next)
+                       GNode_UpdateYoungestChild(ln->datum, gn);
+       }
 
-    return oodate;
+       return oodate;
 }
 
 static void
@@ -367,54 +375,58 @@
 void
 Make_HandleUse(GNode *cgn, GNode *pgn)
 {
-    GNodeListNode *ln; /* An element in the children list */
+       GNodeListNode *ln;      /* An element in the children list */
 
 #ifdef DEBUG_SRC



Home | Main Index | Thread Index | Old Index