GNU Make 4.0 adds Guile & output-sync, breaks fewer things
Can the ubiquitous compiling tool
New releases of Make, that trusty command-line tool for compiling source code, are so rare that they are notable for their mere existence, let alone any new features.
Created by Stuart Feldman in 1977, the most commonly-used version of the program is now GNU Make. With age comes maturity, and as such, development now takes place at a glacial pace, with only two releases over the past decade.
The latter, 3.82, was panned for breaking backwards compatibility in many places without providing much reason to upgrade. Luckily, v4.0 appears to be more enticing, with some useful new features. The highlight is integration with GNU Guile, an extension language created two decades ago but given a makeover in 2011 with Guile 2.0.
In way of command line options, –output-sync (-O) is probably the most notable, grouping output by target or recursive make to prevent confusing mixed message from different jobs. Other changes include –trace, which enables tracing of targets; adding the n flag to –debug will now disable all debugging settings; and setting the -r and -R options in MAKEFLAGS inside a makefile (to remove built-in rules and variables) now “works as expected”.
For Windows users, the jobserver capability,
which helps build programs with many subdirectories, and the
.ONESHELL capability, which passes all lines of a recipe to a
single shell, are now both supported.
However, one addition to Make 4.0 that may raise some eyebrows is !=, a new a shell assignment operator similar to $(shell …), added for “compatibility with BSD makefiles”. The release notes recommend to ensure there is whitespace between variables ending with ! and the = assignment operator (for example, variable!= value would break).
Another strange new operator is ::=, a newly-defined POSIX standard that’s identical to := in function. Less inexplicable is $(file …), a new function which – as the name suggests – writes to a file.
For keen early adopters, the new release is now available to download. For everyone else, it could take a while to make its way to your OS of choice: the latest versions of Ubuntu and OS X still ship with a seven-year-old version of Make.