make: extract HandleSingleDependencyTargetMundane

No functional change.
This commit is contained in:
rillig 2022-06-11 16:47:24 +00:00
parent c5de507a3a
commit 8a67ed90c9
1 changed files with 15 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: parse.c,v 1.676 2022/06/11 16:43:16 rillig Exp $ */
/* $NetBSD: parse.c,v 1.677 2022/06/11 16:47:24 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@ -105,7 +105,7 @@
#include "pathnames.h"
/* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */
MAKE_RCSID("$NetBSD: parse.c,v 1.676 2022/06/11 16:43:16 rillig Exp $");
MAKE_RCSID("$NetBSD: parse.c,v 1.677 2022/06/11 16:47:24 rillig Exp $");
/*
* A file being read.
@ -1020,6 +1020,18 @@ HandleDependencyTarget(const char *targetName,
return true;
}
static void
HandleSingleDependencyTargetMundane(const char *name)
{
GNode *gn = Suff_IsTransform(name)
? Suff_AddTransform(name)
: Targ_GetNode(name);
if (doing_depend)
RememberLocation(gn);
Lst_Append(targets, gn);
}
static void
HandleDependencyTargetMundane(char *targetName)
{
@ -1034,13 +1046,7 @@ HandleDependencyTargetMundane(char *targetName)
while (!Lst_IsEmpty(&targetNames)) {
char *targName = Lst_Dequeue(&targetNames);
GNode *gn = Suff_IsTransform(targName)
? Suff_AddTransform(targName)
: Targ_GetNode(targName);
if (doing_depend)
RememberLocation(gn);
Lst_Append(targets, gn);
HandleSingleDependencyTargetMundane(targName);
}
}