=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/targ.c,v retrieving revision 1.16 retrieving revision 1.17 diff -c -r1.16 -r1.17 *** src/usr.bin/make/targ.c 2000/04/17 23:57:46 1.16 --- src/usr.bin/make/targ.c 2000/06/10 01:32:23 1.17 *************** *** 1,4 **** ! /* $OpenBSD: targ.c,v 1.16 2000/04/17 23:57:46 espie Exp $ */ /* $NetBSD: targ.c,v 1.11 1997/02/20 16:51:50 christos Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: targ.c,v 1.17 2000/06/10 01:32:23 espie Exp $ */ /* $NetBSD: targ.c,v 1.11 1997/02/20 16:51:50 christos Exp $ */ /* *************** *** 43,49 **** #if 0 static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94"; #else ! static char *rcsid = "$OpenBSD: targ.c,v 1.16 2000/04/17 23:57:46 espie Exp $"; #endif #endif /* not lint */ --- 43,49 ---- #if 0 static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94"; #else ! static char *rcsid = "$OpenBSD: targ.c,v 1.17 2000/06/10 01:32:23 espie Exp $"; #endif #endif /* not lint */ *************** *** 102,110 **** #define HTSIZE 191 /* initial size of hash table */ ! static int TargPrintOnlySrc __P((ClientData, ClientData)); ! static int TargPrintName __P((ClientData, ClientData)); ! static int TargPrintNode __P((ClientData, ClientData)); #ifdef CLEANUP static void TargFreeGN __P((ClientData)); #endif --- 102,110 ---- #define HTSIZE 191 /* initial size of hash table */ ! static void TargPrintOnlySrc __P((ClientData)); ! static void TargPrintName __P((ClientData)); ! static void TargPrintNode __P((ClientData, ClientData)); #ifdef CLEANUP static void TargFreeGN __P((ClientData)); #endif *************** *** 429,462 **** mainTarg = gn; } ! static int ! TargPrintName (gnp, ppath) ClientData gnp; - ClientData ppath; { ! GNode *gn = (GNode *) gnp; ! printf ("%s ", gn->name); ! #ifdef notdef ! if (ppath) { ! if (gn->path) { ! printf ("[%s] ", gn->path); ! } ! if (gn == mainTarg) { ! printf ("(MAIN NAME) "); ! } ! } ! #endif /* notdef */ ! return (ppath ? 0 : 0); } ! int ! Targ_PrintCmd (cmd, dummy) ClientData cmd; - ClientData dummy; { ! printf ("\t%s\n", (char *) cmd); ! return (dummy ? 0 : 0); } /*- --- 429,449 ---- mainTarg = gn; } ! static void ! TargPrintName(gnp) ClientData gnp; { ! GNode *gn = (GNode *)gnp; ! ! printf("%s ", gn->name); } ! void ! Targ_PrintCmd(cmd) ClientData cmd; { ! printf("\t%s\n", (char *)cmd); } /*- *************** *** 543,593 **** * print the contents of a node *----------------------------------------------------------------------- */ ! static int ! TargPrintNode (gnp, passp) ClientData gnp; ClientData passp; { ! GNode *gn = (GNode *) gnp; ! int pass = *(int *) passp; if (!OP_NOP(gn->type)) { printf("#\n"); ! if (gn == mainTarg) { printf("# *** MAIN TARGET ***\n"); - } if (pass == 2) { ! if (gn->unmade) { printf("# %d unmade children\n", gn->unmade); ! } else { printf("# No unmade children\n"); - } if (! (gn->type & (OP_JOIN|OP_USE|OP_EXEC))) { ! if (gn->mtime != OUT_OF_DATE) { printf("# last modified %s: %s\n", Targ_FmtTime(gn->mtime), (gn->made == UNMADE ? "unmade" : (gn->made == MADE ? "made" : (gn->made == UPTODATE ? "up-to-date" : "error when made")))); ! } else if (gn->made != UNMADE) { printf("# non-existent (maybe): %s\n", (gn->made == MADE ? "made" : (gn->made == UPTODATE ? "up-to-date" : (gn->made == ERROR ? "error when made" : "aborted")))); ! } else { printf("# unmade\n"); - } } if (!Lst_IsEmpty (gn->iParents)) { printf("# implicit parents: "); ! Lst_ForEach(gn->iParents, TargPrintName, NULL); ! fputc ('\n', stdout); } } if (!Lst_IsEmpty (gn->parents)) { printf("# parents: "); ! Lst_ForEach(gn->parents, TargPrintName, NULL); fputc ('\n', stdout); } --- 530,577 ---- * print the contents of a node *----------------------------------------------------------------------- */ ! static void ! TargPrintNode(gnp, passp) ClientData gnp; ClientData passp; { ! GNode *gn = (GNode *)gnp; ! int pass = *(int *)passp; if (!OP_NOP(gn->type)) { printf("#\n"); ! if (gn == mainTarg) printf("# *** MAIN TARGET ***\n"); if (pass == 2) { ! if (gn->unmade) printf("# %d unmade children\n", gn->unmade); ! else printf("# No unmade children\n"); if (! (gn->type & (OP_JOIN|OP_USE|OP_EXEC))) { ! if (gn->mtime != OUT_OF_DATE) printf("# last modified %s: %s\n", Targ_FmtTime(gn->mtime), (gn->made == UNMADE ? "unmade" : (gn->made == MADE ? "made" : (gn->made == UPTODATE ? "up-to-date" : "error when made")))); ! else if (gn->made != UNMADE) printf("# non-existent (maybe): %s\n", (gn->made == MADE ? "made" : (gn->made == UPTODATE ? "up-to-date" : (gn->made == ERROR ? "error when made" : "aborted")))); ! else printf("# unmade\n"); } if (!Lst_IsEmpty (gn->iParents)) { printf("# implicit parents: "); ! Lst_Every(gn->iParents, TargPrintName); ! fputc('\n', stdout); } } if (!Lst_IsEmpty (gn->parents)) { printf("# parents: "); ! Lst_Every(gn->parents, TargPrintName); fputc ('\n', stdout); } *************** *** 600,615 **** case OP_DOUBLEDEP: printf(":: "); break; } ! Targ_PrintType (gn->type); ! Lst_ForEach(gn->children, TargPrintName, NULL); ! fputc ('\n', stdout); ! Lst_ForEach(gn->commands, Targ_PrintCmd, NULL); printf("\n\n"); ! if (gn->type & OP_DOUBLEDEP) { Lst_ForEach(gn->cohorts, TargPrintNode, &pass); - } } - return (0); } /*- --- 584,597 ---- case OP_DOUBLEDEP: printf(":: "); break; } ! Targ_PrintType(gn->type); ! Lst_Every(gn->children, TargPrintName); ! fputc('\n', stdout); ! Lst_Every(gn->commands, Targ_PrintCmd); printf("\n\n"); ! if (gn->type & OP_DOUBLEDEP) Lst_ForEach(gn->cohorts, TargPrintNode, &pass); } } /*- *************** *** 617,640 **** * TargPrintOnlySrc -- * Print only those targets that are just a source. * - * Results: - * 0. - * * Side Effects: * The name of each file is printed preceeded by #\t * *----------------------------------------------------------------------- */ ! static int ! TargPrintOnlySrc(gnp, dummy) ClientData gnp; - ClientData dummy; { ! GNode *gn = (GNode *) gnp; if (OP_NOP(gn->type)) printf("#\t%s [%s]\n", gn->name, gn->path ? gn->path : gn->name); - - return (dummy ? 0 : 0); } /*- --- 599,617 ---- * TargPrintOnlySrc -- * Print only those targets that are just a source. * * Side Effects: * The name of each file is printed preceeded by #\t * *----------------------------------------------------------------------- */ ! static void ! TargPrintOnlySrc(gnp) ClientData gnp; { ! GNode *gn = (GNode *)gnp; ! if (OP_NOP(gn->type)) printf("#\t%s [%s]\n", gn->name, gn->path ? gn->path : gn->name); } /*- *************** *** 658,664 **** Lst_ForEach(allTargets, TargPrintNode, &pass); printf("\n\n"); printf("#\n# Files that are only sources:\n"); ! Lst_ForEach(allTargets, TargPrintOnlySrc, NULL); printf("#*** Global Variables:\n"); Var_Dump (VAR_GLOBAL); printf("#*** Command-line Variables:\n"); --- 635,641 ---- Lst_ForEach(allTargets, TargPrintNode, &pass); printf("\n\n"); printf("#\n# Files that are only sources:\n"); ! Lst_Every(allTargets, TargPrintOnlySrc); printf("#*** Global Variables:\n"); Var_Dump (VAR_GLOBAL); printf("#*** Command-line Variables:\n");