Lines Matching defs:gn
183 GNode *gn;
185 gn = bmake_malloc(sizeof *gn);
186 gn->name = bmake_strdup(name);
187 gn->uname = NULL;
188 gn->path = NULL;
189 gn->type = name[0] == '-' && name[1] == 'l' ? OP_LIB : OP_NONE;
190 memset(&gn->flags, 0, sizeof(gn->flags));
191 gn->made = UNMADE;
192 gn->unmade = 0;
193 gn->mtime = 0;
194 gn->youngestChild = NULL;
195 Lst_Init(&gn->implicitParents);
196 Lst_Init(&gn->parents);
197 Lst_Init(&gn->children);
198 Lst_Init(&gn->order_pred);
199 Lst_Init(&gn->order_succ);
200 Lst_Init(&gn->cohorts);
201 gn->cohort_num[0] = '\0';
202 gn->unmade_cohorts = 0;
203 gn->centurion = NULL;
204 gn->checked_seqno = 0;
205 HashTable_Init(&gn->vars);
206 Lst_Init(&gn->commands);
207 gn->suffix = NULL;
208 gn->fname = NULL;
209 gn->lineno = 0;
210 gn->exit_status = 0;
213 Lst_Append(&allNodes, gn);
216 return gn;
221 GNode_Free(GNode *gn)
223 Var_DeleteAll(gn);
225 free(gn->name);
226 free(gn->uname);
227 free(gn->path);
229 /* Don't free gn->youngestChild since it is not owned by this node. */
235 Lst_Done(&gn->implicitParents);
236 Lst_Done(&gn->parents);
237 Lst_Done(&gn->children);
238 Lst_Done(&gn->order_pred);
239 Lst_Done(&gn->order_succ);
240 Lst_Done(&gn->cohorts);
242 HashTable_Done(&gn->vars);
248 Lst_Done(&gn->commands);
251 * gn->suffix is not owned by this node.
253 * XXX: gn->suffix should be unreferenced here. This requires a
258 free(gn);
279 GNode *gn = Targ_NewInternalNode(name);
280 HashEntry_Set(he, gn);
281 return gn;
294 GNode *gn = GNode_New(name);
296 Lst_Append(&allTargets, gn);
297 DEBUG1(TARG, "Adding \"%s\" to all targets.\n", gn->name);
299 gn->flags.fromDepend = true;
300 return gn;
331 GNode *gn = Targ_GetNode(name);
332 Lst_Append(gns, gn);
342 GNode *gn = ln->datum;
343 debug_printf(" %s%s", gn->name, gn->cohort_num);
358 Targ_PrintCmds(GNode *gn)
362 for (ln = gn->commands.first; ln != NULL; ln = ln->next) {
438 GNode_OpName(const GNode *gn)
440 switch (gn->type & OP_OPMASK) {
467 Targ_PrintNode(GNode *gn, int pass)
469 debug_printf("# %s%s", gn->name, gn->cohort_num);
470 GNode_FprintDetails(opts.debug_file, ", ", gn, "\n");
471 if (GNodeFlags_IsNone(gn->flags))
474 if (!GNode_IsTarget(gn))
478 if (gn == mainNode)
482 if (gn->unmade > 0)
483 debug_printf("# %d unmade children\n", gn->unmade);
486 if (!(gn->type & (OP_JOIN | OP_USE | OP_USEBEFORE | OP_EXEC))) {
487 if (gn->mtime != 0) {
489 Targ_FmtTime(gn->mtime),
490 GNodeMade_Name(gn->made));
491 } else if (gn->made != UNMADE) {
493 GNodeMade_Name(gn->made));
497 PrintNodeNamesLine("implicit parents", &gn->implicitParents);
499 if (gn->unmade != 0)
500 debug_printf("# %d unmade children\n", gn->unmade);
503 PrintNodeNamesLine("parents", &gn->parents);
504 PrintNodeNamesLine("order_pred", &gn->order_pred);
505 PrintNodeNamesLine("order_succ", &gn->order_succ);
507 debug_printf("%-16s%s", gn->name, GNode_OpName(gn));
508 Targ_PrintType(gn->type);
509 PrintNodeNames(&gn->children);
511 Targ_PrintCmds(gn);
513 if (gn->type & OP_DOUBLEDEP)
514 Targ_PrintNodes(&gn->cohorts, pass);
532 GNode *gn = ln->datum;
533 if (GNode_IsTarget(gn))
536 debug_printf("#\t%s [%s]", gn->name, GNode_Path(gn));
537 Targ_PrintType(gn->type);
589 GNode *gn = ln->datum;
590 GNodeType type = gn->type;
595 for (cln = gn->cohorts.first; cln != NULL; cln = cln->next) {