version 1.16, 2000/04/17 23:57:46 |
version 1.17, 2000/06/10 01:32:23 |
|
|
|
|
#define HTSIZE 191 /* initial size of hash table */ |
#define HTSIZE 191 /* initial size of hash table */ |
|
|
static int TargPrintOnlySrc __P((ClientData, ClientData)); |
static void TargPrintOnlySrc __P((ClientData)); |
static int TargPrintName __P((ClientData, ClientData)); |
static void TargPrintName __P((ClientData)); |
static int TargPrintNode __P((ClientData, ClientData)); |
static void TargPrintNode __P((ClientData, ClientData)); |
#ifdef CLEANUP |
#ifdef CLEANUP |
static void TargFreeGN __P((ClientData)); |
static void TargFreeGN __P((ClientData)); |
#endif |
#endif |
|
|
mainTarg = gn; |
mainTarg = gn; |
} |
} |
|
|
static int |
static void |
TargPrintName (gnp, ppath) |
TargPrintName(gnp) |
ClientData gnp; |
ClientData gnp; |
ClientData ppath; |
|
{ |
{ |
GNode *gn = (GNode *) gnp; |
GNode *gn = (GNode *)gnp; |
printf ("%s ", gn->name); |
|
#ifdef notdef |
printf("%s ", gn->name); |
if (ppath) { |
|
if (gn->path) { |
|
printf ("[%s] ", gn->path); |
|
} |
|
if (gn == mainTarg) { |
|
printf ("(MAIN NAME) "); |
|
} |
|
} |
|
#endif /* notdef */ |
|
return (ppath ? 0 : 0); |
|
} |
} |
|
|
|
|
int |
void |
Targ_PrintCmd (cmd, dummy) |
Targ_PrintCmd(cmd) |
ClientData cmd; |
ClientData cmd; |
ClientData dummy; |
|
{ |
{ |
printf ("\t%s\n", (char *) cmd); |
printf("\t%s\n", (char *)cmd); |
return (dummy ? 0 : 0); |
|
} |
} |
|
|
/*- |
/*- |
|
|
* print the contents of a node |
* print the contents of a node |
*----------------------------------------------------------------------- |
*----------------------------------------------------------------------- |
*/ |
*/ |
static int |
static void |
TargPrintNode (gnp, passp) |
TargPrintNode(gnp, passp) |
ClientData gnp; |
ClientData gnp; |
ClientData passp; |
ClientData passp; |
{ |
{ |
GNode *gn = (GNode *) gnp; |
GNode *gn = (GNode *)gnp; |
int pass = *(int *) passp; |
int pass = *(int *)passp; |
if (!OP_NOP(gn->type)) { |
if (!OP_NOP(gn->type)) { |
printf("#\n"); |
printf("#\n"); |
if (gn == mainTarg) { |
if (gn == mainTarg) |
printf("# *** MAIN TARGET ***\n"); |
printf("# *** MAIN TARGET ***\n"); |
} |
|
if (pass == 2) { |
if (pass == 2) { |
if (gn->unmade) { |
if (gn->unmade) |
printf("# %d unmade children\n", gn->unmade); |
printf("# %d unmade children\n", gn->unmade); |
} else { |
else |
printf("# No unmade children\n"); |
printf("# No unmade children\n"); |
} |
|
if (! (gn->type & (OP_JOIN|OP_USE|OP_EXEC))) { |
if (! (gn->type & (OP_JOIN|OP_USE|OP_EXEC))) { |
if (gn->mtime != OUT_OF_DATE) { |
if (gn->mtime != OUT_OF_DATE) |
printf("# last modified %s: %s\n", |
printf("# last modified %s: %s\n", |
Targ_FmtTime(gn->mtime), |
Targ_FmtTime(gn->mtime), |
(gn->made == UNMADE ? "unmade" : |
(gn->made == UNMADE ? "unmade" : |
(gn->made == MADE ? "made" : |
(gn->made == MADE ? "made" : |
(gn->made == UPTODATE ? "up-to-date" : |
(gn->made == UPTODATE ? "up-to-date" : |
"error when made")))); |
"error when made")))); |
} else if (gn->made != UNMADE) { |
else if (gn->made != UNMADE) |
printf("# non-existent (maybe): %s\n", |
printf("# non-existent (maybe): %s\n", |
(gn->made == MADE ? "made" : |
(gn->made == MADE ? "made" : |
(gn->made == UPTODATE ? "up-to-date" : |
(gn->made == UPTODATE ? "up-to-date" : |
(gn->made == ERROR ? "error when made" : |
(gn->made == ERROR ? "error when made" : |
"aborted")))); |
"aborted")))); |
} else { |
else |
printf("# unmade\n"); |
printf("# unmade\n"); |
} |
|
} |
} |
if (!Lst_IsEmpty (gn->iParents)) { |
if (!Lst_IsEmpty (gn->iParents)) { |
printf("# implicit parents: "); |
printf("# implicit parents: "); |
Lst_ForEach(gn->iParents, TargPrintName, NULL); |
Lst_Every(gn->iParents, TargPrintName); |
fputc ('\n', stdout); |
fputc('\n', stdout); |
} |
} |
} |
} |
if (!Lst_IsEmpty (gn->parents)) { |
if (!Lst_IsEmpty (gn->parents)) { |
printf("# parents: "); |
printf("# parents: "); |
Lst_ForEach(gn->parents, TargPrintName, NULL); |
Lst_Every(gn->parents, TargPrintName); |
fputc ('\n', stdout); |
fputc ('\n', stdout); |
} |
} |
|
|
|
|
case OP_DOUBLEDEP: |
case OP_DOUBLEDEP: |
printf(":: "); break; |
printf(":: "); break; |
} |
} |
Targ_PrintType (gn->type); |
Targ_PrintType(gn->type); |
Lst_ForEach(gn->children, TargPrintName, NULL); |
Lst_Every(gn->children, TargPrintName); |
fputc ('\n', stdout); |
fputc('\n', stdout); |
Lst_ForEach(gn->commands, Targ_PrintCmd, NULL); |
Lst_Every(gn->commands, Targ_PrintCmd); |
printf("\n\n"); |
printf("\n\n"); |
if (gn->type & OP_DOUBLEDEP) { |
if (gn->type & OP_DOUBLEDEP) |
Lst_ForEach(gn->cohorts, TargPrintNode, &pass); |
Lst_ForEach(gn->cohorts, TargPrintNode, &pass); |
} |
|
} |
} |
return (0); |
|
} |
} |
|
|
/*- |
/*- |
|
|
* TargPrintOnlySrc -- |
* TargPrintOnlySrc -- |
* Print only those targets that are just a source. |
* Print only those targets that are just a source. |
* |
* |
* Results: |
|
* 0. |
|
* |
|
* Side Effects: |
* Side Effects: |
* The name of each file is printed preceeded by #\t |
* The name of each file is printed preceeded by #\t |
* |
* |
*----------------------------------------------------------------------- |
*----------------------------------------------------------------------- |
*/ |
*/ |
static int |
static void |
TargPrintOnlySrc(gnp, dummy) |
TargPrintOnlySrc(gnp) |
ClientData gnp; |
ClientData gnp; |
ClientData dummy; |
|
{ |
{ |
GNode *gn = (GNode *) gnp; |
GNode *gn = (GNode *)gnp; |
|
|
if (OP_NOP(gn->type)) |
if (OP_NOP(gn->type)) |
printf("#\t%s [%s]\n", gn->name, gn->path ? gn->path : gn->name); |
printf("#\t%s [%s]\n", gn->name, gn->path ? gn->path : gn->name); |
|
|
return (dummy ? 0 : 0); |
|
} |
} |
|
|
/*- |
/*- |
|
|
Lst_ForEach(allTargets, TargPrintNode, &pass); |
Lst_ForEach(allTargets, TargPrintNode, &pass); |
printf("\n\n"); |
printf("\n\n"); |
printf("#\n# Files that are only sources:\n"); |
printf("#\n# Files that are only sources:\n"); |
Lst_ForEach(allTargets, TargPrintOnlySrc, NULL); |
Lst_Every(allTargets, TargPrintOnlySrc); |
printf("#*** Global Variables:\n"); |
printf("#*** Global Variables:\n"); |
Var_Dump (VAR_GLOBAL); |
Var_Dump (VAR_GLOBAL); |
printf("#*** Command-line Variables:\n"); |
printf("#*** Command-line Variables:\n"); |