=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/targ.c,v retrieving revision 1.31 retrieving revision 1.32 diff -c -r1.31 -r1.32 *** src/usr.bin/make/targ.c 2001/05/03 13:41:12 1.31 --- src/usr.bin/make/targ.c 2001/05/23 12:34:50 1.32 *************** *** 1,5 **** /* $OpenPackages$ */ ! /* $OpenBSD: targ.c,v 1.31 2001/05/03 13:41:12 espie Exp $ */ /* $NetBSD: targ.c,v 1.11 1997/02/20 16:51:50 christos Exp $ */ /* --- 1,5 ---- /* $OpenPackages$ */ ! /* $OpenBSD: targ.c,v 1.32 2001/05/23 12:34:50 espie Exp $ */ /* $NetBSD: targ.c,v 1.11 1997/02/20 16:51:50 christos Exp $ */ /* *************** *** 87,99 **** * Targ_FindList Given a list of names, find nodes for all * of them, creating nodes if needed. * ! * Targ_Ignore Return TRUE if errors should be ignored when * creating the given target. * ! * Targ_Silent Return TRUE if we should be silent when * creating the given target. * ! * Targ_Precious Return TRUE if the target is precious and * should not be removed if we are interrupted. * * Debugging: --- 87,99 ---- * Targ_FindList Given a list of names, find nodes for all * of them, creating nodes if needed. * ! * Targ_Ignore Return true if errors should be ignored when * creating the given target. * ! * Targ_Silent Return true if we should be silent when * creating the given target. * ! * Targ_Precious Return true if the target is precious and * should not be removed if we are interrupted. * * Debugging: *************** *** 102,125 **** * print something for suffixes, too, but... */ ! #include ! #include ! #include ! #include "make.h" ! #include "ohash.h" ! #include "dir.h" ! #include "stats.h" - #ifndef lint - #if 0 - static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94"; - #else - UNUSED - static char *rcsid = "$OpenBSD: targ.c,v 1.31 2001/05/03 13:41:12 espie Exp $"; - #endif - #endif /* not lint */ - - static struct ohash targets; /* a hash table of same */ static struct ohash_info gnode_info = { offsetof(GNode, name), --- 102,123 ---- * print something for suffixes, too, but... */ ! #include ! #include ! #include ! #include "config.h" ! #include "defines.h" ! #include "ohash.h" ! #include "stats.h" ! #include "suff.h" ! #include "var.h" ! #include "targ.h" ! #include "memory.h" ! #include "gnode.h" ! #include "extern.h" ! #include "timestamp.h" ! #include "lst.h" static struct ohash targets; /* a hash table of same */ static struct ohash_info gnode_info = { offsetof(GNode, name), *************** *** 157,166 **** * All lists and gnodes are cleared *----------------------------------------------------------------------- */ void Targ_End() { - #ifdef CLEANUP unsigned int i; GNode *n; --- 155,164 ---- * All lists and gnodes are cleared *----------------------------------------------------------------------- */ + #ifdef CLEANUP void Targ_End() { unsigned int i; GNode *n; *************** *** 168,179 **** TargFreeGN(n); ohash_delete(&targets); - #endif } /*- *----------------------------------------------------------------------- ! * Targ_NewGN -- * Create and initialize a new graph node * * Results: --- 166,177 ---- TargFreeGN(n); ohash_delete(&targets); } + #endif /*- *----------------------------------------------------------------------- ! * Targ_NewGNi -- * Create and initialize a new graph node * * Results: *************** *** 185,191 **** *----------------------------------------------------------------------- */ GNode * ! Targ_NewGN(name, end) const char *name; /* the name to stick in the new node */ const char *end; { --- 183,189 ---- *----------------------------------------------------------------------- */ GNode * ! Targ_NewGNi(name, end) const char *name; /* the name to stick in the new node */ const char *end; { *************** *** 199,210 **** gn->type = 0; } gn->unmade = 0; ! gn->make = FALSE; gn->made = UNMADE; ! gn->childMade = FALSE; gn->order = 0; ! set_out_of_date(gn->mtime); ! set_out_of_date(gn->cmtime); Lst_Init(&gn->iParents); Lst_Init(&gn->cohorts); Lst_Init(&gn->parents); --- 197,208 ---- gn->type = 0; } gn->unmade = 0; ! gn->make = false; gn->made = UNMADE; ! gn->childMade = false; gn->order = 0; ! ts_set_out_of_date(gn->mtime); ! ts_set_out_of_date(gn->cmtime); Lst_Init(&gn->iParents); Lst_Init(&gn->cohorts); Lst_Init(&gn->parents); *************** *** 253,259 **** /*- *----------------------------------------------------------------------- ! * Targ_FindNode -- * Find a node in the list using the given name for matching * * Results: --- 251,257 ---- /*- *----------------------------------------------------------------------- ! * Targ_FindNodei -- * Find a node in the list using the given name for matching * * Results: *************** *** 266,272 **** *----------------------------------------------------------------------- */ GNode * ! Targ_FindNode(name, end, flags) const char *name; /* the name to find */ const char *end; int flags; /* flags governing events when target not --- 264,270 ---- *----------------------------------------------------------------------- */ GNode * ! Targ_FindNodei(name, end, flags) const char *name; /* the name to find */ const char *end; int flags; /* flags governing events when target not *************** *** 280,286 **** gn = ohash_find(&targets, slot); if (gn == NULL && (flags & TARG_CREATE)) { ! gn = Targ_NewGN(name, end); ohash_insert(&targets, slot, gn); } --- 278,284 ---- gn = ohash_find(&targets, slot); if (gn == NULL && (flags & TARG_CREATE)) { ! gn = Targ_NewGNi(name, end); ohash_insert(&targets, slot, gn); } *************** *** 311,317 **** for (ln = Lst_First(names); ln != NULL; ln = Lst_Adv(ln)) { name = (char *)Lst_Datum(ln); ! gn = Targ_FindNode(name, NULL, TARG_CREATE); /* Note: Lst_AtEnd must come before the Lst_Concat so the nodes * are added to the list in the order in which they were * encountered in the makefile. */ --- 309,315 ---- for (ln = Lst_First(names); ln != NULL; ln = Lst_Adv(ln)) { name = (char *)Lst_Datum(ln); ! gn = Targ_FindNode(name, TARG_CREATE); /* Note: Lst_AtEnd must come before the Lst_Concat so the nodes * are added to the list in the order in which they were * encountered in the makefile. */ *************** *** 327,340 **** * Return true if should ignore errors when creating gn *----------------------------------------------------------------------- */ ! Boolean Targ_Ignore(gn) GNode *gn; /* node to check for */ { if (ignoreErrors || gn->type & OP_IGNORE) ! return TRUE; else ! return FALSE; } /*- --- 325,338 ---- * Return true if should ignore errors when creating gn *----------------------------------------------------------------------- */ ! bool Targ_Ignore(gn) GNode *gn; /* node to check for */ { if (ignoreErrors || gn->type & OP_IGNORE) ! return true; else ! return false; } /*- *************** *** 343,356 **** * Return true if be silent when creating gn *----------------------------------------------------------------------- */ ! Boolean Targ_Silent(gn) GNode *gn; /* node to check for */ { if (beSilent || gn->type & OP_SILENT) ! return TRUE; else ! return FALSE; } /*- --- 341,354 ---- * Return true if be silent when creating gn *----------------------------------------------------------------------- */ ! bool Targ_Silent(gn) GNode *gn; /* node to check for */ { if (beSilent || gn->type & OP_SILENT) ! return true; else ! return false; } /*- *************** *** 359,372 **** * See if the given target is precious *----------------------------------------------------------------------- */ ! Boolean Targ_Precious(gn) GNode *gn; /* the node to check */ { if (allPrecious || (gn->type & (OP_PRECIOUS|OP_DOUBLEDEP))) ! return TRUE; else ! return FALSE; } /******************* DEBUG INFO PRINTING ****************/ --- 357,370 ---- * See if the given target is precious *----------------------------------------------------------------------- */ ! bool Targ_Precious(gn) GNode *gn; /* the node to check */ { if (allPrecious || (gn->type & (OP_PRECIOUS|OP_DOUBLEDEP))) ! return true; else ! return false; } /******************* DEBUG INFO PRINTING ****************/ *************** *** 595,601 **** --- 593,601 ---- TargPrintOnlySrc(gn); Var_Dump(); printf("\n"); + #ifdef DEBUG_DIRECTORY_CACHE Dir_PrintDirectories(); printf("\n"); + #endif Suff_PrintAll(); }