summaryrefslogtreecommitdiff
path: root/build-aux/no-builtin-variables.mk
blob: c236c7394b6b9204e3cfe5957f34e6cf0fcfc8ef (plain)
1
2
3
4
5
6
7
8
9
10
11
MAKEFLAGS += --no-builtin-variables

# This version is more correct, but is slower:
#   $(foreach v,$(shell bash -c 'comm -23 <(env -i $(MAKE) -f - <<<"\$$(info \$$(.VARIABLES))all:"|sed "s/ /\n/g"|sort) <(env -i $(MAKE) -R -f - <<<"\$$(info \$$(.VARIABLES))all:"|sed "s/ /\n/g"|sort)'),
#     $(if $(filter default,$(origin $v)),$(eval undefine $v)))

_default_variables = $(foreach v,$(.VARIABLES),$(if $(filter default,$(origin $v)),$v))
$(foreach v,$(filter-out .% MAKE% SUFFIXES,$(_default_variables))\
            $(filter .LIBPATTERNS MAKEINFO,$(_default_variables)),\
  $(eval undefine $v))
undefine _default_variables