I have a list of filenames:

FILES := a.b c.d e.f

and I want to remove the extensions (suffixes) of all words to obtain:

a c e

what is the best way to do that?

The best I could come up with was "cheating" with shell:

$(shell for f in $(INS_NODIR); do echo -n "$${f%.*} "; done )

but I am surprised there was not a more "built-in" way of doing this only with make built-in functions.

thing I tried:

  • patsubst. It seems that it can only have one single wildcard, others being treated literally, and I'd like to do something like %.%, %

  • looking for a notsufix function.

    I was surprised that this does not exist, since the dir function has notdir counterpart, but the suffix function that exactly extracts extensions does not have a notsuffix counterpart

Edit
Report