home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 318 / utilsrc / make-1 < prev    next >
Encoding:
Text File  |  1988-10-20  |  49.7 KB  |  1,172 lines

  1.   
  2. File: make,  Node: Copying,  Next: Bugs,  Prev: Top,  Up: Top
  3.  
  4. Copying Conditions
  5. ******************
  6.  
  7.                            (Clarified 11 Feb 1988)
  8.  
  9. The license agreements of most software companies keep you at the mercy of
  10. those companies.  By contrast, our general public license is intended to
  11. give everyone the right to share GNU Make.  To make sure that you get the
  12. rights we want you to have, we need to make restrictions that forbid anyone
  13. to deny you these rights or to ask you to surrender the rights.  Hence this
  14. license agreement.
  15.  
  16. Specifically, we want to make sure that you have the right to give away
  17. copies of GNU Make, that you receive source code or else can get it if you
  18. want it, that you can change GNU Make or use pieces of it in new free
  19. programs, and that you know you can do these things.
  20.  
  21. To make sure that everyone has such rights, we have to forbid you to
  22. deprive anyone else of these rights.  For example, if you distribute copies
  23. of GNU Make, you must give the recipients all the rights that you have. 
  24. You must make sure that they, too, receive or can get the source code.  And
  25. you must tell them their rights.
  26.  
  27. Also, for our own protection, we must make certain that everyone finds out
  28. that there is no warranty for GNU Make.  If GNU Make is modified by someone
  29. else and passed on, we want its recipients to know that what they have is
  30. not what we distributed, so that any problems introduced by others will not
  31. reflect on our reputation.
  32.  
  33. Therefore we (Richard Stallman and the Free Software Foundation, Inc.) make
  34. the following terms which say what you must do to be allowed to distribute
  35. or change GNU Make.
  36.  
  37. Copying Policies
  38. ================
  39.  
  40.   1. You may copy and distribute verbatim copies of GNU Make source code as
  41.      you receive it, in any medium, provided that you conspicuously and
  42.      appropriately publish on each copy a valid copyright notice
  43.      ``Copyright (C) 1988 Free Software Foundation, Inc.'' (or with
  44.      whatever year is appropriate), and include following the copyright
  45.      notice a verbatim copy of the above disclaimer of warranty and of this
  46.      License.  You may charge a distribution fee for the physical act of
  47.      transferring a copy.
  48.  
  49.   2. You may modify your copy or copies of GNU Make or any portion of it, and
  50.      copy and distribute such modifications under the terms of Paragraph 1
  51.      above, provided that you also do the following:
  52.  
  53.         * cause the modified files to carry prominent notices stating that
  54.           you changed the files and the date of any change; and
  55.  
  56.         * cause the whole of any work that you distribute or publish, that
  57.           in whole or in part contains or is a derivative of Bison or any
  58.           part thereof, to be licensed at no charge to all third parties on
  59.           terms identical to those contained in this License Agreement
  60.           (except that you may choose to grant more extensive warranty
  61.           protection to some or all third parties, at your option).
  62.  
  63.         * You may charge a distribution fee for the physical act of
  64.           transferring a copy, and you may at your option offer warranty
  65.           protection in exchange for a fee.
  66.  
  67.      Mere aggregation of another unrelated program with this program (or
  68.      its derivative) on a volume of a storage or distribution medium does
  69.      not bring the other program under the scope of these terms.
  70.  
  71.   3. You may copy and distribute GNU Make (or a portion or derivative of it,
  72.      under Paragraph 2) in object code or executable form under the terms
  73.      of Paragraphs 1 and 2 above provided that you also do one of the
  74.      following:
  75.  
  76.         * accompany it with the complete corresponding machine-readable
  77.           source code, which must be distributed under the terms of
  78.           Paragraphs 1 and 2 above; or,
  79.  
  80.         * accompany it with a written offer, valid for at least three
  81.           years, to give any third party free (except for a nominal
  82.           shipping charge) a complete machine-readable copy of the
  83.           corresponding source code, to be distributed under the terms of
  84.           Paragraphs 1 and 2 above; or,
  85.  
  86.         * accompany it with the information you received as to where the
  87.           corresponding source code may be obtained.  (This alternative is
  88.           allowed only for noncommercial distribution and only if you
  89.           received the program in object code or executable form alone.)
  90.  
  91.      For an executable file, complete source code means all the source code
  92.      for all modules it contains; but, as a special exception, it need not
  93.      include source code for modules which are standard libraries that
  94.      accompany the operating system on which the executable file runs.
  95.  
  96.   4. You may not copy, sublicense, distribute or transfer GNU Make except as
  97.      expressly provided under this License Agreement.  Any attempt
  98.      otherwise to copy, sublicense, distribute or transfer GNU Make is void
  99.      and your rights to use the program under this License agreement shall
  100.      be automatically terminated.  However, parties who have received
  101.      computer software programs from you with this License Agreement will
  102.      not have their licenses terminated so long as such parties remain in
  103.      full compliance.
  104.  
  105.   5. If you wish to incorporate parts of GNU Make into other free programs
  106.      whose distribution conditions are different, write to the Free
  107.      Software Foundation at 675 Mass Ave, Cambridge, MA 02139.  We have not
  108.      yet worked out a simple rule that can be stated here, but we will
  109.      often permit this.  We will be guided by the two goals of preserving
  110.      the free status of all derivatives of our free software and of
  111.      promoting the sharing and reuse of software.
  112.  
  113. Your comments and suggestions about our licensing policies and our software
  114. are welcome!  Please contact the Free Software Foundation, Inc., 675 Mass
  115. Ave, Cambridge, MA 02139, or call (617) 876-3296.
  116.  
  117. NO WARRANTY
  118. ===========
  119.  
  120.   BECAUSE GNU MAKE IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY NO
  121. WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW.  EXCEPT WHEN
  122. OTHERWISE STATED IN WRITING, THE FREE SOFTWARE FOUNDATION, INC, RICHARD M.
  123. STALLMAN AND/OR OTHER PARTIES PROVIDE GNU MAKE "AS IS" WITHOUT WARRANTY OF
  124. ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
  125. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  126.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF GNU MAKE IS WITH YOU.
  127.  SHOULD GNU MAKE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
  128. SERVICING, REPAIR OR CORRECTION.
  129.  
  130.  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.  STALLMAN,
  131. THE FREE SOFTWARE FOUNDATION, INC., AND/OR ANY OTHER PARTY WHO MAY MODIFY
  132. AND REDISTRIBUTE GNU MAKE AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
  133. INCLUDING ANY LOST PROFITS, LOST MONIES, OR OTHER SPECIAL, INCIDENTAL OR
  134. CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE (INCLUDING
  135. BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES
  136. SUSTAINED BY THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY
  137. OTHER PROGRAMS) GNU MAKE, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY
  138. OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
  139.  
  140. File: make,  Node: Top,  Next: Copying,  Up: (DIR)
  141.  
  142. Overview of `make'
  143. ******************
  144.  
  145. The purpose of the `make' utility is to determine automatically which
  146. pieces of a large program need to be recompiled, and issue the commands to
  147. recompile them.  This manual describes the GNU implementation of `make',
  148. which was implemented by Richard Stallman and Roland McGrath.
  149.  
  150. Our examples show C programs, since they are most common, but you can use
  151. `make' with any programming language whose compiler can be run with a shell
  152. command.  In fact, `make' is not limited to programs.  You can use it to
  153. describe any task where some files must be updated automatically from
  154. others whenever the others change.
  155.  
  156. To prepare to use `make', you must write a file called the "makefile" that
  157. describes the relationships among files in your program, and the states the
  158. commands for updating each file.  In a program, typically the executable
  159. file is updated from object files, which are in turn made by compiling
  160. source files.
  161.  
  162. Once a suitable makefile exists, each time you change some source files,
  163. this simple shell command:
  164.  
  165.      make
  166.  
  167. suffices to perform all necessary recompilations.  The `make' program uses
  168. the makefile data base and the last-modification times of the files to
  169. decide which of the files need to be updated.  For each of those files, it
  170. issues the commands recorded in the data base.
  171.  
  172. * Menu:
  173.  
  174. * Copying::    Copying conditions for GNU Make.
  175. * Bugs::    If you have problems, or think you've found a bug.
  176. * Simple::    A simple example explained.
  177. * Makefiles::    The data base contains rules and variable definitions.
  178. * Rules::    A rule says how and when to remake one file.
  179. * Commands::    A rule contains shell commands that say how to remake.
  180. * Variables::    A variable holds a text string for substitution into rules.
  181. * Conditionals::Makefiles that do one thing or another depending on
  182.          variable values.
  183. * Functions::    Functions can do text-processing within `make'.
  184.  
  185. * Running::    How to run `make'; how you can adjust the way
  186.          `make' uses the makefile.
  187.  
  188. * Implicit::    Implicit rules take over if the makefile doesn't say
  189.          how a file is to be remade.
  190. * Archives::    How to use `make' to update archive files.
  191.  
  192. * Features::    GNU `make''s advanced features and how GNU `make'
  193.          relates to other versions of `make'.
  194. * Missing::    Features of other `make's not supported
  195.          by GNU `make'.
  196.  
  197. * Concept Index::Index of cross-references to where concepts are discussed.
  198. * Name Index::    Index of cross-references for names of `make''s
  199.          variables, functions, special targets and directives.
  200.  
  201.  
  202. File: make,  Node: Bugs,  Next: Simple,  Prev: Copying,  Up: Top
  203.  
  204. Problems and Bugs
  205. =================
  206.  
  207. If you have problems with GNU `make' or think you've found a bug, please
  208. report it to Roland McGrath; he doesn't promise to do anything but he might
  209. well want to fix it.
  210.  
  211. Before reporting a bug, make sure you've actually found a real bug. 
  212. Carefully reread the documentation and see if it really says you can do
  213. what you're trying to do.  If it's not clear whether you should be able to
  214. do something or not, report that too; it's a bug in the documentation!
  215.  
  216. Before reporting a bug or trying to fix it yourself, try to isolate it to
  217. the smallest possible makefile that reproduces the problem.  Then send us
  218. the makefile and the exact results `make' gave you.  Also say what you
  219. expected to occur; this will help us decide whether the problem was really
  220. in the documentation.
  221.  
  222. Once you've got a precise problem, send email to (Internet)
  223. `bug-gnu-utils@prep.ai.mit.edu' or (UUCP)
  224. `mit-eddie!prep.ai.mit.edu!bug-gnu-utils'.  Please include the version
  225. number of `make' you are using.  You can get this information with the
  226. command `make -v -f /dev/null'.
  227.  
  228. Non-bug suggestions are always welcome as well.  If you have questions
  229. about things that are unclear in the documentation or are just obscure
  230. features, ask Roland McGrath; he'll be happy to help you out (but no
  231. promises).  You can send him electronic mail at Internet address
  232. `roland@wheaties.ai.mit.edu' or UUCP path
  233. `mit-eddie!wheaties.ai.mit.edu!roland'.
  234.  
  235. File: make,  Node: Simple,  Next: Makefiles,  Prev: Bugs,  Up: Top
  236.  
  237. Simple Example of `make'
  238. ========================
  239.  
  240. Suppose we have a text editor consisting of eight C source files and three
  241. header files.  We need a makefile to tell `make' how to compile and link
  242. the editor.  Assume that all the C files include `defs.h', but only those
  243. defining editing commands include `commands.h' and only low level files
  244. that change the editor buffer include `buffer.h'.
  245.  
  246. To recompile the editor, each changed C source file must be recompiled.  If
  247. a header file has changed, to be safe each C source file that includes the
  248. header file must be recompiled.  Each compilation produces an object file
  249. corresponding to the source file.  Finally, if any source file has been
  250. recompiled, all the object files, whether newly made or saved from previous
  251. compilations, must be linked together to produce the new executable editor.
  252.  
  253. Here is a straightforward makefile that describes these criteria and says
  254. how to compile and link when the time comes:
  255.  
  256.      edit : main.o kbd.o commands.o display.o \
  257.             insert.o search.o files.o utils.o
  258.              cc -o edit main.o kbd.o commands.o display.o \
  259.                         insert.o search.o files.o utils.o
  260.      
  261.      main.o : main.c defs.h
  262.              cc -c main.c
  263.      kbd.o : kbd.c defs.h command.h
  264.              cc -c kbd.c
  265.      commands.o : command.c defs.h command.h
  266.              cc -c commands.c
  267.      display.o : display.c defs.h buffer.h
  268.              cc -c display.c
  269.      insert.o : insert.c defs.h buffer.h
  270.              cc -c insert.c
  271.      search.o : search.c defs.h buffer.h
  272.              cc -c search.c
  273.      files.o : files.c defs.h buffer.h command.h
  274.              cc -c files.c
  275.      utils.o : utils.c defs.h
  276.              cc -c utils.c
  277.  
  278. We split each long line into two lines using a backslash-newline; this is
  279. like using one long line, but is easier to read.
  280.  
  281. Each file that is generated by a program---that is to say, each file except
  282. for source files---is the "target" of a "rule" (*Note Rules::.).  (In this
  283. example, these are the object files such as `main.o', `kbd.o', etc., and
  284. the executable file `edit'.)  The target appears at the beginning of a
  285. line, followed by a colon.
  286.  
  287. After the colon come the target's "dependencies": all the files that are
  288. used as input when the target file is updated.  A target file needs to be
  289. recompiled or relinked if any of its dependencies changes.  In addition,
  290. any dependencies that are themselves automatically generated should be
  291. updated first.  In this example, `edit' depends on each of the eight object
  292. files; the object file `main.o' depends on the source file `main.c' and on
  293. the header file `defs.h'.
  294.  
  295. By default, `make' starts with the first rule (not counting rules whose
  296. target names start with `.').  This is called the "default goal". 
  297. Therefore, we put the rule for the executable program `edit' first.  The
  298. other rules are processed because their targets appear as dependencies of
  299. the goal.
  300.  
  301. After each line containing a target and dependencies come one or more lines
  302. of shell commands that say how to update the target file.  These lines
  303. start with a tab to tell `make' that they are command lines.  But `make'
  304. does not know anything about how the commands work.  It is up to you to
  305. supply commands that will update the target file properly.  All `make' does
  306. is execute the commands you have specified when the target file needs to be
  307. updated.
  308.  
  309. How `make' Processes This Makefile
  310. ----------------------------------
  311.  
  312. After reading the makefile, `make' begins its real work by processing the
  313. first rule, the one for relinking `edit'; but before it can fully process
  314. this rule, it must process the rules for the files `edit' depends on: all
  315. the object files.  Each of these files is processed according to its own
  316. rule.  These rules say to update the `.o' file by compiling its source
  317. file.  The recompilation must be done if the source file, or any of the
  318. header files named as dependencies, is more recent than the object file, or
  319. if the object file does not exist.
  320.  
  321. Before recompiling an object file, `make' considers updating its
  322. dependencies, the source file and header files.  This makefile does not
  323. specify anything to be done for them---the `.c' and `.h' files are not the
  324. targets of any rules---so nothing needs to be done.  But automatically
  325. generated C programs, such as made by Yacc (or Bison), would be updated by
  326. their own rules at this time.
  327.  
  328. After recompiling whichever object files need it, `make' can now decide
  329. whether to relink `edit'.  This must be done if the file `edit' does not
  330. exist, or if any of the object files are newer than it.  If an object file
  331. was just recompiled, it is now newer than `edit', so `edit' will be relinked.
  332.  
  333. Variables Make Makefiles Simpler
  334. --------------------------------
  335.  
  336. In our example, we had to list all the object files twice in the rule for
  337. `edit' (repeated here):
  338.  
  339.      edit : main.o kbd.o commands.o display.o \
  340.                    insert.o search.o files.o utils.o
  341.              cc -o edit main.o kbd.o commands.o display.o \
  342.                         insert.o search.o files.o utils.o
  343.  
  344. Such duplication is error-prone; if a new object file is added to the
  345. system, we might add it to one list and forget the other.  We can eliminate
  346. the risk and simplify the makefile by using a "variable".  Variables allow
  347. a text string to be defined once and substituted in multiple places later
  348. (*Note Variables::.).
  349.  
  350. It's standard practice for every makefile to have a variable named
  351. `objects', `OBJECTS', `objs', `OBJS', `obj' or `OBJ' which is a list of all
  352. object file names.  We would define such a variable `objects' with a line
  353. like this in the makefile:
  354.  
  355.      objects = main.o kbd.o commands.o display.o \
  356.                    insert.o search.o files.o utils.o
  357.  
  358. Then, each place we want to put a list of the object file names, we can
  359. substitute the variable's value by writing `$(objects)' (*Note
  360. Variables::.).  Here is how the rule for `edit' looks as a result:
  361.  
  362.      edit : $(objects)
  363.              cc -o edit $(objects)
  364.  
  365. Letting `make' Deduce the Commands
  366. ----------------------------------
  367.  
  368. It is not necessary to spell out the commands for compiling the individual
  369. C source files, because `make' can figure them out: it has an "implicit
  370. rule" for updating a `.o' file from a correspondingly named `.c' file using
  371. a `cc -c' command.  For example, it will use the command `cc -c main.c -o
  372. main.o' to compile `main.c' into `main.o'.  We can therefore omit the
  373. commands from the rules for the object files.  *note Implicit::.
  374.  
  375. When a `.c' file is used automatically in this way, it is also
  376. automatically added to the list of dependencies.  We can therefore omit the
  377. `.c' files from the dependencies, provided we omit the commands.
  378.  
  379. Here is the entire example, with both of these changes, and a variable
  380. `objects' as suggested above:
  381.  
  382.      objects =  main.o kbd.o commands.o display.o \
  383.       insert.o search.o files.o utils.o
  384.      
  385.      edit : $(objects)
  386.              cc -o edit $(objects)
  387.      
  388.      main.o : defs.h
  389.      kbd.o : defs.h command.h
  390.      commands.o : defs.h command.h
  391.      display.o : defs.h buffer.h
  392.      insert.o : defs.h buffer.h
  393.      search.o : defs.h buffer.h
  394.      files.o : defs.h buffer.h command.h
  395.      utils.o : defs.h
  396.  
  397. This is how we would write the makefile in actual practice.
  398.  
  399. Another Style of Makefile
  400. -------------------------
  401.  
  402. Since the rules for the object files specify only dependencies, no
  403. commands, one can alternatively combine them by dependency instead of by
  404. target.  Here is what it looks like:
  405.  
  406.      objects =  main.o kbd.o commands.o display.o \
  407.       insert.o search.o files.o utils.o
  408.      
  409.      edit : $(objects)
  410.              cc -o edit $(objects)
  411.      
  412.      $(objects) : defs.h
  413.      kbd.o commands.o files.o : command.h
  414.      display.o insert.o search.o files.o : buffer.h
  415.  
  416. Here `defs.h' is given as a dependency of all the object files;
  417. `commands.h' and `buffer.h' are dependencies of the specific object files
  418. listed for them.
  419.  
  420. Whether this is better is a matter of taste: it is more compact, but some
  421. people dislike it because they find it clearer to put all the information
  422. about each target in one place.
  423.  
  424. File: make,  Node: Makefiles,  Next: Rules,  Prev: Simple,  Up: Top
  425.  
  426. Writing Makefiles
  427. *****************
  428.  
  429. The information that tells `make' how to recompile a system comes from
  430. reading a data base called the "makefile".
  431.  
  432. * Menu:
  433.  
  434. * Contents: Makefile Contents.   Overview of what you put in a makefile.
  435. * Names: Makefile Names.     Where `make' finds the makefile.
  436. * MAKEFILES Variable::           The environment can specify extra makefiles.
  437. * Include::                      How one makefile can use another makefile.
  438.  
  439.  
  440. File: make,  Node: Makefile Contents,  Next: Makefile Names,  Prev: Makefiles,  Up: Makefiles
  441.  
  442. What Makefiles Contain
  443. ======================
  444.  
  445. Makefiles contain four kinds of things: "rules", "variable definitions",
  446. "directives" and "comments".  Rules, variables and directives are described
  447. at length in later chapters.
  448.  
  449.    * A rule says when and how to remake one or more files, called the
  450.      rule's "targets".  It lists the other files that the targets "depend
  451.      on", and may also give commands to use to create or update the targets.
  452.       *note Rules::.
  453.  
  454.    * A variable definition is a line that specifies a text string value for
  455.      a "variable" that can be substituted into the text later.  The simple
  456.      makefile example (*Note Simple::.) shows a variable definition for
  457.      `objects' as a list of all object files.  *note Variables::, for full
  458.      details.
  459.  
  460.    * A directive is a command for `make' to do something special while
  461.      reading the makefile.  These include:
  462.  
  463.         * Reading another makefile (*Note Include::.).
  464.  
  465.         * Deciding (based on the values of variables) whether to use or
  466.           ignore a part of the makefile (*Note Conditionals::.).
  467.  
  468.         * Defining a variable from a verbatim string containing multiple
  469.           lines (*Note Defining::.).
  470.  
  471.    * `#' in a line of a makefile starts a comment.  It and the rest of the
  472.      line are ignored.  Comments may appear on any of the lines in the
  473.      makefile, except within a `define' directive, and perhaps within
  474.      commands (where the shell decides what is a comment).  A line
  475.      containing just a comment (with perhaps spaces before it) is
  476.      effectively blank, and is ignored.
  477.  
  478. File: make,  Node: Makefile Names,  Next: MAKEFILES Variable,  Prev: Makefile Contents,  Up: Makefiles
  479.  
  480. What Name to Give Your Makefile
  481. ===============================
  482.  
  483. By default, when `make' looks for the makefile, it tries the names
  484. `./makefile' and `./Makefile' in that order.  So normally you call your
  485. makefile by one of these two names, and `make' finds it automatically.  We
  486. recommend `Makefile' because it appears prominently near the beginning of a
  487. directory listing (right near other important files such as `README').
  488.  
  489. If `make' finds neither of these two names, it does not use any makefile. 
  490. Then you must specify a goal with a command argument, and `make' will
  491. attempt to figure out how to remake it using only its built-in implicit
  492. rules.  *note Implicit::.
  493.  
  494. If you want to use a nonstandard name for your makefile, you can specify
  495. the makefile name with the `-f' option.  The arguments `-f NAME' tell
  496. `make' to read the file NAME as the makefile.  If you use more than one
  497. `-f' option, you can specify several makefiles.  All the makefiles are
  498. effectively concatenated in the order specified.  The default makefile
  499. names `./makefile' and `./Makefile' are not used if you specify `-f'.
  500.  
  501. File: make,  Node: MAKEFILES Variable,  Next: Include,  Prev: Makefile Names,  Up: Makefiles
  502.  
  503. The Variable `MAKEFILES'
  504. ========================
  505.  
  506. If the environment variable `MAKEFILES' is defined, `make' considers its
  507. value as a list of names (separated by whitespace) of additional makefiles
  508. to be read before the others.  This works much like the `include'
  509. directive: various directories are searched for those files and the default
  510. goal is never taken from them.  *note Include::.  In addition, it is not an
  511. error if the files listed in `MAKEFILES' are not found.
  512.  
  513. The main use of `MAKEFILES' is in communication between recursive
  514. invocations of `make' (*Note Recursion::.).  It usually isn't desirable to
  515. set the environment variable before a top-level invocation of `make',
  516. because it is usually better not to mess with a makefile from outside. 
  517. However, if you are running `make' without a specific makefile, a makefile
  518. in `MAKEFILES' can do useful things to help the built-in implicit rules
  519. work better, such as defining search paths.
  520.  
  521. Some users are tempted to set `MAKEFILES' in the environment automatically
  522. on login, and program makefiles to expect this to be done.  This is a very
  523. bad idea, because such makefiles will fail to work if run by anyone else. 
  524. It is much better to write explicit `include' directives in the makefiles.
  525.  
  526. File: make,  Node: Include,  Prev: MAKEFILES Variable,  Up: Makefiles
  527.  
  528. Including Other Makefiles
  529. =========================
  530.  
  531. The `include' directive tells `make' to suspend reading the current
  532. makefile and read another makefile before continuing.  The directive is a
  533. line in the makefile that looks like this:
  534.  
  535.      include FILENAME
  536.  
  537. Extra spaces are allowed and ignored at the beginning of the line, but a
  538. tab is not allowed.  (If the line begins with a tab, it will be considered
  539. a command line.)  Whitespace is required between `include' and FILENAME;
  540. extra whitespace is ignored there and at the end of the directive.  A
  541. comment starting with `#' is allowed at the end of the line.
  542.  
  543. Reading of the containing makefile is temporarily suspended while the file
  544. FILENAME is read as a makefile.  When that is finished, `make' goes on with
  545. reading the makefile in which the directive appears.
  546.  
  547. The default goal target is never taken from an included makefile (*Note
  548. Goals::.).
  549.  
  550. One occasion for using `include' directives is when several programs,
  551. handled by individual makefiles in various directories, need to use a
  552. common set of variable definitions (*Note Setting::.) or pattern rules
  553. (*Note Pattern Rules::.).
  554.  
  555. Another such occasion is when you want to automatically generate
  556. dependencies from source files; the dependencies can be put in a file that
  557. is included by the main makefile.  This practice is generally cleaner than
  558. that of somehow appending the dependencies to the end of the main makefile
  559. as has been traditionally done with other versions of `make'.
  560.  
  561. If the specified name does not start with a slash, and the file is not
  562. found in the current directory, several other directories are searched. 
  563. First, any directories you have specified with the `-I' option are searched
  564. (*Note Options::.).  Then the following directories (if they exist) are
  565. searched, in this order: `/usr/gnu/include', `/usr/local/include',
  566. `/usr/include'.  If an included makefile cannot be found in any of these
  567. directories, a warning message is generated, but it is not a fatal error.
  568.  
  569. File: make,  Node: Rules,  Next: Commands,  Prev: Makefiles,  Up: Top
  570.  
  571. Writing Rules
  572. *************
  573.  
  574. A "rule" appears in the makefile and says when and how to remake certain
  575. files, called the rule's "targets" (usually only one per rule).  It lists
  576. the other files that are the "dependencies" of the target, and "commands"
  577. to use to create or update the target.
  578.  
  579. The order of rules is not significant, except for determining the "default
  580. goal": the target for `make' to consider, if you do not otherwise specify
  581. one.  The default goal comes from the first rule (not counting included
  582. makefiles) whose target does not start with a period.  Therefore, the first
  583. rule is normally one for compiling the entire program or all the programs
  584. described by the makefile.  *note Goals::.
  585.  
  586. * Menu:
  587.  
  588. * Rule Example::        An explained example of a rule.
  589. * Rule Syntax::            General syntax of rules, with explanation.
  590.  
  591. * Wildcards::            Using wildcard characters like `*' in file names.
  592. * Directory Search::    Searching other directories for source files.
  593.  
  594. * Phony Targets::       Using a target that isn't a real file's name.
  595. * Special Targets::     Targets with special built-in meanings.
  596. * Empty Targets::       Real files that are empty--only the date matters.
  597. * Multiple Targets::    When it is useful to have several targets in a rule.
  598. * Static Pattern::    Static pattern rules apply to multiple targets
  599.              and can vary the dependencies according to the
  600.              target name.
  601. * Multiple Rules::      Using several rules with the same target.
  602. * Double-Colon::        Special kind of rule allowing
  603.                           several independent rules for one target.
  604. * Commands::            Special features and details of how commands
  605.                          in a rule are executed.
  606.  
  607.  
  608. File: make,  Node: Rule Example,  Next: Rule Syntax,  Prev: Rules,  Up: Rules
  609.  
  610. Rule Example
  611. ------------
  612.  
  613. Here is an example of a rule:
  614.  
  615.      foo.o : foo.c defs.h       # module for twiddling the frobs
  616.              cc -c -g foo.c
  617.  
  618. Its target is `foo.o' and its dependencies are `foo.c' and `defs.h'.  It
  619. has one command, which is `cc -c -g foo.c'.  The command line starts with a
  620. tab to identify it as a command.
  621.  
  622. This rule says two things:
  623.  
  624.    * How to decide whether `foo.o' is out of date: it is out of date if it
  625.      does not exist, or if either `foo.c' or `defs.h' is more recent than it.
  626.  
  627.    * How to update the file `foo.o': by running `cc' as stated.  The
  628.      command does not explicitly mention `defs.h', but we presume that
  629.      `foo.c' includes it, and that that is why `defs.h' was added to the
  630.      dependencies.
  631.  
  632. File: make,  Node: Rule Syntax,  Next: Wildcards,  Prev: Rule Example,  Up: Rules
  633.  
  634. Rule Syntax
  635. ===========
  636.  
  637. In general, a rule looks like this:
  638.  
  639.      TARGETS : DEPENDENCIES
  640.              COMMAND
  641.              COMMAND
  642.              ...
  643.  
  644.  or like this:
  645.  
  646.      TARGETS : DEPENDENCIES ; COMMAND
  647.              COMMAND
  648.              COMMAND
  649.              ...
  650.  
  651.  The TARGETS are file names, separated by spaces.  Wild card characters may
  652. be used (*Note Wildcards::.) and a name of the form `A(M)' represents
  653. member M in archive file A (*Note Archive Members::.).  Usually there is
  654. only one target per rule, but occasionally there is a reason to have more
  655. (*Note Multiple Targets::.).
  656.  
  657. The COMMAND lines start with a tab character.  The first command may appear
  658. on the line after the dependencies, with a tab character, or may appear on
  659. the same line, with a semicolon.  Either way, the effect is the same. 
  660. *note Commands::.
  661.  
  662. Because dollar signs are used to start variable references, if you really
  663. want a dollar sign in the rule you must write two of them (`$$').  *note
  664. Variables::.  A long line may be split by inserting a backslash followed by
  665. a newline, but this is not required, as there is no limit on the length of
  666. a line.
  667.  
  668. A rule tells `make' two things: when the targets are out of date, and how
  669. to update them when necessary.
  670.  
  671. The criterion for being out of date is specified in terms of the
  672. DEPENDENCIES, which consist of file names separated by spaces.  (Wildcards
  673. and archive members are allowed here too.)  A target is out of date if it
  674. does not exist or if it is older than any of the dependencies (by
  675. comparison of last-modification times).  The idea is that the contents of
  676. the target file are computed based on information in the dependencies, so
  677. if any of the dependencies changes, the contents of the existing target
  678. file are no longer necessarily valid.
  679.  
  680. How to update is specified by COMMANDS.  These are lines to be executed by
  681. the shell (normally `sh'), but with some extra features (*Note Commands::.).
  682.  
  683. File: make,  Node: Wildcards,  Next: Directory Search,  Prev: Rule Syntax,  Up: Rules
  684.  
  685. Using Wildcards Characters in File Names
  686. ========================================
  687.  
  688. A single file name can specify many files using "wildcard characters".  The
  689. wildcard characters in `make' are `*', `?' and `[...]', the same as in the
  690. Bourne shell.  For example, `*.c' specifies a list of all the files (in the
  691. working directory) whose names end in `.c'.
  692.  
  693. Wildcard expansion happens automatically in targets, in dependencies, and
  694. in commands.  In other contexts, wildcard expansion happens only if you
  695. request it explicitly with the `wildcard' function.
  696.  
  697. The special significance of a wildcard character can be turned off by
  698. preceding it with a backslash.  Thus, `foo\*bar' would refer to a specific
  699. file whose name consists of `foo', an asterisk, and `bar'.
  700.  
  701. * Menu:
  702.  
  703. * Examples: Wildcard Examples.    Some simple examples.
  704. * Pitfall: Wildcard Pitfall.      `*.o' won't do what you want!
  705. * Function: Wildcard Function.
  706.        How to do wildcard expansion when defining a variable
  707.        using the function `wildcard'.
  708.  
  709.  
  710. File: make,  Node: Wildcard Examples,  Next: Wildcard Function,  Prev: Wildcards,  Up: Wildcards
  711.  
  712. Wildcard Examples
  713. -----------------
  714.  
  715. Wildcards can be used in the commands of a rule.  For example, here is a
  716. rule to delete all the object files:
  717.  
  718.      clean:
  719.              rm -f *.o
  720.  
  721. Wildcards are also useful in the dependencies of a rule.  With the
  722. following rule in the makefile, `make print' will print all the `.c' files
  723. that have changed since the last time you printed them:
  724.  
  725.      print: *.c
  726.              lpr -p $?
  727.              touch print
  728.  
  729. This rule uses `print' as an empty target file; *Note Empty Targets::..
  730.  
  731. Wildcard expansion does not happen when you define a variable.  Thus, if
  732. you write this:
  733.  
  734.      objects=*.o
  735.  
  736. then the value of the variable `objects' is the actual string `*.o'. 
  737. However, if you use the value of `objects' in a target, dependency or
  738. command, wildcard expansion will take place at that time.
  739.  
  740. File: make,  Node: Wildcard Pitfall,  Next: Wildcard Function,  Prev: Wildcard Examples,  Up: Wildcards
  741.  
  742. Pitfalls of Using Wildcards
  743. ---------------------------
  744.  
  745. Now here is an example of a naive way of using wildcard expansion, that
  746. does not do what you would intend.  Suppose you would like to say that the
  747. executable file `foo' is made from all the object files in the directory,
  748. and you write this:
  749.  
  750.      objects=*.o
  751.      
  752.      foo : $(objects)
  753.              cc -o foo $(CFLAGS) $(objects)
  754.  
  755. The value of `objects' is the actual string `*.o'.  Wildcard expansion
  756. happens in the rule for `foo', so that each *existing* `.o' file becomes a
  757. dependency of `foo' and will be recompiled if necessary.
  758.  
  759. But what if you delete all the `.o' files?  Then `*.o' will expand into
  760. *nothing*.  The target `foo' will have no dependencies and would be remade
  761. by linking no object files.  This is not what you want!
  762.  
  763. Actually you can use wildcard expansion for this purpose, but you need more
  764. sophisticated techniques, including the `wildcard' function and string
  765. substitution.
  766.  
  767. *note Wildcard Function::.
  768.  
  769. File: make,  Node: Wildcard Function,  Prev: Wildcard Pitfall,  Up: Wildcards
  770.  
  771. The Function `wildcard'
  772. -----------------------
  773.  
  774. Wildcard expansion happens automatically in rules.  But wildcard expansion
  775. does not normally take place when a variable is set, or inside the
  776. arguments of a function.  If you want to do wildcard expansion in such
  777. places, you need to use the `wildcard' function, like this:
  778.  
  779.      $(wildcard PATTERN)
  780.  
  781. This string, used anywhere in a makefile, is replaced by a space-separated
  782. list of names of existing files that match the pattern PATTERN.
  783.  
  784. One use of the `wildcard' function is to get a list of all the C source
  785. files in a directory, like this:
  786.  
  787.      $(wildcard *.c)
  788.  
  789. We can change the list of C source files into a list of object files by
  790. substituting `.o' for `.c' in the result, like this:
  791.  
  792.      $(subst .c,.o,$(wildcard *.c))
  793.  
  794. Here we have used another function, `subst' (*Note Text Functions::.).
  795.  
  796. Thus, a makefile to compile all C source files in the directory and then
  797. link them together could be written as follows:
  798.  
  799.      objects:=$(subst .c,.o,$(wildcard *.c))
  800.      
  801.      foo : $(objects)
  802.              cc -o foo $(LDFLAGS) $(objects)
  803.  
  804. (This takes advantage of the implicit rule for compiling C programs, so
  805. there is no need to write explicit rules for compiling the files.)
  806.  
  807. File: make,  Node: Directory Search,  Next: Phony Targets,  Prev: Wildcards,  Up: Rules
  808.  
  809. Searching Directories for Dependencies
  810. ======================================
  811.  
  812. For large systems, it is often desirable to put sources in a separate
  813. directory from the binaries.  The "directory search" features of `make'
  814. facilitate this by searching several directories automatically to find a
  815. dependency.  When you redistribute the files among directories, you do not
  816. need to change the individual rules, just the search paths.
  817.  
  818. * Menu:
  819.  
  820. * General Search::    The `VPATH' variable specifies a search path
  821.             that applies to every dependency.
  822. * Selective Search::  The `vpath' directive specifies a search path
  823.             for a specified class of names.
  824. * Commands/Search::   How to write shell commands that work together
  825.             with search paths.
  826. * Implicit/Search::   How search paths affect implicit rules.
  827. * Libraries/Search::  Directory search for link libraries.
  828.  
  829.  
  830. File: make,  Node: General Search,  Next: Selective Search,  Prev: Directory Search,  Up: Directory Search
  831.  
  832. `VPATH': Search Path for All Dependencies
  833. -----------------------------------------
  834.  
  835. The value of the variable `VPATH' is a list of directories which `make'
  836. should search (in the order specified) for dependency files.  The directory
  837. names are separated by colons.  For example:
  838.  
  839.      VPATH = src:../headers
  840.  
  841. specifies a path containing two directories, `src' and `../headers'.
  842.  
  843. Whenever a file listed as a dependency does not exist in the current
  844. directory, the directories listed in `VPATH' are searched for a file with
  845. that name.  If a file is found in one of them, that file becomes the
  846. dependency.  Rules may then specify the names of source files as if they
  847. all existed in the current directory.
  848.  
  849. Using the value of `VPATH' set in the previous example, a rule like this:
  850.  
  851.      foo.o : foo.c
  852.  
  853. is interpreted as if it were written like this:
  854.  
  855.      foo.o : src/foo.c
  856.  
  857. assuming the file `foo.c' does not exist in the current directory but is
  858. found in the directory `src'.
  859.  
  860. File: make,  Node: Selective Search,  Next: Commands/Search,  Prev: General Search,  Up: Directory Search
  861.  
  862. The `vpath' Directive
  863. ---------------------
  864.  
  865. Similar to the `VPATH' variable but more selective is the `vpath'
  866. directive, which allows you to specify a search path for a particular class
  867. of filenames, those that match a particular pattern.  Thus you can supply
  868. certain search directories for one class of filenames and other directories
  869. (or none) for other filenames.
  870.  
  871. There are three forms of the `vpath' directive:
  872.  
  873. `vpath PATTERN DIRECTORIES'
  874.      Specify the search path DIRECTORIES for filenames that match
  875.      `pattern'.  If another path was previously specified for the same
  876.      pattern, the new path replaces it.  Note that it does *not* add to the
  877.      old path for this pattern.
  878.  
  879.      The search path, DIRECTORIES, is a colon-separated list of directories
  880.      to be searched, just like the search path used in the `VPATH' variable.
  881.  
  882. `vpath PATTERN'
  883.      Clear out the search path associated with PATTERN.
  884.  
  885. `vpath'
  886.      Clear all search paths previously specified with `vpath' directives.
  887.  
  888. A `vpath' pattern is a string containing a `%' character.  The string must
  889. match the filename of a dependency that is being searched for, the `%'
  890. character matching any sequence of zero or more characters (as in pattern
  891. rules; *Note Pattern Rules::.).  (It is valid to omit the `%', but then the
  892. pattern must match the dependency exactly, which may not be very useful.)
  893.  
  894. When a dependency fails to exist in the current directory, if the PATTERN
  895. in a `vpath' directive matches the name of the dependency file, then the
  896. DIRECTORIES in that directive are searched just like (and before) the
  897. directories in the `VPATH' variable.
  898.  
  899. If several `vpath' patterns match the dependency file's name, then `make'
  900. processes each matching `vpath' directive one by one, searching all the
  901. directories mentioned in each directive.  The `vpath' directives are
  902. processed in the order in which they appear in the makefiles.
  903.  
  904. File: make,  Node: Commands/Search,  Next: Implicit/Search,  Prev: Selective Search,  Up: Directory Search
  905.  
  906. Writing Shell-Commands with Directory Search
  907. --------------------------------------------
  908.  
  909. When a dependency is found in another directory through directory search,
  910. this cannot change the commands of the rule; they will execute as written. 
  911. Therefore, you must write the commands with care so that they will look for
  912. the dependency in the directory where `make' finds it.
  913.  
  914. This is done with the "automatic variables" such as `$^' (*Note
  915. Automatic::.).  For instance, the value of `$^' is a list of all the
  916. dependencies of the rule, including the names of the directories in which
  917. they were found, and the value of `$@' is the target.  Thus:
  918.  
  919.      foo.o : foo.c
  920.              cc -c $(CFLAGS) $^ -o $@
  921.  
  922. The variable `CFLAGS' exists so you can specify flags for C compilation by
  923. implicit rule; we use it here for consistency so it will affect all C
  924. compilations uniformly (*Note Implicit Variables::.).
  925.  
  926. Often the dependencies include header files as well, which you don't want
  927. to mention in the commands.  The function `firstword' can be used to
  928. extract just the first dependency from the entire list, as shown here
  929. (*Note Filename Functions::.):
  930.  
  931.      VPATH = src:../headers
  932.      foo.o : foo.c defs.h hack.h
  933.              cc -c $(CFLAGS) $(firstword $^) -o $@
  934.  
  935. Here the value of `$^' would be something like `src/foo.c ../headers/defs.h
  936. hack.h', from which `$(firstword $^)' extracts just `src/foo.c'.
  937.  
  938. File: make,  Node: Implicit/Search,  Next: Libraries/Search,  Prev: Commands/Search,  Up: Directory Search
  939.  
  940. Directory Search and Implicit Rules
  941. -----------------------------------
  942.  
  943. The search through the directories specified in `VPATH' or with `vpath'
  944. happens also during consideration of implicit rules (*Note Implicit::.).
  945.  
  946. For example, when a file `foo.o' has no explicit rule, `make' considers
  947. implicit rules, such as to compile `foo.c' if that file exists.  If such a
  948. file is lacking in the current directory, the appropriate directories are
  949. searched for it.  If `foo.c' exists (or is mentioned in the makefile) in
  950. any of the directories, the implicit rule for C compilation is applicable.
  951.  
  952. The commands of all the built-in implicit rules normally use automatic
  953. variables as a matter of necessity; consequently they will use the file
  954. names found by directory search with no extra effort.
  955.  
  956. File: make,  Node: Libraries/Search,  Prev: Implicit/Search,  Up: Directory Search
  957.  
  958. Directory Search for Link Libraries
  959. -----------------------------------
  960.  
  961. Directory search applies in a special way to libraries used with the
  962. linker.  This special feature comes into play when you write a dependency
  963. whose name is of the form `-lNAME'.  (You can tell something funny is going
  964. on here because the dependency is normally the name of a file, and the
  965. *file name* of the library looks like `libNAME.a', not like `-lNAME'.)
  966.  
  967. When a dependency's name has the form `-lNAME', `make' handles it specially
  968. by searching for the file `libNAME.a' in the directories `/lib' and
  969. `/usr/lib', and then using matching `vpath' search paths and the `VPATH'
  970. search path.
  971.  
  972. For example,
  973.  
  974.      foo : foo.c -lcurses
  975.              cc $^ -o $@
  976.  
  977. would cause the command `cc foo.c -lcurses -o foo' to be executed when
  978. `foo' is older than `foo.c' or than `libcurses.a' (which has probably been
  979. found by directory search in the file `/usr/lib/libcurses.a').
  980.  
  981. As shown by the example above, the file name found by directory search is
  982. used only for comparing the file time with the target file's time.  It does
  983. not replace the file's name in later usage (such as in automatic variables
  984. like `$^'); the name remains unchanged, still starting with `-l'.  This
  985. leads to the correct results because the linker will repeat the appropriate
  986. search when it processes its arguments.
  987.  
  988. File: make,  Node: Phony Targets,  Next: Empty Targets,  Prev: Directory Search,  Up: Rules
  989.  
  990. Phony Targets
  991. =============
  992.  
  993. A phony target is one that is not really the name of a file.  It is only a
  994. name for some commands to be executed when explicitly requested.
  995.  
  996. If you write a rule whose commands will not create the target file, the
  997. commands will be executed every time the target comes up for remaking. 
  998. Here is an example:
  999.  
  1000.      clean:
  1001.              rm *.o temp
  1002.  
  1003. Because the `rm' command does not create a file named `clean', probably no
  1004. such file will ever exist.  Therefore, the `rm' command will be executed
  1005. every time you say `make clean'.
  1006.  
  1007. The phony target will cease to work if anything ever does create a file
  1008. named `clean' in this directory.  Since there are no dependencies, the
  1009. `clean' would be considered up to date and its commands would not be
  1010. executed.  To avoid this problem, you can explicitly declare the target to
  1011. be phony, using the special target `.PHONY' (*Note Special Targets::.) as
  1012. follows:
  1013.  
  1014.      .PHONY : clean
  1015.  
  1016. Once this is done, `make' will run the commands regardless of whether there
  1017. is a file named `clean'.
  1018.  
  1019. A phony target should not be a dependency of a real target file; strange
  1020. things can result from that.  As long as you don't do that, the phony
  1021. target commands will be executed only when the phony target is a goal
  1022. (*Note Goals::.).
  1023.  
  1024. Phony targets can have dependencies.  When one directory contains multiple
  1025. programs, it is most convenient to describe all of the programs in one
  1026. makefile `./Makefile'.  Since the target remade by default will be the
  1027. first one in the makefile, it is common to make this a phony target named
  1028. `all' and give it, as dependencies, all the individual programs.  For
  1029. example:
  1030.  
  1031.      all : prog1 prog2 prog3
  1032.      .PHONY : all
  1033.      
  1034.      prog1 : prog1.o utils.o
  1035.              cc -o prog1 prog1.o utils.o
  1036.      
  1037.      prog2 : prog2.o
  1038.              cc -o prog2 prog2.o
  1039.      
  1040.      prog3 : prog3.o sort.o utils.o
  1041.              cc -o prog3 prog3.o sort.o utils.o
  1042.  
  1043. Now you can say just `make' to remake all three programs, or specify as
  1044. arguments the ones to remake (as in `make prog1 prog3').
  1045.  
  1046. When one phony target is a dependency of another, it serves as a subroutine
  1047. of the other.  For example, here `make cleanall' will delete the object
  1048. files, the difference files, and the file `program':
  1049.  
  1050.      cleanall : cleanobj cleandiff
  1051.              rm program
  1052.      
  1053.      cleanobj :
  1054.              rm *.o
  1055.      
  1056.      cleandiff :
  1057.              rm *.diff
  1058.  
  1059. File: make,  Node: Empty Targets,  Next: Special Targets,  Prev: Phony Targets,  Up: Rules
  1060.  
  1061. Empty Target Files to Record Events
  1062. ===================================
  1063.  
  1064. The "empty target" is a variant of the phony target; it is used to hold
  1065. commands for an action that you request explicitly from time to time. 
  1066. Unlike a phony target, this target file can really exist; but the file's
  1067. contents do not matter, and usually are empty.
  1068.  
  1069. The purpose of the empty target file is to record, with its
  1070. last-modification-time, when the rule's commands were last executed.  It
  1071. does so because one of the commands is a `touch' command to update the
  1072. target file.
  1073.  
  1074. The empty target file must have some dependencies.  When you ask to remake
  1075. the empty target, the commands are executed if any dependency is more
  1076. recent than the target; in other words, if a dependency has changed since
  1077. the last time you remade the target.  Here is an example:
  1078.  
  1079.      print: foo.c bar.c
  1080.              lpr -p $?
  1081.              touch print
  1082.  
  1083. With this rule, `make print' will execute the `lpr' command if either
  1084. source file has changed since the last `make print'.  The automatic
  1085. variable `$?' is used to print only those files that have changed (*Note
  1086. Automatic::.).
  1087.  
  1088. File: make,  Node: Special Targets,  Next: Multiple Targets,  Prev: Empty Targets,  Up: Rules
  1089.  
  1090. Special Built-in Target Names
  1091. =============================
  1092.  
  1093. Certain names have special meanings if they appear as targets.
  1094.  
  1095. `.PHONY'
  1096.      The dependencies of the special target `.PHONY' are considered to be
  1097.      phony targets.  When it is time to consider such a target, `make' will
  1098.      run its commands unconditionally, regardless of whether a file with
  1099.      that name exists or what its last-modification time is.  *note Phony
  1100.      Targets::.
  1101.  
  1102. `.SUFFIXES'
  1103.      The dependencies of the special target `.SUFFIXES' are the list of
  1104.      suffixes to be used in checking for suffix rules (*Note Suffix
  1105.      Rules::.).
  1106.  
  1107. `.DEFAULT'
  1108.      The commands specified for `.DEFAULT' are used for any target for
  1109.      which no other commands are known (either explicitly or through an
  1110.      implicit rule).  If `.DEFAULT' commands are specified, every
  1111.      nonexistent file mentioned as a dependency will have these commands
  1112.      executed on its behalf.  *note Search Algorithm::.
  1113.  
  1114. `.PRECIOUS'
  1115.      The targets which `.PRECIOUS' depends on are given this special
  1116.      treatment: if `make' is killed or interrupted during the execution of
  1117.      their commands, the target is not deleted.  *note Interrupts::.
  1118.  
  1119. `.IGNORE'
  1120.      Simply by being mentioned as a target, `.IGNORE' says to ignore errors
  1121.      in execution of commands.  The dependencies and commands for `.IGNORE'
  1122.      are not meaningful.
  1123.  
  1124.      `.IGNORE' exists for historical compatibility.  Since `.IGNORE'
  1125.      affects every command in the makefile, it is not very useful; we
  1126.      recommend you use the more selective ways to ignore errors in specific
  1127.      commands (*Note Errors::.).
  1128.  
  1129. `.SILENT'
  1130.      Simply by being mentioned as a target, `.SILENT' says not to print
  1131.      commands before executing them.  The dependencies and commands for
  1132.      `.SILENT' are not meaningful.
  1133.  
  1134.      `.SILENT' exists for historical compatibility.  We recommend you use
  1135.      the more selective ways to silence specific commands (*Note Echoing::.).
  1136.  
  1137. An entire class of special targets have names made of the concatenation of
  1138. two implicit rule suffixes (two members of the list of dependencies of
  1139. `.SUFFIXES').  Such special targets are suffix rules, an obsolete way of
  1140. defining implicit rules (but a way still widely used).  In principle, any
  1141. target name could be special in this way if you break it in two and add
  1142. both pieces to the suffix list.  In practice, suffixes normally begin with
  1143. `.', so these special target names also begin with `.'.  *note Suffix
  1144. Rules::.
  1145.  
  1146.