Here is a summary of the features of GNU
make, for comparison
with and credit to other versions of
make. We consider the
make in 4.2 BSD systems as a baseline. If you are
concerned with writing portable makefiles, you should not use the
make listed here, nor the ones in Missing.
Many features come from the version of
make in System V.
VPATHvariable and its special meaning. See Searching Directories for Prerequisites. This feature exists in System V
make, but is undocumented. It is documented in 4.3 BSD
make(which says it mimics System V’s
MAKEFLAGSto recursive invocations of
make. See Communicating Options to a Sub-
$%is set to the member name in an archive reference. See Automatic Variables.
$?have corresponding forms like
$(@D). We have generalized this to
$^as an obvious extension. See Automatic Variables.
-b’ and ‘
-m’, accepted and ignored. In System V
make, these options actually do something.
makevia the variable
MAKEeven if ‘
-q’ or ‘
-t’ is specified. See Recursive Use of
.a’ in suffix rules. See Archive Suffix Rules. This feature is obsolete in GNU
make, because the general feature of rule chaining (see Chains of Implicit Rules) allows one pattern rule for installing members in an archive (see Archive Update) to be sufficient.
The following features were inspired by various other versions of
make. In some cases it is unclear exactly which versions inspired
%’. This has been implemented in several versions of
make. We’re not sure who invented it first, but it’s been spread around a bit. See Defining and Redefining Pattern Rules.
makefor AT&T Eighth Edition Research Unix, and later by Andrew Hume of AT&T Bell Labs in his
mkprogram (where he terms it “transitive closure”). We do not really know if we got this from either of them or thought it up ourselves at the same time. See Chains of Implicit Rules.
$^containing a list of all prerequisites of the current target. We did not invent this, but we have no idea who did. See Automatic Variables. The automatic variable
$+is a simple extension of
-W’ in GNU
make) was (as far as we know) invented by Andrew Hume in
mk. See Instead of Executing Recipes.
makeand similar programs, though not in the System V or BSD implementations. See Recipe Execution.
patsubstfunction before the alternate syntax was implemented for compatibility with SunOS 4. It is not altogether clear who inspired whom, since GNU
patsubstbefore SunOS 4 was released.
+’ characters preceding recipe lines (see Instead of Executing Recipes) is mandated by IEEE Standard 1003.2-1992 (POSIX.2).
+=’ syntax to append to the value of a variable comes from SunOS 4
make. See Appending More Text to Variables.
archive(mem1 mem2…)’ to list multiple members in a single archive file comes from SunOS 4
make. See Archive Members.
-includedirective to include makefiles with no error for a nonexistent file comes from SunOS 4
make. (But note that SunOS 4
makedoes not allow multiple makefiles to be specified in one
-includedirective.) The same feature appears with the name
makeand perhaps others.
!=shell assignment operator exists in many BSD of
makeand is purposefully implemented here to behave identically to those implementations.
make’s integration of GNU Guile.
The remaining features are inventions new in GNU
-v’ or ‘
--version’ option to print version and copyright information.
-h’ or ‘
--help’ option to summarize the options to
makeinvocations. See Recursive Use of
-C’ or ‘
--directory’ command option to change directory. See Summary of Options.
define. See Defining Multi-Line Variables.
Declare phony targets with the special target
Andrew Hume of AT&T Bell Labs implemented a similar feature with a
different syntax in his
mk program. This seems to be a case of
parallel discovery. See Phony Targets.
-o’ or ‘
--old-file’ option to pretend a file’s modification-time is old. See Avoiding Recompilation of Some Files.
This feature has been implemented numerous times in various versions
make; it seems a natural extension derived from the features
of the C preprocessor and similar macro languages and is not a
revolutionary concept. See Conditional Parts of Makefiles.
./’ from file names, so that
fileare considered to be the same file.
-lname’. See Directory Search for Link Libraries.
make, they must begin with ‘
.’ and not contain any ‘
makerecursion using the variable
MAKELEVEL. See Recursive Use of
MAKECMDGOALS. See Arguments to Specify the Goals.
vpathsearch. See Searching Directories for Prerequisites.
makehas a very, very limited form of this functionality in that it will check out SCCS files for makefiles.
make. See Loading Dynamic Objects.