michael@0: #T commandline: ['-w', 'OVAR=oval'] michael@0: michael@0: OVAR=mval michael@0: michael@0: all: vartest run-override michael@0: $(MAKE) -f $(TESTPATH)/override-propagate.mk vartest michael@0: @echo TEST-PASS michael@0: michael@0: CLINE := OVAR=oval TESTPATH=$(TESTPATH) NATIVE_TESTPATH=$(NATIVE_TESTPATH) michael@0: ifdef __WIN32__ michael@0: CLINE += __WIN32__=1 michael@0: endif michael@0: michael@0: SORTED_CLINE := $(subst \,\\,$(sort $(CLINE))) michael@0: michael@0: vartest: michael@0: @echo MAKELEVEL: '$(MAKELEVEL)' michael@0: test '$(value MAKEFLAGS)' = 'w -- $$(MAKEOVERRIDES)' michael@0: test '$(origin MAKEFLAGS)' = 'file' michael@0: test '$(value MAKEOVERRIDES)' = '$${-*-command-variables-*-}' michael@0: test "$(sort $(MAKEOVERRIDES))" = "$(SORTED_CLINE)" michael@0: test '$(origin MAKEOVERRIDES)' = 'environment' michael@0: test '$(origin -*-command-variables-*-)' = 'automatic' michael@0: test "$(origin OVAR)" = "command line" michael@0: test "$(OVAR)" = "oval" michael@0: michael@0: run-override: MAKEOVERRIDES= michael@0: run-override: michael@0: test "$(OVAR)" = "oval" michael@0: $(MAKE) -f $(TESTPATH)/override-propagate.mk otest michael@0: michael@0: otest: michael@0: test '$(value MAKEFLAGS)' = 'w' michael@0: test '$(value MAKEOVERRIDES)' = '$${-*-command-variables-*-}' michael@0: test '$(MAKEOVERRIDES)' = '' michael@0: test '$(origin -*-command-variables-*-)' = 'undefined' michael@0: test "$(OVAR)" = "mval"