home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / GCC / GCC258_3.LHA / gcc / info / make.info-6 < prev    next >
Encoding:
GNU Info File  |  1993-12-07  |  46.1 KB  |  1,155 lines

  1. This is Info file make.info, produced by Makeinfo-1.54 from the input
  2. file ./make.texinfo.
  3.  
  4.    This file documents the GNU Make utility, which determines
  5. automatically which pieces of a large program need to be recompiled,
  6. and issues the commands to recompile them.
  7.  
  8.    This is Edition 0.43, last updated 26 July 1993, of `The GNU Make
  9. Manual', for `make', Version 3.68 Beta.
  10.  
  11.    Copyright (C) 1988, '89, '90, '91, '92, '93 Free Software
  12. Foundation, Inc.
  13.  
  14.    Permission is granted to make and distribute verbatim copies of this
  15. manual provided the copyright notice and this permission notice are
  16. preserved on all copies.
  17.  
  18.    Permission is granted to copy and distribute modified versions of
  19. this manual under the conditions for verbatim copying, provided that
  20. the entire resulting derived work is distributed under the terms of a
  21. permission notice identical to this one.
  22.  
  23.    Permission is granted to copy and distribute translations of this
  24. manual into another language, under the above conditions for modified
  25. versions, except that this permission notice may be stated in a
  26. translation approved by the Free Software Foundation.
  27.  
  28. 
  29. File: make.info,  Node: Suffix Rules,  Next: Search Algorithm,  Prev: Last Resort,  Up: Implicit Rules
  30.  
  31. Old-Fashioned Suffix Rules
  32. ==========================
  33.  
  34.    "Suffix rules" are the old-fashioned way of defining implicit rules
  35. for `make'.  Suffix rules are obsolete because pattern rules are more
  36. general and clearer.  They are supported in GNU `make' for
  37. compatibility with old makefiles.  They come in two kinds:
  38. "double-suffix" and "single-suffix".
  39.  
  40.    A double-suffix rule is defined by a pair of suffixes: the target
  41. suffix and the source suffix.  It matches any file whose name ends with
  42. the target suffix.  The corresponding implicit dependency is made by
  43. replacing the target suffix with the source suffix in the file name.  A
  44. two-suffix rule whose target and source suffixes are `.o' and `.c' is
  45. equivalent to the pattern rule `%.o : %.c'.
  46.  
  47.    A single-suffix rule is defined by a single suffix, which is the
  48. source suffix.  It matches any file name, and the corresponding implicit
  49. dependency name is made by appending the source suffix.  A single-suffix
  50. rule whose source suffix is `.c' is equivalent to the pattern rule `% :
  51. %.c'.
  52.  
  53.    Suffix rule definitions are recognized by comparing each rule's
  54. target against a defined list of known suffixes.  When `make' sees a
  55. rule whose target is a known suffix, this rule is considered a
  56. single-suffix rule.  When `make' sees a rule whose target is two known
  57. suffixes concatenated, this rule is taken as a double-suffix rule.
  58.  
  59.    For example, `.c' and `.o' are both on the default list of known
  60. suffixes.  Therefore, if you define a rule whose target is `.c.o',
  61. `make' takes it to be a double-suffix rule with source suffix `.c' and
  62. target suffix `.o'.  Here is the old-fashioned way to define the rule
  63. for compiling a C source file:
  64.  
  65.      .c.o:
  66.              $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
  67.  
  68.    Suffix rules cannot have any dependencies of their own.  If they
  69. have any, they are treated as normal files with funny names, not as
  70. suffix rules.  Thus, the rule:
  71.  
  72.      .c.o: foo.h
  73.              $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
  74.  
  75. tells how to make the file `.c.o' from the dependency file `foo.h', and
  76. is not at all like the pattern rule:
  77.  
  78.      %.o: %.c foo.h
  79.              $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
  80.  
  81. which tells how to make `.o' files from `.c' files, and makes all `.o'
  82. files using this pattern rule also depend on `foo.h'.
  83.  
  84.    Suffix rules with no commands are also meaningless.  They do not
  85. remove previous rules as do pattern rules with no commands (*note
  86. Canceling Implicit Rules: Canceling Rules.).  They simply enter the
  87. suffix or pair of suffixes concatenated as a target in the data base.
  88.  
  89.    The known suffixes are simply the names of the dependencies of the
  90. special target `.SUFFIXES'.  You can add your own suffixes by writing a
  91. rule for `.SUFFIXES' that adds more dependencies, as in:
  92.  
  93.      .SUFFIXES: .hack .win
  94.  
  95. which adds `.hack' and `.win' to the end of the list of suffixes.
  96.  
  97.    If you wish to eliminate the default known suffixes instead of just
  98. adding to them, write a rule for `.SUFFIXES' with no dependencies.  By
  99. special dispensation, this eliminates all existing dependencies of
  100. `.SUFFIXES'.  You can then write another rule to add the suffixes you
  101. want.  For example,
  102.  
  103.      .SUFFIXES:            # Delete the default suffixes
  104.      .SUFFIXES: .c .o .h   # Define our suffix list
  105.  
  106.    The `-r' or `--no-builtin-rules' flag causes the default list of
  107. suffixes to be empty.
  108.  
  109.    The variable `SUFFIXES' is defined to the default list of suffixes
  110. before `make' reads any makefiles.  You can change the list of suffixes
  111. with a rule for the special target `.SUFFIXES', but that does not alter
  112. this variable.
  113.  
  114. 
  115. File: make.info,  Node: Search Algorithm,  Prev: Suffix Rules,  Up: Implicit Rules
  116.  
  117. Implicit Rule Search Algorithm
  118. ==============================
  119.  
  120.    Here is the procedure `make' uses for searching for an implicit rule
  121. for a target T.  This procedure is followed for each double-colon rule
  122. with no commands, for each target of ordinary rules none of which have
  123. commands, and for each dependency that is not the target of any rule.
  124. It is also followed recursively for dependencies that come from implicit
  125. rules, in the search for a chain of rules.
  126.  
  127.    Suffix rules are not mentioned in this algorithm because suffix
  128. rules are converted to equivalent pattern rules once the makefiles have
  129. been read in.
  130.  
  131.    For an archive member target of the form `ARCHIVE(MEMBER)', the
  132. following algorithm is run twice, first using `(MEMBER)' as the target
  133. T, and second using the entire target if the first run found no rule.
  134.  
  135.   1. Split T into a directory part, called D, and the rest, called N.
  136.      For example, if T is `src/foo.o', then D is `src/' and N is
  137.      `foo.o'.
  138.  
  139.   2. Make a list of all the pattern rules one of whose targets matches
  140.      T or N.  If the target pattern contains a slash, it is matched
  141.      against T; otherwise, against N.
  142.  
  143.   3. If any rule in that list is *not* a match-anything rule, then
  144.      remove all nonterminal match-anything rules from the list.
  145.  
  146.   4. Remove from the list all rules with no commands.
  147.  
  148.   5. For each pattern rule in the list:
  149.  
  150.        a. Find the stem S, which is the nonempty part of T or N matched
  151.           by the `%' in the target pattern.
  152.  
  153.        b. Compute the dependency names by substituting S for `%'; if
  154.           the target pattern does not contain a slash, append D to the
  155.           front of each dependency name.
  156.  
  157.        c. Test whether all the dependencies exist or ought to exist.
  158.           (If a file name is mentioned in the makefile as a target or
  159.           as an explicit dependency, then we say it ought to exist.)
  160.  
  161.           If all dependencies exist or ought to exist, or there are no
  162.           dependencies, then this rule applies.
  163.  
  164.   6. If no pattern rule has been found so far, try harder.  For each
  165.      pattern rule in the list:
  166.  
  167.        a. If the rule is terminal, ignore it and go on to the next rule.
  168.  
  169.        b. Compute the dependency names as before.
  170.  
  171.        c. Test whether all the dependencies exist or ought to exist.
  172.  
  173.        d. For each dependency that does not exist, follow this algorithm
  174.           recursively to see if the dependency can be made by an
  175.           implicit rule.
  176.  
  177.        e. If all dependencies exist, ought to exist, or can be made by
  178.           implicit rules, then this rule applies.
  179.  
  180.   7. If no implicit rule applies, the rule for `.DEFAULT', if any,
  181.      applies.  In that case, give T the same commands that `.DEFAULT'
  182.      has.  Otherwise, there are no commands for T.
  183.  
  184.    Once a rule that applies has been found, for each target pattern of
  185. the rule other than the one that matched T or N, the `%' in the pattern
  186. is replaced with S and the resultant file name is stored until the
  187. commands to remake the target file T are executed.  After these
  188. commands are executed, each of these stored file names are entered into
  189. the data base and marked as having been updated and having the same
  190. update status as the file T.
  191.  
  192.    When the commands of a pattern rule are executed for T, the automatic
  193. variables are set corresponding to the target and dependencies.  *Note
  194. Automatic Variables: Automatic.
  195.  
  196. 
  197. File: make.info,  Node: Archives,  Next: Features,  Prev: Implicit Rules,  Up: Top
  198.  
  199. Using `make' to Update Archive Files
  200. ************************************
  201.  
  202.    "Archive files" are files containing named subfiles called
  203. "members"; they are maintained with the program `ar' and their main use
  204. is as subroutine libraries for linking.
  205.  
  206. * Menu:
  207.  
  208. * Archive Members::             Archive members as targets.
  209. * Archive Update::              The implicit rule for archive member targets.
  210. * Archive Suffix Rules::        You can write a special kind of suffix rule
  211.                                   for updating archives.
  212.  
  213. 
  214. File: make.info,  Node: Archive Members,  Next: Archive Update,  Up: Archives
  215.  
  216. Archive Members as Targets
  217. ==========================
  218.  
  219.    An individual member of an archive file can be used as a target or
  220. dependency in `make'.  The archive file must already exist, but the
  221. member need not exist.  You specify the member named MEMBER in archive
  222. file ARCHIVE as follows:
  223.  
  224.      ARCHIVE(MEMBER)
  225.  
  226. This construct is available only in targets and dependencies, not in
  227. commands!  Most programs that you might use in commands do not support
  228. this syntax and cannot act directly on archive members.  Only `ar' and
  229. other programs specifically designed to operate on archives can do so.
  230. Therefore, valid commands to update an archive member target probably
  231. must use `ar'.  For example, this rule says to create a member `hack.o'
  232. in archive `foolib' by copying the file `hack.o':
  233.  
  234.      foolib(hack.o) : hack.o
  235.              ar r foolib hack.o
  236.  
  237.    In fact, nearly all archive member targets are updated in just this
  238. way and there is an implicit rule to do it for you.
  239.  
  240.    To specify several members in the same archive, you can write all the
  241. member names together between the parentheses.  For example:
  242.  
  243.      foolib(hack.o kludge.o)
  244.  
  245. is equivalent to:
  246.  
  247.      foolib(hack.o) foolib(kludge.o)
  248.  
  249.    You can also use shell-style wildcards in an archive member
  250. reference.  *Note Using Wildcard Characters in File Names: Wildcards.
  251. For example, `foolib(*.o)' expands to all existing members of the
  252. `foolib' archive whose names end in `.o'; perhaps `foolib(hack.o)
  253. foolib(kludge.o)'.
  254.  
  255. 
  256. File: make.info,  Node: Archive Update,  Next: Archive Suffix Rules,  Prev: Archive Members,  Up: Archives
  257.  
  258. Implicit Rule for Archive Member Targets
  259. ========================================
  260.  
  261.    Recall that a target that looks like `A(M)' stands for the member
  262. named M in the archive file A.
  263.  
  264.    When `make' looks for an implicit rule for such a target, as a
  265. special feature it considers implicit rules that match `(M)', as well as
  266. those that match the actual target `A(M)'.
  267.  
  268.    This causes one special rule whose target is `(%)' to match.  This
  269. rule updates the target `A(M)' by copying the file M into the archive.
  270. For example, it will update the archive member target `foo.a(bar.o)' by
  271. copying the *file* `bar.o' into the archive `foo.a' as a *member* named
  272. `bar.o'.
  273.  
  274.    When this rule is chained with others, the result is very powerful.
  275. Thus, `make "foo.a(bar.o)"' (the quotes are needed to protect the `('
  276. and `)' from being interpreted specially by the shell) in the presence
  277. of a file `bar.c' is enough to cause the following commands to be run,
  278. even without a makefile:
  279.  
  280.      cc -c bar.c -o bar.o
  281.      ar r foo.a bar.o
  282.      rm -f bar.o
  283.  
  284. Here `make' has envisioned the file `bar.o' as an intermediate file.
  285. *Note Chains of Implicit Rules: Chained Rules.
  286.  
  287.    Implicit rules such as this one are written using the automatic
  288. variable `$%'.  *Note Automatic Variables: Automatic.
  289.  
  290.    An archive member name in an archive cannot contain a directory
  291. name, but it may be useful in a makefile to pretend that it does.  If
  292. you write an archive member target `foo.a(dir/file.o)', `make' will
  293. perform automatic updating with this command:
  294.  
  295.      ar r foo.a dir/file.o
  296.  
  297. which has the effect of copying the file `dir/foo.o' into a member
  298. named `foo.o'.  In connection with such usage, the automatic variables
  299. `%D' and `%F' may be useful.
  300.  
  301. * Menu:
  302.  
  303. * Archive Symbols::             How to update archive symbol directories.
  304.  
  305. 
  306. File: make.info,  Node: Archive Symbols,  Up: Archive Update
  307.  
  308. Updating Archive Symbol Directories
  309. -----------------------------------
  310.  
  311.    An archive file that is used as a library usually contains a special
  312. member named `__.SYMDEF' that contains a directory of the external
  313. symbol names defined by all the other members.  After you update any
  314. other members, you need to update `__.SYMDEF' so that it will summarize
  315. the other members properly.  This is done by running the `ranlib'
  316. program:
  317.  
  318.      ranlib ARCHIVEFILE
  319.  
  320.    Normally you would put this command in the rule for the archive file,
  321. and make all the members of the archive file dependencies of that rule.
  322. For example,
  323.  
  324.      libfoo.a: libfoo.a(x.o) libfoo.a(y.o) ...
  325.              ranlib libfoo.a
  326.  
  327. The effect of this is to update archive members `x.o', `y.o', etc., and
  328. then update the symbol directory member `__.SYMDEF' by running
  329. `ranlib'.  The rules for updating the members are not shown here; most
  330. likely you can omit them and use the implicit rule which copies files
  331. into the archive, as described in the preceding section.
  332.  
  333.    This is not necessary when using the GNU `ar' program, which updates
  334. the `__.SYMDEF' member automatically.
  335.  
  336. 
  337. File: make.info,  Node: Archive Suffix Rules,  Prev: Archive Update,  Up: Archives
  338.  
  339. Suffix Rules for Archive Files
  340. ==============================
  341.  
  342.    You can write a special kind of suffix rule for dealing with archive
  343. files.  *Note Suffix Rules::, for a full explanation of suffix rules.
  344. Archive suffix rules are obsolete in GNU `make', because pattern rules
  345. for archives are a more general mechanism (*note Archive Update::.).
  346. But they are retained for compatibility with other `make's.
  347.  
  348.    To write a suffix rule for archives, you simply write a suffix rule
  349. using the target suffix `.a' (the usual suffix for archive files).  For
  350. example, here is the old-fashioned suffix rule to update a library
  351. archive from C source files:
  352.  
  353.      .c.a:
  354.              $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $*.o
  355.              $(AR) r $@ $*.o
  356.              $(RM) $*.o
  357.  
  358. This works just as if you had written the pattern rule:
  359.  
  360.      (%.o): %.c
  361.              $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $*.o
  362.              $(AR) r $@ $*.o
  363.              $(RM) $*.o
  364.  
  365.    In fact, this is just what `make' does when it sees a suffix rule
  366. with `.a' as the target suffix.  Any double-suffix rule `.X.a' is
  367. converted to a pattern rule with the target pattern `(%.o)' and a
  368. dependency pattern of `%.X'.
  369.  
  370.    Since you might want to use `.a' as the suffix for some other kind
  371. of file, `make' also converts archive suffix rules to pattern rules in
  372. the normal way (*note Suffix Rules::.).  Thus a double-suffix rule
  373. `.X.a' produces two pattern rules: `(%.o): %.X' and `%.a: %.X'.
  374.  
  375. 
  376. File: make.info,  Node: Features,  Next: Missing,  Prev: Archives,  Up: Top
  377.  
  378. Features of GNU `make'
  379. **********************
  380.  
  381.    Here is a summary of the features of GNU `make', for comparison with
  382. and credit to other versions of `make'.  We consider the features of
  383. `make' in 4.2 BSD systems as a baseline.  If you are concerned with
  384. writing portable makefiles, you should use only the features of `make'
  385. *not* listed here or in *Note Missing::.
  386.  
  387.    Many features come from the version of `make' in System V.
  388.  
  389.    * The `VPATH' variable and its special meaning.  *Note Searching
  390.      Directories for Dependencies: Directory Search.  This feature
  391.      exists in System V `make', but is undocumented.  It is documented
  392.      in 4.3 BSD `make' (which says it mimics System V's `VPATH'
  393.      feature).
  394.  
  395.    * Included makefiles.  *Note Including Other Makefiles: Include.
  396.      Allowing multiple files to be included with a single directive is
  397.      a GNU extension.
  398.  
  399.    * Variables are read from and communicated via the environment.
  400.      *Note Variables from the Environment: Environment.
  401.  
  402.    * Options passed through the variable `MAKEFLAGS' to recursive
  403.      invocations of `make'.  *Note Communicating Options to a
  404.      Sub-`make': Options/Recursion.
  405.  
  406.    * The automatic variable `$%' is set to the member name in an
  407.      archive reference.  *Note Automatic Variables: Automatic.
  408.  
  409.    * The automatic variables `$@', `$*', `$<', `$%', and `$?' have
  410.      corresponding forms like `$(@F)' and `$(@D)'.  We have generalized
  411.      this to `$^' as an obvious extension.  *Note Automatic Variables:
  412.      Automatic.
  413.  
  414.    * Substitution variable references.  *Note Basics of Variable
  415.      References: Reference.
  416.  
  417.    * The command-line options `-b' and `-m', accepted and ignored.  In
  418.      System V `make', these options actually do something.
  419.  
  420.    * Execution of recursive commands to run `make' via the variable
  421.      `MAKE' even if `-n', `-q' or `-t' is specified.  *Note Recursive
  422.      Use of `make': Recursion.
  423.  
  424.    * Support for suffix `.a' in suffix rules.  *Note Archive Suffix
  425.      Rules::.  This feature is obsolete in GNU `make', because the
  426.      general feature of rule chaining (*note Chains of Implicit Rules:
  427.      Chained Rules.) allows one pattern rule for installing members in
  428.      an archive (*note Archive Update::.) to be sufficient.
  429.  
  430.    * The arrangement of lines and backslash-newline combinations in
  431.      commands is retained when the commands are printed, so they appear
  432.      as they do in the makefile, except for the stripping of initial
  433.      whitespace.
  434.  
  435.    The following features were inspired by various other versions of
  436. `make'.  In some cases it is unclear exactly which versions inspired
  437. which others.
  438.  
  439.    * Pattern rules using `%'.  This has been implemented in several
  440.      versions of `make'.  We're not sure who invented it first, but
  441.      it's been spread around a bit.  *Note Defining and Redefining
  442.      Pattern Rules: Pattern Rules.
  443.  
  444.    * Rule chaining and implicit intermediate files.  This was
  445.      implemented by Stu Feldman in his version of `make' for AT&T
  446.      Eighth Edition Research Unix, and later by Andrew Hume of AT&T
  447.      Bell Labs in his `mk' program (where he terms it "transitive
  448.      closure").  We do not really know if we got this from either of
  449.      them or thought it up ourselves at the same time.  *Note Chains of
  450.      Implicit Rules: Chained Rules.
  451.  
  452.    * The automatic variable `$^' containing a list of all dependencies
  453.      of the current target.  We did not invent this, but we have no
  454.      idea who did.  *Note Automatic Variables: Automatic.
  455.  
  456.    * The "what if" flag (`-W' in GNU `make') was (as far as we know)
  457.      invented by Andrew Hume in `mk'.  *Note Instead of Executing the
  458.      Commands: Instead of Execution.
  459.  
  460.    * The concept of doing several things at once (parallelism) exists in
  461.      many incarnations of `make' and similar programs, though not in the
  462.      System V or BSD implementations.  *Note Command Execution:
  463.      Execution.
  464.  
  465.    * Modified variable references using pattern substitution come from
  466.      SunOS 4.  *Note Basics of Variable References: Reference.  This
  467.      functionality was provided in GNU `make' by the `patsubst'
  468.      function before the alternate syntax was implemented for
  469.      compatibility with SunOS 4.  It is not altogether clear who
  470.      inspired whom, since GNU `make' had `patsubst' before SunOS 4 was
  471.      released.
  472.  
  473.    * The special significance of `+' characters preceding command lines
  474.      (*note Instead of Executing the Commands: Instead of Execution.) is
  475.      mandated by `IEEE Standard 1003.2-1992' (POSIX.2).
  476.  
  477.    * The `+=' syntax to append to the value of a variable comes from
  478.      SunOS 4 `make'.  *Note Appending More Text to Variables: Appending.
  479.  
  480.    * The syntax `ARCHIVE(MEM1 MEM2...)' to list multiple members in a
  481.      single archive file comes from SunOS 4 `make'.  *Note Archive
  482.      Members::.
  483.  
  484.    * The `-include' directive to include makefiles with no error for a
  485.      nonexistent file comes from SunOS 4 `make'.  (But note that SunOS 4
  486.      `make' does not allow multiple makefiles to be specified in one
  487.      `-include' directive.)
  488.  
  489.    The remaining features are inventions new in GNU `make':
  490.  
  491.    * Use the `-v' or `--version' option to print version and copyright
  492.      information.
  493.  
  494.    * Use the `-h' or `--help' option to summarize the options to `make'.
  495.  
  496.    * Simply-expanded variables.  *Note The Two Flavors of Variables:
  497.      Flavors.
  498.  
  499.    * Pass command-line variable assignments automatically through the
  500.      variable `MAKE' to recursive `make' invocations.  *Note Recursive
  501.      Use of `make': Recursion.
  502.  
  503.    * Use the `-C' or `--directory' command option to change directory.
  504.      *Note Summary of Options: Options Summary.
  505.  
  506.    * Make verbatim variable definitions with `define'.  *Note Defining
  507.      Variables Verbatim: Defining.
  508.  
  509.    * Declare phony targets with the special target `.PHONY'.
  510.  
  511.      Andrew Hume of AT&T Bell Labs implemented a similar feature with a
  512.      different syntax in his `mk' program.  This seems to be a case of
  513.      parallel discovery.  *Note Phony Targets: Phony Targets.
  514.  
  515.    * Manipulate text by calling functions.  *Note Functions for
  516.      Transforming Text: Functions.
  517.  
  518.    * Use the `-o' or `--old-file' option to pretend a file's
  519.      modification-time is old.  *Note Avoiding Recompilation of Some
  520.      Files: Avoiding Compilation.
  521.  
  522.    * Conditional execution.
  523.  
  524.      This feature has been implemented numerous times in various
  525.      versions of `make'; it seems a natural extension derived from the
  526.      features of the C preprocessor and similar macro languages and is
  527.      not a revolutionary concept.  *Note Conditional Parts of
  528.      Makefiles: Conditionals.
  529.  
  530.    * Specify a search path for included makefiles.  *Note Including
  531.      Other Makefiles: Include.
  532.  
  533.    * Specify extra makefiles to read with an environment variable.
  534.      *Note The Variable `MAKEFILES': MAKEFILES Variable.
  535.  
  536.    * Strip leading sequences of `./' from file names, so that `./FILE'
  537.      and `FILE' are considered to be the same file.
  538.  
  539.    * Use a special search method for library dependencies written in the
  540.      form `-lNAME'.  *Note Directory Search for Link Libraries:
  541.      Libraries/Search.
  542.  
  543.    * Allow suffixes for suffix rules (*note Old-Fashioned Suffix Rules:
  544.      Suffix Rules.) to contain any characters.  In other versions of
  545.      `make', they must begin with `.' and not contain any `/'
  546.      characters.
  547.  
  548.    * Keep track of the current level of `make' recursion using the
  549.      variable `MAKELEVEL'.  *Note Recursive Use of `make': Recursion.
  550.  
  551.    * Specify static pattern rules.  *Note Static Pattern Rules: Static
  552.      Pattern.
  553.  
  554.    * Provide selective `vpath' search.  *Note Searching Directories for
  555.      Dependencies: Directory Search.
  556.  
  557.    * Provide computed variable references.  *Note Basics of Variable
  558.      References: Reference.
  559.  
  560.    * Update makefiles.  *Note How Makefiles Are Remade: Remaking
  561.      Makefiles.  System V `make' has a very, very limited form of this
  562.      functionality in that it will check out SCCS files for makefiles.
  563.  
  564.    * Various new built-in implicit rules.  *Note Catalogue of Implicit
  565.      Rules: Catalogue of Rules.
  566.  
  567. 
  568. File: make.info,  Node: Missing,  Next: Makefile Conventions,  Prev: Features,  Up: Top
  569.  
  570. Incompatibilities and Missing Features
  571. **************************************
  572.  
  573.    The `make' programs in various other systems support a few features
  574. that are not implemented in GNU `make'.  The POSIX.2 standard (`IEEE
  575. Standard 1003.2-1992') which specifies `make' does not require any of
  576. these features.
  577.  
  578.    * A target of the form `FILE((ENTRY))' stands for a member of
  579.      archive file FILE.  The member is chosen, not by name, but by
  580.      being an object file which defines the linker symbol ENTRY.
  581.  
  582.      This feature was not put into GNU `make' because of the
  583.      nonmodularity of putting knowledge into `make' of the internal
  584.      format of archive file symbol tables.  *Note Updating Archive
  585.      Symbol Directories: Archive Symbols.
  586.  
  587.    * Suffixes (used in suffix rules) that end with the character `~'
  588.      have a special meaning to System V `make'; they refer to the SCCS
  589.      file that corresponds to the file one would get without the `~'.
  590.      For example, the suffix rule `.c~.o' would make the file `N.o' from
  591.      the SCCS file `s.N.c'.  For complete coverage, a whole series of
  592.      such suffix rules is required.  *Note Old-Fashioned Suffix Rules:
  593.      Suffix Rules.
  594.  
  595.      In GNU `make', this entire series of cases is handled by two
  596.      pattern rules for extraction from SCCS, in combination with the
  597.      general feature of rule chaining.  *Note Chains of Implicit Rules:
  598.      Chained Rules.
  599.  
  600.    * In System V `make', the string `$$@' has the strange meaning that,
  601.      in the dependencies of a rule with multiple targets, it stands for
  602.      the particular target that is being processed.
  603.  
  604.      This is not defined in GNU `make' because `$$' should always stand
  605.      for an ordinary `$'.
  606.  
  607.      It is possible to get this functionality through the use of static
  608.      pattern rules (*note Static Pattern Rules: Static Pattern.).  The
  609.      System V `make' rule:
  610.  
  611.           $(targets): $$@.o lib.a
  612.  
  613.      can be replaced with the GNU `make' static pattern rule:
  614.  
  615.           $(targets): %: %.o lib.a
  616.  
  617.    * In System V and 4.3 BSD `make', files found by `VPATH' search
  618.      (*note Searching Directories for Dependencies: Directory Search.)
  619.      have their names changed inside command strings.  We feel it is
  620.      much cleaner to always use automatic variables and thus make this
  621.      feature obsolete.
  622.  
  623.    * In some Unix `make's, implicit rule search (*note Using Implicit
  624.      Rules: Implicit Rules.) is apparently done for *all* targets, not
  625.      just those without commands.  This means you can do:
  626.  
  627.           foo.o:
  628.                   cc -c foo.c
  629.  
  630.      and Unix `make' will intuit that `foo.o' depends on `foo.c'.
  631.  
  632.      We feel that such usage is broken.  The dependency properties of
  633.      `make' are well-defined (for GNU `make', at least), and doing such
  634.      a thing simply does not fit the model.
  635.  
  636.    * GNU `make' does not include any built-in implicit rules for
  637.      compiling or preprocessing EFL programs.  If we hear of anyone who
  638.      is using EFL, we will gladly add them.
  639.  
  640.    * It appears that in SVR4 `make', a suffix rule can be specified with
  641.      no commands, and it is treated as if it had empty commands (*note
  642.      Empty Commands::.).  For example:
  643.  
  644.           .c.a:
  645.  
  646.      will override the built-in `.c.a' suffix rule.
  647.  
  648.      We feel that it is cleaner for a rule without commands to always
  649.      simply add to the dependency list for the target.  The above
  650.      example can be easily rewritten to get the desired behavior in GNU
  651.      `make':
  652.  
  653.           .c.a: ;
  654.  
  655.    * Some versions of `make' invoke the shell with the `-e' flag,
  656.      except under `-k' (*note Testing the Compilation of a Program:
  657.      Testing.).  The `-e' flag tells the shell to exit as soon as any
  658.      program it runs returns a nonzero status.  We feel it is cleaner to
  659.      write each shell command line to stand on its own and not require
  660.      this special treatment.
  661.  
  662. 
  663. File: make.info,  Node: Makefile Conventions,  Next: Quick Reference,  Prev: Missing,  Up: Top
  664.  
  665. Makefile Conventions
  666. ********************
  667.  
  668.    This chapter describes conventions for writing the Makefiles for GNU
  669. programs.
  670.  
  671. * Menu:
  672.  
  673. * Makefile Basics::
  674. * Utilities in Makefiles::
  675. * Standard Targets::
  676. * Command Variables::
  677. * Directory Variables::
  678.  
  679. 
  680. File: make.info,  Node: Makefile Basics,  Next: Utilities in Makefiles,  Up: Makefile Conventions
  681.  
  682. General Conventions for Makefiles
  683. =================================
  684.  
  685.    Every Makefile should contain this line:
  686.  
  687.      SHELL = /bin/sh
  688.  
  689. to avoid trouble on systems where the `SHELL' variable might be
  690. inherited from the environment.  (This is never a problem with GNU
  691. `make'.)
  692.  
  693.    Don't assume that `.' is in the path for command execution.  When
  694. you need to run programs that are a part of your package during the
  695. make, please make sure that it uses `./' if the program is built as
  696. part of the make or `$(srcdir)/' if the file is an unchanging part of
  697. the source code.  Without one of these prefixes, the current search
  698. path is used.
  699.  
  700.    The distinction between `./' and `$(srcdir)/' is important when
  701. using the `--srcdir' option to `configure'.  A rule of the form:
  702.  
  703.      foo.1 : foo.man sedscript
  704.              sed -e sedscript foo.man > foo.1
  705.  
  706. will fail when the current directory is not the source directory,
  707. because `foo.man' and `sedscript' are not in the current directory.
  708.  
  709.    When using GNU `make', relying on `VPATH' to find the source file
  710. will work in the case where there is a single dependency file, since
  711. the `make' automatic variable `$<' will represent the source file
  712. wherever it is.  (Many versions of `make' set `$<' only in implicit
  713. rules.)  A makefile target like
  714.  
  715.      foo.o : bar.c
  716.              $(CC) -I. -I$(srcdir) $(CFLAGS) -c bar.c -o foo.o
  717.  
  718. should instead be written as
  719.  
  720.      foo.o : bar.c
  721.              $(CC) $(CFLAGS) $< -o $@
  722.  
  723. in order to allow `VPATH' to work correctly.  When the target has
  724. multiple dependencies, using an explicit `$(srcdir)' is the easiest way
  725. to make the rule work well.  For example, the target above for `foo.1'
  726. is best written as:
  727.  
  728.      foo.1 : foo.man sedscript
  729.              sed -s $(srcdir)/sedscript $(srcdir)/foo.man > foo.1
  730.  
  731. 
  732. File: make.info,  Node: Utilities in Makefiles,  Next: Standard Targets,  Prev: Makefile Basics,  Up: Makefile Conventions
  733.  
  734. Utilities in Makefiles
  735. ======================
  736.  
  737.    Write the Makefile commands (and any shell scripts, such as
  738. `configure') to run in `sh', not in `csh'.  Don't use any special
  739. features of `ksh' or `bash'.
  740.  
  741.    The `configure' script and the Makefile rules for building and
  742. installation should not use any utilities directly except these:
  743.  
  744.      cat cmp cp echo egrep expr grep
  745.      ln mkdir mv pwd rm rmdir sed test touch
  746.  
  747.    Stick to the generally supported options for these programs.  For
  748. example, don't use `mkdir -p', convenient as it may be, because most
  749. systems don't support it.
  750.  
  751.    The Makefile rules for building and installation can also use
  752. compilers and related programs, but should do so via `make' variables
  753. so that the user can substitute alternatives.  Here are some of the
  754. programs we mean:
  755.  
  756.      ar bison cc flex install ld lex
  757.      make makeinfo ranlib texi2dvi yacc
  758.  
  759.    When you use `ranlib', you should test whether it exists, and run it
  760. only if it exists, so that the distribution will work on systems that
  761. don't have `ranlib'.
  762.  
  763.    If you use symbolic links, you should implement a fallback for
  764. systems that don't have symbolic links.
  765.  
  766.    It is ok to use other utilities in Makefile portions (or scripts)
  767. intended only for particular systems where you know those utilities to
  768. exist.
  769.  
  770. 
  771. File: make.info,  Node: Standard Targets,  Next: Command Variables,  Prev: Utilities in Makefiles,  Up: Makefile Conventions
  772.  
  773. Standard Targets for Users
  774. ==========================
  775.  
  776.    All GNU programs should have the following targets in their
  777. Makefiles:
  778.  
  779. `all'
  780.      Compile the entire program.  This should be the default target.
  781.      This target need not rebuild any documentation files; Info files
  782.      should normally be included in the distribution, and DVI files
  783.      should be made only when explicitly asked for.
  784.  
  785. `install'
  786.      Compile the program and copy the executables, libraries, and so on
  787.      to the file names where they should reside for actual use.  If
  788.      there is a simple test to verify that a program is properly
  789.      installed, this target should run that test.
  790.  
  791.      The commands should create all the directories in which files are
  792.      to be installed, if they don't already exist.  This includes the
  793.      directories specified as the values of the variables `prefix' and
  794.      `exec_prefix', as well as all subdirectories that are needed.  One
  795.      way to do this is by means of an `installdirs' target as described
  796.      below.
  797.  
  798.      Use `-' before any command for installing a man page, so that
  799.      `make' will ignore any errors.  This is in case there are systems
  800.      that don't have the Unix man page documentation system installed.
  801.  
  802.      The way to install Info files is to copy them into `$(infodir)'
  803.      with `$(INSTALL_DATA)' (*note Command Variables::.), and then run
  804.      the `install-info' program if it is present.  `install-info' is a
  805.      script that edits the Info `dir' file to add or update the menu
  806.      entry for the given Info file; it will be part of the Texinfo
  807.      package.  Here is a sample rule to install an Info file:
  808.  
  809.           $(infodir)/foo.info: foo.info
  810.           # There may be a newer info file in . than in srcdir.
  811.                   -if test -f foo.info; then d=.; \
  812.                    else d=$(srcdir); fi; \
  813.                   $(INSTALL_DATA) $$d/foo.info $@; \
  814.           # Run install-info only if it exists.
  815.           # Use `if' instead of just prepending `-' to the
  816.           # line so we notice real errors from install-info.
  817.                   if install-info --version >/dev/null 2>&1; then \
  818.                     install-info --infodir=$(infodir) $$d/foo.info; \
  819.                   else true; fi
  820.  
  821. `uninstall'
  822.      Delete all the installed files that the `install' target would
  823.      create (but not the noninstalled files such as `make all' would
  824.      create).
  825.  
  826. `clean'
  827.      Delete all files from the current directory that are normally
  828.      created by building the program.  Don't delete the files that
  829.      record the configuration.  Also preserve files that could be made
  830.      by building, but normally aren't because the distribution comes
  831.      with them.
  832.  
  833.      Delete `.dvi' files here if they are not part of the distribution.
  834.  
  835. `distclean'
  836.      Delete all files from the current directory that are created by
  837.      configuring or building the program.  If you have unpacked the
  838.      source and built the program without creating any other files,
  839.      `make distclean' should leave only the files that were in the
  840.      distribution.
  841.  
  842. `mostlyclean'
  843.      Like `clean', but may refrain from deleting a few files that people
  844.      normally don't want to recompile.  For example, the `mostlyclean'
  845.      target for GCC does not delete `libgcc.a', because recompiling it
  846.      is rarely necessary and takes a lot of time.
  847.  
  848. `realclean'
  849.      Delete everything from the current directory that can be
  850.      reconstructed with this Makefile.  This typically includes
  851.      everything deleted by `distclean', plus more: C source files
  852.      produced by Bison, tags tables, Info files, and so on.
  853.  
  854.      One exception, however: `make realclean' should not delete
  855.      `configure' even if `configure' can be remade using a rule in the
  856.      Makefile.  More generally, `make realclean' should not delete
  857.      anything that needs to exist in order to run `configure' and then
  858.      begin to build the program.
  859.  
  860. `TAGS'
  861.      Update a tags table for this program.
  862.  
  863. `info'
  864.      Generate any Info files needed.  The best way to write the rules
  865.      is as follows:
  866.  
  867.           info: foo.info
  868.           
  869.           foo.info: foo.texi chap1.texi chap2.texi
  870.                   $(MAKEINFO) $(srcdir)/foo.texi
  871.  
  872.      You must define the variable `MAKEINFO' in the Makefile.  It should
  873.      run the `makeinfo' program, which is part of the Texinfo
  874.      distribution.
  875.  
  876. `dvi'
  877.      Generate DVI files for all TeXinfo documentation.  For example:
  878.  
  879.           dvi: foo.dvi
  880.           
  881.           foo.dvi: foo.texi chap1.texi chap2.texi
  882.                   $(TEXI2DVI) $(srcdir)/foo.texi
  883.  
  884.      You must define the variable `TEXI2DVI' in the Makefile.  It should
  885.      run the program `texi2dvi', which is part of the Texinfo
  886.      distribution.  Alternatively, write just the dependencies, and
  887.      allow GNU Make to provide the command.
  888.  
  889. `dist'
  890.      Create a distribution tar file for this program.  The tar file
  891.      should be set up so that the file names in the tar file start with
  892.      a subdirectory name which is the name of the package it is a
  893.      distribution for.  This name can include the version number.
  894.  
  895.      For example, the distribution tar file of GCC version 1.40 unpacks
  896.      into a subdirectory named `gcc-1.40'.
  897.  
  898.      The easiest way to do this is to create a subdirectory
  899.      appropriately named, use `ln' or `cp' to install the proper files
  900.      in it, and then `tar' that subdirectory.
  901.  
  902.      The `dist' target should explicitly depend on all non-source files
  903.      that are in the distribution, to make sure they are up to date in
  904.      the distribution.  *Note Making Releases: (standards)Releases.
  905.  
  906. `check'
  907.      Perform self-tests (if any).  The user must build the program
  908.      before running the tests, but need not install the program; you
  909.      should write the self-tests so that they work when the program is
  910.      built but not installed.
  911.  
  912.    The following targets are suggested as conventional names, for
  913. programs in which they are useful.
  914.  
  915. `installcheck'
  916.      Perform installation tests (if any).  The user must build and
  917.      install the program before running the tests.  You should not
  918.      assume that `$(bindir)' is in the search path.
  919.  
  920. `installdirs'
  921.      It's useful to add a target named `installdirs' to create the
  922.      directories where files are installed, and their parent
  923.      directories.  There is a script called `mkinstalldirs' which is
  924.      convenient for this; find it in the Texinfo package.You can use a
  925.      rule like this:
  926.  
  927.           # Make sure all installation directories (e.g. $(bindir))
  928.           # actually exist by making them if necessary.
  929.           installdirs: mkinstalldirs
  930.                   $(srcdir)/mkinstalldirs $(bindir) $(datadir) \
  931.                                           $(libdir) $(infodir) \
  932.                                           $(mandir)
  933.  
  934. 
  935. File: make.info,  Node: Command Variables,  Next: Directory Variables,  Prev: Standard Targets,  Up: Makefile Conventions
  936.  
  937. Variables for Specifying Commands
  938. =================================
  939.  
  940.    Makefiles should provide variables for overriding certain commands,
  941. options, and so on.
  942.  
  943.    In particular, you should run most utility programs via variables.
  944. Thus, if you use Bison, have a variable named `BISON' whose default
  945. value is set with `BISON = bison', and refer to it with `$(BISON)'
  946. whenever you need to use Bison.
  947.  
  948.    File management utilities such as `ln', `rm', `mv', and so on, need
  949. not be referred to through variables in this way, since users don't
  950. need to replace them with other programs.
  951.  
  952.    Each program-name variable should come with an options variable that
  953. is used to supply options to the program.  Append `FLAGS' to the
  954. program-name variable name to get the options variable name--for
  955. example, `BISONFLAGS'.  (The name `CFLAGS' is an exception to this
  956. rule, but we keep it because it is standard.)  Use `CPPFLAGS' in any
  957. compilation command that runs the preprocessor, and use `LDFLAGS' in
  958. any compilation command that does linking as well as in any direct use
  959. of `ld'.
  960.  
  961.    If there are C compiler options that *must* be used for proper
  962. compilation of certain files, do not include them in `CFLAGS'.  Users
  963. expect to be able to specify `CFLAGS' freely themselves.  Instead,
  964. arrange to pass the necessary options to the C compiler independently
  965. of `CFLAGS', by writing them explicitly in the compilation commands or
  966. by defining an implicit rule, like this:
  967.  
  968.      CFLAGS = -g
  969.      ALL_CFLAGS = -I. $(CFLAGS)
  970.      .c.o:
  971.              $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
  972.  
  973.    Do include the `-g' option in `CFLAGS', because that is not
  974. *required* for proper compilation.  You can consider it a default that
  975. is only recommended.  If the package is set up so that it is compiled
  976. with GCC by default, then you might as well include `-O' in the default
  977. value of `CFLAGS' as well.
  978.  
  979.    Put `CFLAGS' last in the compilation command, after other variables
  980. containing compiler options, so the user can use `CFLAGS' to override
  981. the others.
  982.  
  983.    Every Makefile should define the variable `INSTALL', which is the
  984. basic command for installing a file into the system.
  985.  
  986.    Every Makefile should also define the variables `INSTALL_PROGRAM'
  987. and `INSTALL_DATA'.  (The default for each of these should be
  988. `$(INSTALL)'.)  Then it should use those variables as the commands for
  989. actual installation, for executables and nonexecutables respectively.
  990. Use these variables as follows:
  991.  
  992.      $(INSTALL_PROGRAM) foo $(bindir)/foo
  993.      $(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a
  994.  
  995. Always use a file name, not a directory name, as the second argument of
  996. the installation commands.  Use a separate command for each file to be
  997. installed.
  998.  
  999. 
  1000. File: make.info,  Node: Directory Variables,  Prev: Command Variables,  Up: Makefile Conventions
  1001.  
  1002. Variables for Installation Directories
  1003. ======================================
  1004.  
  1005.    Installation directories should always be named by variables, so it
  1006. is easy to install in a nonstandard place.  The standard names for these
  1007. variables are:
  1008.  
  1009. `prefix'
  1010.      A prefix used in constructing the default values of the variables
  1011.      listed below.  The default value of `prefix' should be `/usr/local'
  1012.      (at least for now).
  1013.  
  1014. `exec_prefix'
  1015.      A prefix used in constructing the default values of some of the
  1016.      variables listed below.  The default value of `exec_prefix' should
  1017.      be `$(prefix)'.
  1018.  
  1019.      Generally, `$(exec_prefix)' is used for directories that contain
  1020.      machine-specific files (such as executables and subroutine
  1021.      libraries), while `$(prefix)' is used directly for other
  1022.      directories.
  1023.  
  1024. `bindir'
  1025.      The directory for installing executable programs that users can
  1026.      run.  This should normally be `/usr/local/bin', but write it as
  1027.      `$(exec_prefix)/bin'.
  1028.  
  1029. `libdir'
  1030.      The directory for installing executable files to be run by the
  1031.      program rather than by users.  Object files and libraries of
  1032.      object code should also go in this directory.  The idea is that
  1033.      this directory is used for files that pertain to a specific
  1034.      machine architecture, but need not be in the path for commands.
  1035.      The value of `libdir' should normally be `/usr/local/lib', but
  1036.      write it as `$(exec_prefix)/lib'.
  1037.  
  1038. `datadir'
  1039.      The directory for installing read-only data files which the
  1040.      programs refer to while they run.  This directory is used for
  1041.      files which are independent of the type of machine being used.
  1042.      This should normally be `/usr/local/lib', but write it as
  1043.      `$(prefix)/lib'.
  1044.  
  1045. `statedir'
  1046.      The directory for installing data files which the programs modify
  1047.      while they run.  These files should be independent of the type of
  1048.      machine being used, and it should be possible to share them among
  1049.      machines at a network installation.  This should normally be
  1050.      `/usr/local/lib', but write it as `$(prefix)/lib'.
  1051.  
  1052. `includedir'
  1053.      The directory for installing header files to be included by user
  1054.      programs with the C `#include' preprocessor directive.  This
  1055.      should normally be `/usr/local/include', but write it as
  1056.      `$(prefix)/include'.
  1057.  
  1058.      Most compilers other than GCC do not look for header files in
  1059.      `/usr/local/include'.  So installing the header files this way is
  1060.      only useful with GCC.  Sometimes this is not a problem because some
  1061.      libraries are only really intended to work with GCC.  But some
  1062.      libraries are intended to work with other compilers.  They should
  1063.      install their header files in two places, one specified by
  1064.      `includedir' and one specified by `oldincludedir'.
  1065.  
  1066. `oldincludedir'
  1067.      The directory for installing `#include' header files for use with
  1068.      compilers other than GCC.  This should normally be `/usr/include'.
  1069.  
  1070.      The Makefile commands should check whether the value of
  1071.      `oldincludedir' is empty.  If it is, they should not try to use
  1072.      it; they should cancel the second installation of the header files.
  1073.  
  1074.      A package should not replace an existing header in this directory
  1075.      unless the header came from the same package.  Thus, if your Foo
  1076.      package provides a header file `foo.h', then it should install the
  1077.      header file in the `oldincludedir' directory if either (1) there
  1078.      is no `foo.h' there or (2) the `foo.h' that exists came from the
  1079.      Foo package.
  1080.  
  1081.      To tell whether `foo.h' came from the Foo package, put a magic
  1082.      string in the file--part of a comment--and grep for that string.
  1083.  
  1084. `mandir'
  1085.      The directory for installing the man pages (if any) for this
  1086.      package.  It should include the suffix for the proper section of
  1087.      the manual--usually `1' for a utility.  It will normally be
  1088.      `/usr/local/man/man1', but you should write it as
  1089.      `$(prefix)/man/man1'.
  1090.  
  1091. `man1dir'
  1092.      The directory for installing section 1 man pages.
  1093.  
  1094. `man2dir'
  1095.      The directory for installing section 2 man pages.
  1096.  
  1097. `...'
  1098.      Use these names instead of `mandir' if the package needs to
  1099.      install man pages in more than one section of the manual.
  1100.  
  1101.      *Don't make the primary documentation for any GNU software be a
  1102.      man page.  Write a manual in Texinfo instead.  Man pages are just
  1103.      for the sake of people running GNU software on Unix, which is a
  1104.      secondary application only.*
  1105.  
  1106. `manext'
  1107.      The file name extension for the installed man page.  This should
  1108.      contain a period followed by the appropriate digit; it should
  1109.      normally be `.1'.
  1110.  
  1111. `man1ext'
  1112.      The file name extension for installed section 1 man pages.
  1113.  
  1114. `man2ext'
  1115.      The file name extension for installed section 2 man pages.
  1116.  
  1117. `...'
  1118.      Use these names instead of `manext' if the package needs to
  1119.      install man pages in more than one section of the manual.
  1120.  
  1121. `infodir'
  1122.      The directory for installing the Info files for this package.  By
  1123.      default, it should be `/usr/local/info', but it should be written
  1124.      as `$(prefix)/info'.
  1125.  
  1126. `srcdir'
  1127.      The directory for the sources being compiled.  The value of this
  1128.      variable is normally inserted by the `configure' shell script.
  1129.  
  1130.    For example:
  1131.  
  1132.      # Common prefix for installation directories.
  1133.      # NOTE: This directory must exist when you start the install.
  1134.      prefix = /usr/local
  1135.      exec_prefix = $(prefix)
  1136.      # Where to put the executable for the command `gcc'.
  1137.      bindir = $(exec_prefix)/bin
  1138.      # Where to put the directories used by the compiler.
  1139.      libdir = $(exec_prefix)/lib
  1140.      # Where to put the Info files.
  1141.      infodir = $(prefix)/info
  1142.  
  1143.    If your program installs a large number of files into one of the
  1144. standard user-specified directories, it might be useful to group them
  1145. into a subdirectory particular to that program.  If you do this, you
  1146. should write the `install' rule to create these subdirectories.
  1147.  
  1148.    Do not expect the user to include the subdirectory name in the value
  1149. of any of the variables listed above.  The idea of having a uniform set
  1150. of variable names for installation directories is to enable the user to
  1151. specify the exact same values for several different GNU packages.  In
  1152. order for this to be useful, all the packages must be designed so that
  1153. they will work sensibly when the user does so.
  1154.  
  1155.