# This file is a hack to let us pass whatever flags we want to Make,
# since adjusting MAKEFLAGS at runtime only half-works.

ifeq ($(filter grouped-target,$(.FEATURES)),)
$(error We need a version of Make that supports 'grouped-target')
endif

# The flags that we actually want to pass to Make.
desired_MAKEFLAGS  = --no-builtin-rules
desired_MAKEFLAGS += --no-builtin-variables
desired_MAKEFLAGS += --warn-undefined-variables
# Setting GNUMAKEFLAGS is important so that --no-builtin-variables
# with --warn-undefined-variables doesn't cause Make (as of 4.4.1) to
# print spurious warnings about it being undefined for internal use.
desired_MAKEFLAGS += GNUMAKEFLAGS=''

# Quiet this parent Make a bit.
MAKEFLAGS += --no-print-directory

# Main.
$(or $(MAKECMDGOALS),default) &:
	@$(MAKE) -f Makefile $(desired_MAKEFLAGS) $(MAKECMDGOALS)
.PHONY: $(or $(MAKECMDGOALS),default)
