Setting locale
Frank Heckenbach <[email protected]> Fri, 10 Jul 2026 09:06:31 +0200
| Newsgroups | gmane.comp.gnu.make.bugs |
|---|---|
| Message-ID | <E1wi5Jf-00000007qnN-3SIQ@mars> |
When setting the locale via LC_MESSAGES or LC_ALL etc., this affects both make's own messages such as "Entering directory" and those from commands run by it (here: "total" from ls), e.g.: % cat Makefile test: @ls -l % make -C. make: Entering directory '/tmp' total 4 -rw------- 1 frank frank 14 Jul 10 08:48 Makefile make: Leaving directory '/tmp' % LC_MESSAGES=de_DE make -C. make: Verzeichnis ,,/tmp" wird betreten insgesamt 4 -rw------- 1 frank frank 14 Jul 10 08:48 Makefile make: Verzeichnis ,,/tmp" wird verlassen Is there a way to change only one of them? (Background: I want make's messages always in English so I can parse them in a wrapper script, in particular the directory messages so the scripts knows which directories to prepend to filenames in messages. But I don't want to affect the output of commands run.) When I asked AI, it hallucinated an option "make --locale=C". Unless there is already a way to do this, this would seem a useful option to implement. I think you'd only need to pass its value as the second argument to setlocale(). Regards, Frank