From 40846b49c8de41dea720ef1bebd3bbee512f3b3e Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Mon, 13 May 2013 02:48:18 -0400 Subject: Add a new variable: GNUMAKEFLAGS This allows you to write portable makefiles that set GNU make-specific command line options in the environment or makefile: add them to GNUMAKEFLAGS instead of MAKEFLAGS and they will be seen by GNU make but ignored by other implementations of make. --- tests/scripts/variables/GNUMAKEFLAGS | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/scripts/variables/GNUMAKEFLAGS (limited to 'tests') diff --git a/tests/scripts/variables/GNUMAKEFLAGS b/tests/scripts/variables/GNUMAKEFLAGS new file mode 100644 index 00000000..7bfd8227 --- /dev/null +++ b/tests/scripts/variables/GNUMAKEFLAGS @@ -0,0 +1,24 @@ +# -*-perl-*- + +$description = "Test proper behavior of GNUMAKEFLAGS"; + +# Accept flags from GNUMAKEFLAGS as well as MAKEFLAGS +# Results always go in MAKEFLAGS + +$extraENV{'GNUMAKEFLAGS'} = '-e -r -R'; + +run_make_test(q! +all: ; @echo $(MAKEFLAGS) +!, + '', 'Rre'); + +# Long arguments mean everything is prefixed with "-" + +$extraENV{'GNUMAKEFLAGS'} = '--no-print-directory -e -r -R --trace=none --trace=dir'; + +run_make_test(q! +all: ; @echo $(MAKEFLAGS) +!, + '', '--no-print-directory --trace=none --trace=dir --trace=none --trace=dir -Rre'); + +1; -- cgit v1.2.1