URL: <https://savannah.gnu.org/bugs/?62278>
Summary: Fix % substitution in static pattern rules. Project: make Submitted by: dgoncharov Submitted on: Sat 09 Apr 2022 03:30:51 PM UTC Severity: 3 - Normal Item Group: Bug Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Component Version: SCM Operating System: Any Fixed Release: None Triage Status: None _______________________________________________________ Details: When second expansion is enabled make substitutes all instances of a '%' in each prerequisite of a static pattern rule. ++++ $ cat makefile .SECONDEXPANSION: all: hello.x hello.x: %.x: $$(wordlist 1, 99, %_%_%.1 %_%_%.2); $(info $@ from $^) $ /usr/bin/make make: *** No rule to make target 'hello_hello_hello.1', needed by 'hello.x'. Stop. ---- This patch 1. Causes make to substitute only the first instance of '%' in each prerequisite of a static pattern rule when second expansion is enabled. So, the example above results in ++++ $ ~/src/gmake/make/l64/make make: *** No rule to make target 'hello_%_%.1', needed by 'hello.x'. Stop. ---- 2. Adds a set of tests to verify that stem substitution is the same whether second expansion is enabled or not. 3. Fixes a memory leak in expand_deps _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?62278> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/