Skip to content

Commit

Permalink
make: clarify that undefined expressions are allowed in dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
rillig committed Jan 14, 2025
1 parent 3e2e8e5 commit 72eb8b1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions usr.bin/make/suff.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: suff.c,v 1.382 2024/07/07 07:50:57 rillig Exp $ */
/* $NetBSD: suff.c,v 1.383 2025/01/14 21:39:24 rillig Exp $ */

/*
* Copyright (c) 1988, 1989, 1990, 1993
Expand Down Expand Up @@ -115,7 +115,7 @@
#include "dir.h"

/* "@(#)suff.c 8.4 (Berkeley) 3/21/94" */
MAKE_RCSID("$NetBSD: suff.c,v 1.382 2024/07/07 07:50:57 rillig Exp $");
MAKE_RCSID("$NetBSD: suff.c,v 1.383 2025/01/14 21:39:24 rillig Exp $");

typedef List SuffixList;
typedef ListNode SuffixListNode;
Expand Down Expand Up @@ -1343,7 +1343,7 @@ ExpandChildren(GNodeListNode *cln, GNode *pgn)
}

DEBUG1(SUFF, "Expanding \"%s\"...", cgn->name);
expanded = Var_Subst(cgn->name, pgn, VARE_EVAL_DEFINED);
expanded = Var_Subst(cgn->name, pgn, VARE_EVAL);
/* TODO: handle errors */

{
Expand Down
4 changes: 2 additions & 2 deletions usr.bin/make/unit-tests/suff.exp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ SuffFindDeps "edge-case.to"
trying edge-case.from...got it
edge-case.to: @ = edge-case.to
edge-case.to: * = edge-case
Expanding "${.PREFIX}${.ARCHIVE}.additional"...Var_Parse: ${.PREFIX}${.ARCHIVE}.additional (eval-defined)
Var_Parse: ${.ARCHIVE}.additional (eval-defined)
Expanding "${.PREFIX}${.ARCHIVE}.additional"...Var_Parse: ${.PREFIX}${.ARCHIVE}.additional (eval)
Var_Parse: ${.ARCHIVE}.additional (eval)
edge-case.additional...
applying .from -> .to to "edge-case.to"
everything: @ = everything
Expand Down
4 changes: 2 additions & 2 deletions usr.bin/make/unit-tests/suff.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# $NetBSD: suff.mk,v 1.2 2025/01/12 23:10:30 rillig Exp $
# $NetBSD: suff.mk,v 1.3 2025/01/14 21:39:25 rillig Exp $
#
# Demonstrate suffix rules and dependency resolution.

Expand Down Expand Up @@ -30,7 +30,7 @@ step1: .PHONY edge-case.to everything
: Making ${.TARGET} from ${.ALLSRC}.

# When making this target, ${.ARCHIVE} is undefined, but there's no warning.
# expect: Var_Parse: ${.ARCHIVE}.additional (eval-defined)
# expect: Var_Parse: ${.ARCHIVE}.additional (eval)
edge-case.to: ${.PREFIX}${.ARCHIVE}.additional

edge-case.from edge-case.additional:
Expand Down

0 comments on commit 72eb8b1

Please sign in to comment.