1 GNU make NEWS -*-indented-text-*-
2 History of user-visible changes.
5 Copyright (C) 1992,93,94,95,96,97,98,1999 Free Software Foundation, Inc.
6 See the end for copying conditions.
8 All changes mentioned here are more fully described in the GNU make
9 manual, which is contained in this distribution as the file make.texinfo.
11 Please send GNU make bug reports to bug-make@gnu.org.
15 * Two new functions, $(error ...) and $(warning ...) are available. The
16 former will cause make to fail and exit immediately upon expansion of
17 the function, with the text provided as the error message. The latter
18 causes the text provided to be printed as a warning message, but make
21 * A new function $(call ...) is available. This allows users to create
22 their own parameterized macros and invoke them later. Original
23 implementation of this function was provided by Han-Wen Nienhuys
26 * A new function $(if ...) is available. It provides if-then-else
27 capabilities in a builtin function. Original implementation of this
28 function was provided by Han-Wen Nienhuys <hanwen@cs.uu.nl>.
30 * Make defines a new variable, .LIBPATTERNS. This variable controls how
31 library dependency expansion (dependencies like ``-lfoo'') is performed.
33 * Make accepts CRLF sequences as well as traditional LF, for
34 compatibility with makefiles created on other operating systems.
36 * Make accepts a new option: -R, or --no-builtin-variables. This option
37 disables the definition of the rule-specific builtin variables (CC,
38 LD, AR, etc.). Specifying this option forces -r (--no-builtin-rules)
41 * A "job server" feature, suggested by Howard Chu <hyc@highlandsun.com>.
43 On systems that support POSIX pipe(2) semantics, GNU make can now pass
44 -jN options to submakes rather than forcing them all to use -j1. The
45 top make and all its sub-make processes use a pipe to communicate with
46 each other to ensure that no more than N jobs are started across all
47 makes. To get the old behavior of -j back, you can configure make
48 with the --disable-job-server option.
50 * The confusing term "dependency" has been replaced by the more accurate
51 and standard term "prerequisite", both in the manual and in all GNU make
56 * Implement BSD make's "?=" variable assignment operator. The variable
57 is assigned the specified value only if that variable is not already
60 * Make defines a new variable, "CURDIR", to contain the current working
61 directory (after the -C option, if any, has been processed).
62 Modifying this variable has no effect on the operation of make.
64 * Make defines a new default RCS rule, for new-style master file
65 storage: ``% :: RCS/%'' (note no ``,v'' suffix).
67 Make defines new default rules for DOS-style C++ file naming
68 conventions, with ``.cpp'' suffixes. All the same rules as for
69 ``.cc'' and ``.C'' suffixes are provided, along with LINK.cpp and
70 COMPILE.cpp macros (which default to the same value as LINK.cc and
71 COMPILE.cc). Note CPPFLAGS is still C preprocessor flags! You should
72 use CXXFLAGS to change C++ compiler flags.
74 * A new feature, "target-specific variable values", has been added.
75 This is a large change so please see the appropriate sections of the
76 manual for full details. Briefly, syntax like this:
78 TARGET: VARIABLE = VALUE
80 defines VARIABLE as VALUE within the context of TARGET. This is
81 similar to SunOS make's "TARGET := VARIABLE = VALUE" feature. Note
82 that the assignment may be of any type, not just recursive, and that
83 the override keyword is available.
85 COMPATIBILITY: This new syntax means that if you have any rules where
86 the first or second dependency has an equal sign (=) in its name,
87 you'll have to escape them with a backslash: "foo : bar\=baz".
88 Further, if you have any dependencies which already contain "\=",
89 you'll have to escape both of them: "foo : bar\\\=baz".
91 * A new appendix listing the most common error and warning messages
92 generated by GNU make, with some explanation, has been added to the
93 GNU make User's Manual.
95 * Updates to the GNU make Customs library support (see README.customs).
97 * Updates to the Windows 95/NT port from Rob Tulloh (see README.W32),
98 and to the DOS port from Eli Zaretski (see README.DOS).
102 * Small (but serious) bug fix. Quick rollout to get into the GNU source CD.
106 * GNU make now uses automake to control Makefile.in generation. This
107 should make it more consistent with the GNU standards.
109 * VPATH functionality has been changed to incorporate the VPATH+ patch,
110 previously maintained by Paul Smith <psmith@baynetworks.com>. See the
113 * Make defines a new variable, `MAKECMDGOALS', to contain the goals that
114 were specified on the command line, if any. Modifying this variable
115 has no effect on the operation of make.
117 * A new function, `$(wordlist S,E,TEXT)', is available: it returns a
118 list of words from number S to number E (inclusive) of TEXT.
120 * Instead of an error, detection of future modification times gives a
121 warning and continues. The warning is repeated just before GNU make
122 exits, so it is less likely to be lost.
124 * Fix the $(basename) and $(suffix) functions so they only operate on
125 the last filename, not the entire string:
127 Command Old Result New Result
128 ------- ---------- ----------
130 $(basename a.b/c) a a.b/c
132 $(suffix a.b/c) b/c <empty>
134 * The $(strip) function now removes newlines as well as TABs and spaces.
136 * The $(shell) function now changes CRLF (\r\n) pairs to a space as well
139 * Updates to the Windows 95/NT port from Rob Tulloh (see README.W32).
141 * Eli Zaretskii has updated the port to 32-bit protected mode on MSDOS
142 and MS-Windows, building with the DJGPP v2 port of GNU C/C++ compiler
143 and utilities. See README.DOS for details, and direct all questions
144 concerning this port to Eli Zaretskii <eliz@is.elta.co.il> or DJ
145 Delorie <dj@delorie.com>.
147 * John W. Eaton has updated the VMS port to support libraries and VPATH.
151 * The directory messages printed by `-w' and implicitly in sub-makes,
152 are now omitted if Make runs no commands and has no other messages to print.
154 * Make now detects files that for whatever reason have modification times
155 in the future and gives an error. Files with such impossible timestamps
156 can result from unsynchronized clocks, or archived distributions
157 containing bogus timestamps; they confuse Make's dependency engine
160 * The new directive `sinclude' is now recognized as another name for
161 `-include', for compatibility with some other Makes.
163 * Aaron Digulla has contributed a port to AmigaDOS. See README.Amiga for
164 details, and direct all Amiga-related questions to <digulla@fh-konstanz.de>.
166 * Rob Tulloh of Tivoli Systems has contributed a port to Windows NT or 95.
167 See README.W32 for details, and direct all Windows-related questions to
168 <rob_tulloh@tivoli.com>.
172 * Converted to use Autoconf version 2, so `configure' has some new options.
173 See INSTALL for details.
175 * You can now send a SIGUSR1 signal to Make to toggle printing of debugging
176 output enabled by -d, at any time during the run.
180 * DJ Delorie has ported Make to MS-DOS using the GO32 extender.
181 He is maintaining the DOS port, not the GNU Make maintainer;
182 please direct bugs and questions for DOS to <djgpp@sun.soe.clarkson.edu>.
183 MS-DOS binaries are available for FTP from ftp.simtel.net in
184 /pub/simtelnet/gnu/djgpp/.
186 * The `MAKEFLAGS' variable (in the environment or in a makefile) can now
187 contain variable definitions itself; these are treated just like
188 command-line variable definitions. Make will automatically insert any
189 variable definitions from the environment value of `MAKEFLAGS' or from
190 the command line, into the `MAKEFLAGS' value exported to children. The
191 `MAKEOVERRIDES' variable previously included in the value of `$(MAKE)'
192 for sub-makes is now included in `MAKEFLAGS' instead. As before, you can
193 reset `MAKEOVERRIDES' in your makefile to avoid putting all the variables
194 in the environment when its size is limited.
196 * If `.DELETE_ON_ERROR' appears as a target, Make will delete the target of
197 a rule if it has changed when its commands exit with a nonzero status,
198 just as when the commands get a signal.
200 * The automatic variable `$+' is new. It lists all the dependencies like
201 `$^', but preserves duplicates listed in the makefile. This is useful
202 for linking rules, where library files sometimes need to be listed twice
205 * You can now specify the `.IGNORE' and `.SILENT' special targets with
206 dependencies to limit their effects to those files. If a file appears as
207 a dependency of `.IGNORE', then errors will be ignored while running the
208 commands to update that file. Likewise if a file appears as a dependency
209 of `.SILENT', then the commands to update that file will not be printed
210 before they are run. (This change was made to conform to POSIX.2.)
214 * The automatic variables `$(@D)', `$(%D)', `$(*D)', `$(<D)', `$(?D)', and
215 `$(^D)' now omit the trailing slash from the directory name. (This change
216 was made to comply with POSIX.2.)
218 * The source distribution now includes the Info files for the Make manual.
219 There is no longer a separate distribution containing Info and DVI files.
221 * You can now set the variables `binprefix' and/or `manprefix' in
222 Makefile.in (or on the command line when installing) to install GNU make
223 under a name other than `make' (i.e., ``make binprefix=g install''
224 installs GNU make as `gmake').
226 * The built-in Texinfo rules use the new variables `TEXI2DVI_FLAGS' for
227 flags to the `texi2dvi' script, and `MAKEINFO_FLAGS' for flags to the
230 * The exit status of Make when it runs into errors is now 2 instead of 1.
231 The exit status is 1 only when using -q and some target is not up to date.
232 (This change was made to comply with POSIX.2.)
236 * It is no longer a fatal error to have a NUL character in a makefile.
237 You should never put a NUL in a makefile because it can have strange
238 results, but otherwise empty lines full of NULs (such as produced by
239 the `xmkmf' program) will always work fine.
241 * The error messages for nonexistent included makefiles now refer to the
242 makefile name and line number where the `include' appeared, so Emacs's
243 C-x ` command takes you there (in case it's a typo you need to fix).
247 * Implicit rule search for archive member references is now done in the
248 opposite order from previous versions: the whole target name `LIB(MEM)'
249 first, and just the member name and parentheses `(MEM)' second.
251 * Make now gives an error for an unterminated variable or function reference.
252 For example, `$(foo' with no matching `)' or `${bar' with no matching `}'.
254 * The new default variable `MAKE_VERSION' gives the version number of
255 Make, and a string describing the remote job support compiled in (if any).
256 Thus the value (in this release) is something like `3.69' or `3.69-Customs'.
258 * Commands in an invocation of the `shell' function are no longer run with
259 a modified environment like target commands are. As in versions before
260 3.68, they now run with the environment that `make' started with. We
261 have reversed the change made in version 3.68 because it turned out to
262 cause a paradoxical situation in cases like:
264 export variable = $(shell echo value)
266 When Make attempted to put this variable in the environment for a target
267 command, it would try expand the value by running the shell command
268 `echo value'. In version 3.68, because it constructed an environment
269 for that shell command in the same way, Make would begin to go into an
270 infinite loop and then get a fatal error when it detected the loop.
272 * The commands given for `.DEFAULT' are now used for phony targets with no
277 * You can list several archive member names inside parenthesis:
278 `lib(mem1 mem2 mem3)' is equivalent to `lib(mem1) lib(mem2) lib(mem3)'.
280 * You can use wildcards inside archive member references. For example,
281 `lib(*.o)' expands to all existing members of `lib' whose names end in
282 `.o' (e.g. `lib(a.o) lib(b.o)'); `*.a(*.o)' expands to all such members
283 of all existing files whose names end in `.a' (e.g. `foo.a(a.o)
284 foo.a(b.o) bar.a(c.o) bar.a(d.o)'.
286 * A suffix rule `.X.a' now produces two pattern rules:
287 (%.o): %.X # Previous versions produced only this.
288 %.a: %.X # Now produces this as well, just like other suffixes.
290 * The new flag `--warn-undefined-variables' says to issue a warning message
291 whenever Make expands a reference to an undefined variable.
293 * The new `-include' directive is just like `include' except that there is
294 no error (not even a warning) for a nonexistent makefile.
296 * Commands in an invocation of the `shell' function are now run with a
297 modified environment like target commands are, so you can use `export' et
298 al to set up variables for them. They used to run with the environment
299 that `make' started with.
303 * `make --version' (or `make -v') now exits immediately after printing
308 * Make now supports long-named members in `ar' archive files.
312 * Make now supports the `+=' syntax for a variable definition which appends
313 to the variable's previous value. See the section `Appending More Text
314 to Variables' in the manual for full details.
316 * The new option `--no-print-directory' inhibits the `-w' or
317 `--print-directory' feature. Make turns on `--print-directory'
318 automatically if you use `-C' or `--directory', and in sub-makes; some
319 users have found this behavior undesirable.
321 * The built-in implicit rules now support the alternative extension
322 `.txinfo' for Texinfo files, just like `.texinfo' and `.texi'.
326 * Make now uses a standard GNU `configure' script. See the new file
327 INSTALL for the new (and much simpler) installation procedure.
329 * There is now a shell script to build Make the first time, if you have no
330 other `make' program. `build.sh' is created by `configure'; see README.
332 * GNU Make now completely conforms to the POSIX.2 specification for `make'.
334 * Elements of the `$^' and `$?' automatic variables that are archive
335 member references now list only the member name, as in Unix and POSIX.2.
337 * You should no longer ever need to specify the `-w' switch, which prints
338 the current directory before and after Make runs. The `-C' switch to
339 change directory, and recursive use of Make, now set `-w' automatically.
341 * Multiple double-colon rules for the same target will no longer have their
342 commands run simultaneously under -j, as this could result in the two
343 commands trying to change the file at the same time and interfering with
346 * The `SHELL' variable is now never taken from the environment.
347 Each makefile that wants a shell other than the default (/bin/sh) must
348 set SHELL itself. SHELL is always exported to child processes.
349 This change was made for compatibility with POSIX.2.
351 * Make now accepts long options. There is now an informative usage message
352 that tells you what all the options are and what they do. Try `make --help'.
354 * There are two new directives: `export' and `unexport'. All variables are
355 no longer automatically put into the environments of the commands that
356 Make runs. Instead, only variables specified on the command line or in
357 the environment are exported by default. To export others, use:
359 or you can define variables with:
360 export VARIABLE = VALUE
362 export VARIABLE := VALUE
366 .EXPORT_ALL_VARIABLES:
367 to get the old behavior. See the node `Variables/Recursion' in the manual
368 for a full description.
370 * The commands from the `.DEFAULT' special target are only applied to
371 targets which have no rules at all, not all targets with no commands.
372 This change was made for compatibility with Unix make.
374 * All fatal error messages now contain `***', so they are easy to find in
377 * Dependency file names like `-lNAME' are now replaced with the actual file
378 name found, as with files found by normal directory search (VPATH).
379 The library file `libNAME.a' may now be found in the current directory,
380 which is checked before VPATH; the standard set of directories (/lib,
381 /usr/lib, /usr/local/lib) is now checked last.
382 See the node `Libraries/Search' in the manual for full details.
384 * A single `include' directive can now specify more than one makefile to
387 You can also use shell file name patterns in an `include' directive:
390 * The default directories to search for included makefiles, and for
391 libraries specified with `-lNAME', are now set by configuration.
393 * You can now use blanks as well as colons to separate the directories in a
394 search path for the `vpath' directive or the `VPATH' variable.
396 * You can now use variables and functions in the left hand side of a
397 variable assignment, as in "$(foo)bar = value".
399 * The `MAKE' variable is always defined as `$(MAKE_COMMAND) $(MAKEOVERRIDES)'.
400 The `MAKE_COMMAND' variable is now defined to the name with which make
403 * The built-in rules for C++ compilation now use the variables `$(CXX)' and
404 `$(CXXFLAGS)' instead of `$(C++)' and `$(C++FLAGS)'. The old names had
405 problems with shells that cannot have `+' in environment variable names.
407 * The value of a recursively expanded variable is now expanded when putting
408 it into the environment for child processes. This change was made for
409 compatibility with Unix make.
411 * A rule with no targets before the `:' is now accepted and ignored.
412 This change was made for compatibility with SunOS 4 make.
413 We do not recommend that you write your makefiles to take advantage of this.
415 * The `-I' switch can now be used in MAKEFLAGS, and are put there
416 automatically just like other switches.
420 * Built-in rules for C++ source files with the `.C' suffix.
421 We still recommend that you use `.cc' instead.
423 * If commands are given too many times for a single target,
424 the last set given is used, and a warning message is printed.
426 * Error messages about makefiles are in standard GNU error format,
427 so C-x ` in Emacs works on them.
429 * Dependencies of pattern rules which contain no % need not actually exist
430 if they can be created (just like dependencies which do have a %).
434 * A message is always printed when Make decides there is nothing to be done.
435 It used to be that no message was printed for top-level phony targets
436 (because "`phony' is up to date" isn't quite right). Now a different
437 message "Nothing to be done for `phony'" is printed in that case.
439 * Archives on AIX now supposedly work.
441 * When the commands specified for .DEFAULT are used to update a target,
442 the $< automatic variable is given the same value as $@ for that target.
443 This is how Unix make behaves, and this behavior is mandated by POSIX.2.
447 * The -n, -q, and -t options are not put in the `MAKEFLAGS' and `MFLAG'
448 variables while remaking makefiles, so recursive makes done while remaking
449 makefiles will behave properly.
451 * If the special target `.NOEXPORT' is specified in a makefile,
452 only variables that came from the environment and variables
453 defined on the command line are exported.
457 * Suffix rules may have dependencies (which are ignored).
461 * Dependencies of the form `-lLIB' are searched for as /usr/local/lib/libLIB.a
462 as well as libLIB.a in /usr/lib, /lib, the current directory, and VPATH.
466 * There is now a Unix man page for GNU Make. It is certainly not a replacement
467 for the Texinfo manual, but it documents the basic functionality and the
468 switches. For full documentation, you should still read the Texinfo manual.
469 Thanks to Dennis Morse of Stanford University for contributing the initial
472 * Variables which are defined by default (e.g., `CC') will no longer be put
473 into the environment for child processes. (If these variables are reset by the
474 environment, makefiles, or the command line, they will still go into the
477 * Makefiles which have commands but no dependencies (and thus are always
478 considered out of date and in need of remaking), will not be remade (if they
479 were being remade only because they were makefiles). This means that GNU
480 Make will no longer go into an infinite loop when fed the makefiles that
481 `imake' (necessary to build X Windows) produces.
483 * There is no longer a warning for using the `vpath' directive with an explicit
484 pathname (instead of a `%' pattern).
488 * When removing intermediate files, only one `rm' command line is printed,
489 listing all file names.
491 * There are now automatic variables `$(^D)', `$(^F)', `$(?D)', and `$(?F)'.
492 These are the directory-only and file-only versions of `$^' and `$?'.
494 * Library dependencies given as `-lNAME' will use "libNAME.a" in the current
495 directory if it exists.
497 * The automatic variable `$($/)' is no longer defined.
499 * Leading `+' characters on a command line make that line be executed even
500 under -n, -t, or -q (as if the line contained `$(MAKE)').
502 * For command lines containing `$(MAKE)', `${MAKE}', or leading `+' characters,
503 only those lines are executed, not their entire rules.
504 (This is how Unix make behaves for lines containing `$(MAKE)' or `${MAKE}'.)
508 * Filenames in rules will now have ~ and ~USER expanded.
510 * The `-p' output has been changed so it can be used as a makefile.
511 (All information that isn't specified by makefiles is prefaced with comment
516 * The % character can be quoted with backslash in implicit pattern rules,
517 static pattern rules, `vpath' directives, and `patsubst', `filter', and
518 `filter-out' functions. A warning is issued if a `vpath' directive's
519 pattern contains no %.
521 * The `wildcard' variable expansion function now expands ~ and ~USER.
523 * Messages indicating failed commands now contain the target name:
524 make: *** [target] Error 1
526 * The `-p' output format has been changed somewhat to look more like
527 makefile rules and to give all information that Make has about files.
533 * The `-l' switch with no argument removes any previous load-average limit.
535 * When the `-w' switch is in effect, and Make has updated makefiles,
536 it will write a `Leaving directory' messagfe before re-executing itself.
537 This makes the `directory change tracking' changes to Emacs's compilation
538 commands work properly.
542 * The automatic variable `$*' is now defined for explicit rules,
543 as it is in Unix make.
547 * The `-j' switch is now put in the MAKEFLAGS and MFLAGS variables when
548 specified without an argument (indicating infinite jobs).
549 The `-l' switch is not always put in the MAKEFLAGS and MFLAGS variables.
551 * Make no longer checks hashed directories after running commands.
552 The behavior implemented in 3.41 caused too much slowdown.
556 * A dependency is NOT considered newer than its dependent if
557 they have the same modification time. The behavior implemented
558 in 3.43 conflicts with RCS.
562 * Dependency loops are no longer fatal errors.
564 * A dependency is considered newer than its dependent if
565 they have the same modification time.
569 * The variables F77 and F77FLAGS are now set by default to $(FC) and
570 $(FFLAGS). Makefiles designed for System V make may use these variables in
571 explicit rules and expect them to be set. Unfortunately, there is no way to
572 make setting these affect the Fortran implicit rules unless FC and FFLAGS
573 are not used (and these are used by BSD make).
577 * Make now checks to see if its hashed directories are changed by commands.
578 Other makes that hash directories (Sun, 4.3 BSD) don't do this.
582 * The `shell' function no longer captures standard error output.
586 * A file beginning with a dot can be the default target if it also contains
587 a slash (e.g., `../bin/foo'). (Unix make allows this as well.)
591 * Archive member names are truncated to 15 characters.
593 * Yet more USG stuff.
595 * Minimal support for Microport System V (a 16-bit machine and a
596 brain-damaged compiler). This has even lower priority than other USG
597 support, so if it gets beyond trivial, I will take it out completely.
599 * Revamped default implicit rules (not much visible change).
601 * The -d and -p options can come from the environment.
605 * Improved support for USG and HPUX (hopefully).
607 * A variable reference like `$(foo:a=b)', if `a' contains a `%', is
608 equivalent to `$(patsubst a,b,$(foo))'.
610 * Defining .DEFAULT with no deps or commands clears its commands.
612 * New default implicit rules for .S (cpp, then as), and .sh (copy and make
613 executable). All default implicit rules that use cpp (even indirectly), use
618 * Giving the -j option with no arguments gives you infinite jobs.
622 * New option: "-l LOAD" says not to start any new jobs while others are
623 running if the load average is not below LOAD (a floating-point number).
625 * There is support in place for implementations of remote command execution
626 in Make. See the file remote.c.
630 * No more than 10 directories will be kept open at once.
631 (This number can be changed by redefining MAX_OPEN_DIRECTORIES in dir.c.)
635 * Archive files will have their modification times recorded before doing
636 anything that might change their modification times by updating an archive
641 * The `MAKELEVEL' variable is defined for use by makefiles.
645 * The recursion level indications in error messages are much shorter than
646 they were in version 3.14.
650 * Leading spaces before directives are ignored (as documented).
652 * Included makefiles can determine the default goal target.
653 (System V Make does it this way, so we are being compatible).
657 * Variables that are defaults built into Make will not be put in the
658 environment for children. This just saves some environment space and,
659 except under -e, will be transparent to sub-makes.
661 * Error messages from sub-makes will indicate the level of recursion.
663 * Hopefully some speed-up for large directories due to a change in the
664 directory hashing scheme.
666 * One child will always get a standard input that is usable.
668 * Default makefiles that don't exist will be remade and read in.
672 * Count parentheses inside expansion function calls so you can
673 have nested calls: `$(sort $(foreach x,a b,$(x)))'.
677 * Several bug fixes, including USG and Sun386i support.
679 * `shell' function to expand shell commands a la `
681 * If the `-d' flag is given, version information will be printed.
683 * The `-c' option has been renamed to `-C' for compatibility with tar.
685 * The `-p' option no longer inhibits other normal operation.
687 * Makefiles will be updated and re-read if necessary.
689 * Can now run several commands at once (parallelism), -j option.
691 * Error messages will contain the level of Make recursion, if any.
693 * The `MAKEFLAGS' and `MFLAGS' variables will be scanned for options after
696 * A double-colon rule with no dependencies will always have its commands run.
697 (This is how both the BSD and System V versions of Make do it.)
701 (Changes from versions 1 through 3.05 were never recorded. Sorry.)
703 ----------------------------------------------------------------------
704 Copyright information:
706 Permission is granted to anyone to make or distribute verbatim copies
707 of this document as received, in any medium, provided that the
708 copyright notice and this permission notice are preserved, thus
709 giving the recipient permission to redistribute in turn.
711 Permission is granted to distribute modified versions of this
712 document, or of portions of it, under the above conditions, provided
713 also that they carry prominent notices stating who last changed them.