bugmake - Bugs: bug #66381, Stem splitting and directory...

 
 

bug #66381: Stem splitting and directory prefix reconstruction for static pattern rules.

Submitter:  Dmitry Goncharov <dgoncharov>
Submitted:  Sat 26 Oct 2024 08:38:30 PM UTC
   
 
Severity:  3 - Normal Priority:  5 - Normal
Item Group:  Enhancement Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Component Version:  SCM
Operating System:  Any Fixed Release:  None
Triage Status:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Sun 27 Oct 2024 06:05:06 AM UTC, comment #2: 

The proposed patch will not work well on MS-Windows: it assumes that '/' is the only possible directory separator character, and it ignores the possibility of a drive letter in file names.

I hope these non-portable aspects will be fixed before this enhancement is accepted.

Eli Zaretskii <eliz>
Group Member
Sat 26 Oct 2024 08:43:21 PM UTC, comment #1: 

This commit introduces two user visible changes.

1. Split the stem for static pattern rules to dirname and basename.
With this feature static pattern rules do the same stem splitting and directory
prefix reconstruction as implicit search does for pattern rules.
This feature allows the same static pattern rule be used for targets in
different directories and with different prefixes.


$ ls
makefile
$ cat makefile
.SPLIT_STEM_FOR_STATIC_PATTERN_RULES:
obj:=drivers/hello.x pilots/video/world.x
all:$(obj)
$(obj): %.x: pre-%.q .%.d; $(info $@ from $^)
drivers/pre-hello.q drivers/.hello.d pilots/video/pre-world.q pilots/video/.world.d:;
$ make
drivers/hello.x from drivers/pre-hello.q drivers/.hello.d
pilots/video/world.x from pilots/video/pre-world.q pilots/video/.world.d
make: Nothing to be done for 'all'.


Suggested by Masahiro Yamada <masahiroy@kernel.org>.
https://lists.gnu ... -06/msg00018.html.


2. Allow a backslash to escape % in a prerequisite pattern of a static pattern
rule when second expansion is enabled. This allows static pattern rules to have
the same behavior whether second expansion is enabled or not.



$ ls
makefile
$ cat makefile

.SECONDEXPANSION:
all: hello.x
hello.x: %.x: $$(strip \%-%.q); $(info $@ from $<)
%-hello.q:;
$ make
hello.x from %-hello.q
make: Nothing to be done for 'all'.



Dmitry Goncharov <dgoncharov>
Sat 26 Oct 2024 08:38:30 PM UTC, original submission:  

.

Dmitry Goncharov <dgoncharov>

 

Attached Files

Attached Files
file #56575:  sv66381_split_stem.diff added by dgoncharov (50KiB - text/x-patch)

(Note: upload size limit is set to 4.0MiB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by eliz (Posted a comment)
  • -email is unavailable- added by dgoncharov (Submitted the item)
  •  

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    History

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-10-26 dgoncharov Attached File- Added sv66381_split_stem.diff, #56575

    Back to the top

    Powered by Savane 3.16-ed84.
    Corresponding source code