tech-pkg archive

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

Re: Cryptic idiom




On 19/12/2025 06:35, Frédéric Fauberteau wrote:
Hi,

I am not sur to understand this idiom in mk/tools/replace.mk:

```
.  elif defined(TOOLS_PLATFORM.${_t_}) && !empty(TOOLS_PLATFORM.${_t_})
#####
##### For each system-supplied tool, break the tool down into a path
##### and arguments so that either a symlink or a wrapper will be
##### properly created.
#####
TOOLS_CREATE+=    ${_t_}
TOOLS_PATH.${_t_}?= \
   ${TOOLS_PLATFORM.${_t_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}
TOOLS_ARGS.${_t_}?= \
   ${TOOLS_PLATFORM.${_t_}:C/^/_asdf_/1:N_asdf_*}
.  endif
```

Given that TOOLS_PLATFORM.${_t_} is defined and not empty, how could applying ":C/^/_asdf_/1:M_asdf_*:S/^_asdf_//" produce anything other than TOOLS_PLATFORM.${_t_} itself?

It selects the first word in TOOLS_PLATFORM.${_t_} in the case that it is a sequence of words.

Ngā mihi, Lloyd



Home | Main Index | Thread Index | Old Index