GNU Make Changelog

What's new in GNU Make 4.0

Oct 9, 2013
  • WARNING: Backward-incompatibility! If .POSIX is specified, then make adheres to the POSIX backslash/newline handling requirements, which introduces the following changes to the standard backslash/newline handling in non-recipe lines: * Any trailing space before the backslash is preserved * Each backslash/newline (plus subsequent whitespace) is converted to a single space
  • New feature: GNU Guile integration This version of GNU make can be compiled with GNU Guile integration. GNU Guile serves as an embedded extension language for make. See the "Guile Function" section in the GNU Make manual for details. Currently GNU Guile 1.8 and 2.0+ are supported. In Guile 1.8 there is no support for internationalized character sets. In Guile 2.0+, scripts can be encoded in UTF-8.
  • New command line option: --output-sync (-O) enables grouping of output by target or by recursive make. This is useful during parallel builds to avoid mixing output from different jobs together giving hard-to-understand results. Original implementation by David Boyce . Reworked and enhanced by Frank Heckenbach . Windows support by Eli Zaretskii .
  • New command line option: --trace enables tracing of targets. When enabled the recipe to be invoked is printed even if it would otherwise be suppressed by .SILENT or a "@" prefix character. Also before each recipe is run the makefile name and linenumber where it was defined are shown as well as the prerequisites that caused the target to be considered out of date.
  • New command line option argument: --debug now accepts a "n" (none) flag which disables all debugging settings that are currently enabled.
  • New feature: The "job server" capability is now supported on Windows. Implementation contributed by Troy Runkel
  • New feature: The .ONESHELL capability is now supported on Windows. Support added by Eli Zaretskii .
  • New feature: "!=" shell assignment operator as an alternative to the $(shell ...) function. Implemented for compatibility with BSD makefiles. Note there are subtle differences between "!=" and $(shell ...). See the description in the GNU make manual. WARNING: Backward-incompatibility! Variables ending in "!" previously defined as "variable!= value" will now be interpreted as shell assignment. Change your assignment to add whitespace between the "!" and "=": "variable! = value"
  • New feature: "::=" simple assignment operator as defined by POSIX in 2012. This operator has identical functionality to ":=" in GNU make, but will be portable to any implementation of make conforming to a sufficiently new version of POSIX (see http://austingroupbugs.net/view.php?id=330). It is not necessary to define the .POSIX target to access this operator.
  • New feature: Loadable objects This version of GNU make contains a "technology preview": the ability to load dynamic objects into the make runtime. These objects can be created by the user and can add extended functionality, usable by makefiles.
  • New function: $(file ...) writes to a file.
  • New variable: $(GNUMAKEFLAGS) will be parsed for make flags, just like MAKEFLAGS is. It can be set in the environment or the makefile, containing GNU make-specific flags to allow your makefile to be portable to other versions of make. Once this variable is parsed, GNU make will set it to the empty string so that flags will not be duplicated on recursion.
  • New variable: `MAKE_HOST' gives the name of the host architecture make was compiled for. This is the same value you see after 'Built for' when running 'make --version'.
  • Behavior of MAKEFLAGS and MFLAGS is more rigorously defined. All simple flags are grouped together in the first word of MAKEFLAGS. No options that accept arguments appear in the first word. If no simple flags are present MAKEFLAGS begins with a space. Flags with both short and long versions always use the short versions in MAKEFLAGS. Flags are listed in alphabetical order using ASCII ordering. MFLAGS never begins with "- ".
  • Setting the -r and -R options in MAKEFLAGS inside a makefile now works as expected, removing all built-in rules and variables, respectively.
  • If a recipe fails, the makefile name and linenumber of the recipe are shown.
  • A .RECIPEPREFIX setting is remembered per-recipe and variables expanded in that recipe also use that recipe prefix setting.
  • In -p output, .RECIPEPREFIX settings are shown and all target-specific variables are output as if in a makefile, instead of as comments.
  • On MS-Windows, recipes that use ".." quoting will no longer force invocation of commands via temporary batch files and stock Windows shells, they will be short-circuited and invoked directly. (In other words, " is no longer a special character for stock Windows shells.) This avoids hitting shell limits for command length when quotes are used, but nothing else in the command requires the shell. This change could potentially mean some minor incompatibilities in behavior when the recipe uses quoted string on shell command lines.