#1149601 make: internal warning: undefined variable 'GNUMAKEFLAGS'

Package:
make
Source:
make
Description:
utility for directing compilation
Submitter:
Federico Kircheis
Date:
2026-10-01 13:07:02 UTC
Severity:
normal
#1149601#5
Date:
2026-10-01 13:04:54 UTC
From:
To:
Dear Maintainer,


here is a minimal example to reproduce the issue


~~~~
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-variables

define HELP_TEXT
Some text to be "printed" on the
console
endef

PAGER := /usr/bin/less --quit-if-one-screen

.PHONY: help .help
help:
	@$(MAKE) --no-print-directory .help | $(PAGER)

.help:
	@:
	$(info $(HELP_TEXT))
~~~~


when executing "make help", make prints

make[1]: warning: undefined variable 'GNUMAKEFLAGS'

I'm using "--warn-undefined-variables" to avoid errors on my side, since
I do not access GNUMAKEFLAGS directly, it seems that some internal logic
of make is accessing an undefined variable.

Ideally make would either define the variable if it needs it, or avoid
accessing it if it does not need it.