bug-make
[Top][All Lists]
Advanced

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

Re: basename function in 4.3 cygwin


From: Eli Zaretskii
Subject: Re: basename function in 4.3 cygwin
Date: Fri, 21 May 2021 18:04:00 +0300

> From: Ronald Hoogenboom <RHoogenboom@irdeto.com>
> Date: Fri, 21 May 2021 14:46:00 +0000
> 
> small makefile to produce what I mean:
> ------------ cut here ---------------
> TRY=APP.BA\x BPP.BB\y
> 
> all:
>         @echo $(foreach x,$(TRY),$(firstword $(subst ., ,$x)))
> 
> none:
>         @echo $(basename $(TRY))
> ------------- cut here ---------------
> 
> "make all" does my workaround "make none" does the 'native' basename.
> 
> expect
> APP BPP
> 
> since 4.x window/cygwin
> APP.BA\x BPP.BB\y

This is according to the documentation:

  '$(basename NAMES...)'
       Extracts all but the suffix of each file name in NAMES.  If the
       file name contains a period, the basename is everything starting up
       to (and not including) the last period.  Periods in the directory
       part are ignored.  If there is no period, the basename is the
       entire file name.  For example,

            $(basename src/foo.c src-1.0/bar hacks)

       produces the result 'src/foo src-1.0/bar hacks'.

"Periods in the directory part are ignored."  Which is what you have:
the file-name extensions are in the directory names, not the file
names.




reply via email to

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