On Sat, 2021-02-13 at 19:35 +0100, Christof Warlich wrote: > Obviously, make knows that it is supposed to build a target with a > space, but this information got lost within the variable > MAKECMDGOALS. > > Can I fix my simple example to handle this case in a generic way? As > much as I could figure so far, it seems to be impossible, right?
It's basically impossible for make to handle target names with whitespace in them. This has been true ever since make was invented back in the 1970's and is still true today (for all modern versions of POSIX-based make, including GNU make). Issues with MAKECMDGOALS are just the tip of the iceberg. There have been various proposals made to try to resolve this; there was one I made in a really long thread a number of years ago that relied on (a) makefiles being UTF8 and (b) making some UTF8 characters illegal in makefiles (for example some of the low control characters). But providing a syntax that works is not easy.