GNU Make makes it to 4.3


GNU Make 4.3 shot out of the door this weekend, promising a raft of bug fixes and a smattering of new features. 

The venerable build automation tool has been around in one form or another for 43 years, which makes the latest version number particularly appropriate. The previous update was 4.2.1 back in 2016.

New features include grouped explicit targets for explicit rules, via a single invocation. Pattern rules have always had the ability to do this. Also new is an .EXTRA_PREREQS variable, which can either be global, applying to all targets, or a target-specific variable. 

The previous limit of 63 jobs under -jN on MS-Windows has been increased to 4095. That limit includes the subprocess started by the $(shell) function, the make team adds.

Meanwhile, error messages printed “when invoking non-existent commands have been cleaned up and made consistent.”

There are also a couple of backward incompatibilities, and deprecated behaviours. One of these occurred when appending ‘+=’ to an empty variable, which resulted in a value starting with a space.  Now the initial space is only added if the variable already contains some value. Similarly, appending an empty string no longer adds a trailing space.

Also nixed is a situation where “Contrary to the documentation, suffix rules with prerequisites are being treated BOTH as simple targets AND as pattern rules. Further, the prerequisites are ignored by the pattern rules.” This is out of line with POSIX rules. In the new release, “if POSIX mode is enabled then rules with prerequisites cannot be suffix rules.” If POSIX mode is NOT enabled, this behaviour is preserved. A future release will adopt only the POSIX behaviour.

The latest version can be found here.