bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #62278] Fix % substitution in static pattern rules.


From: Dmitry Goncharov
Subject: [bug #62278] Fix % substitution in static pattern rules.
Date: Sat, 9 Apr 2022 11:30:53 -0400 (EDT)

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/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]