home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 529b.lha / BMake_v1.1 / bmake.doc < prev    next >
Encoding:
Text File  |  1991-07-03  |  23.9 KB  |  672 lines

  1.     
  2.                        Documentation For The Make Utility
  3.                            Copyright © 1991 by Ben Eng
  4.  
  5.  
  6. Ben Eng
  7. 150 Beverley St. Apt #1L
  8. Toronto, Ontario
  9. M5T 1Y6
  10.  
  11. ben@contact.uucp
  12. BIX: jetpen
  13.  
  14.  
  15. OVERVIEW
  16.  
  17. Make is a programming utility used to automate the process of recompiling
  18. multiple interdependent source files into an output file, called the goal.
  19. The rules for making the goal are explicitly stated in an input file called
  20. the Makefile, and implicitly determined from builtin inference rules.
  21. Normally, the Makefile for a goal is written so that the only thing that
  22. needs to be done to recompile newly modified source files is to run the
  23. Make program.
  24.  
  25.  
  26. MAKEFILE
  27.  
  28. The Makefile is a text file which is read by the Make program.  The
  29. Makefile is written to define the rules for making a goal up to date.  A
  30. goal file is up to date if it has a modification datestamp that is more
  31. recent than all of its dependents, after all dependents are made up to date
  32. with respect to their dependents.  This criterion for up to dateness is
  33. applied recursively, such that the most deeply nested dependent will be
  34. made before any target file that depends on it.
  35.  
  36. Here is an example of a simple Makefile, that does not correspond to what
  37. would normally be used:
  38.  
  39. # comment1
  40. # comment2
  41.  
  42. goal: target.o ; command three
  43.  
  44. target.o: source.c header.h
  45.     command one
  46.     command two
  47.  
  48.  
  49. In a Makefile, any line beginning with a `#' character is considered to be
  50. a comment line.  Comment lines are ignored by the Make program.  Rules are
  51. defined by a line that begins with one or more target filenames, followed
  52. by a colon, an optional list of dependent filenames, an optional semicolon
  53. and an optional command.  Subsequent lines that begin with a tab character
  54. are command lines associated with the rule; the next line that does not
  55. begin with a tab character indicates the end of the current rule and the
  56. beginning of a new rule.
  57.  
  58. In the above example, the Make program will read the Makefile and find the
  59. first target filename to be `goal'.  It will then attempt to make `goal' up
  60. to date by first making its dependencies (namely, `target.o') up to date.
  61. In order to make `target.o' up to date, Make requires a rule that contains
  62. `target.o' as a target filename.  Such a rule exists in the example
  63. Makefile with dependencies `source.c' and `header.h', which must in turn be
  64. made before `target.o' can be made up to date.  Since `source.c' and
  65. `header.h' are not defined as targets in the Makefile, the Make program
  66. must use builtin rules of inference to make those files up to date, or it
  67. must give up and report that is doesn't know how to make the target.  As it
  68. turns out, the source and header files are known by builtin rules of
  69. inference to require no further action to be made up to date, so the Make
  70. program can continue to make `target.o' now that its dependencies have
  71. fulfilled their requirements.  In order to make `target.o' up to date,
  72. `command one' must be executed successfully, and then `command two' must be
  73. executed successfully after that.  Finally, the goal can be made by
  74. executing the command line, `command three', and the Make program will
  75. terminate.
  76.  
  77.  
  78. DEPENDENCIES
  79.  
  80. If there are no dependencies for a target, and a target needs to be remade
  81. by the Make program, then the target is always remade.  A target with no
  82. dependencies will always have its commands executed when that target needs
  83. to be remade.
  84.  
  85. Additional dependencies can be added to a target defined in another rule by
  86. writing a new rule which declares the additional dependencies.  Only one of
  87. the rules may contain command lines, otherwise it is an error.  An example
  88. where this might be done is given below:
  89.  
  90. target1.o target2.o : global.h
  91. target1.o : target1.h
  92. target2.o : target2.h
  93.  
  94.  
  95. DOUBLE COLON RULES
  96.  
  97. If multiple rules are given for a target name using `::' to delimit the
  98. target names from the dependencies, then such rules are called double colon
  99. rules.  Each double colon rules is independent of the others.  A Double
  100. colon rule allows a target name to depend upon multiple mutually exclusive
  101. dependencies.  The first double colon rule whose dependencies are found to
  102. exist is the rule which applies to the target.
  103.  
  104. (TODO:  This feature is not supported yet.)
  105.  
  106.  
  107. MACROS and VARIABLES
  108.  
  109. Variables can contain macro definitions of multiple filenames or other
  110. text.  They are useful for replacing multiple occurrences of the same body
  111. of text with references to a variable (macro expansion).  A variable is
  112. defined in the Makefile with an assignment statement.  Only the last
  113. assignment of a variable is recognized, because the rules are processed
  114. after the entire Makefile has been interpreted into internal rules by the
  115. Make program.
  116.  
  117. In a makefile, the line:
  118.  
  119. myvariable = source.c header.h
  120.  
  121. is used to assign the string `source.c header.h' to the variable
  122. named `myvariable'.  In the following rule definition:
  123.  
  124. target.o: $(myvariable)
  125.  
  126. the `$(myvariable)' reference is expanded into the string assigned to
  127. `myvariable'.  If the macro expansion contains further references to other
  128. variables, then they are also recursively expanded until the resulting
  129. string is fully expanded.  Undefined macros are expanded to nothing (empty
  130. strings).  `${myvariable}' is equivalent to `$(myvariable)'.  For single
  131. character variable names, the parentheses or braces are not necessary to
  132. expand the macro; the single character may immediately follow the `$'.
  133.  
  134. Additional text can be concatenated to the end of the value of an existing
  135. variable by using the `+=' operator, like this:
  136.  
  137. alpha = abc
  138. alpha += def
  139.  
  140. The result of `$(alpha)' is now `abc def'.  Notice the space inserted at
  141. the point of concatenation.  This ensures that filenames are not split
  142. between different lines.
  143.  
  144. It is possible to define a variable which results in an infinitely
  145. recursive macro expansion.  This is illegal, and it will result in an error
  146. when that variable is referenced.
  147.  
  148. A variable can be defined, such that its value is expanded immediately at
  149. the time of assignment.  These are called simple variables, and they are
  150. assigned with the `:=' operator.  Note that when a simple variable is
  151. assigned, any other references to variables will expand to their value as
  152. assigned above the line of the simple variable being assigned.  Here is an
  153. example:
  154.  
  155. simplevar := $(myvariable)
  156.  
  157. The only difference between an ordinary variable and a simple variable is
  158. that the value of the simple variable is expanded only once during its
  159. assignment, whereas the value of an ordinary variable needs to be expanded
  160. every time it is referenced.  Referencing a simple variable requires only a
  161. simple substitution, whereas referencing an ordinary variable requires a
  162. recursive macro expansion, which requires more work (memory, stack, and CPU
  163. instructions).
  164.  
  165. Variables referenced in the target and dependencies of a rule are expanded
  166. during the rule definition.  Variables referenced in each command line
  167. associated with a rule are expanded when the command line is executed.
  168.  
  169. Both `\$' and `$$' expand to the character `$', but the latter is
  170. recommended.
  171.  
  172.  
  173. AUTOMATIC VARIABLES
  174.  
  175. There are a set of variables that are automatically defined at runtime by
  176. the Make program.
  177.  
  178. $@ expands to: target filename
  179. $* expands to: target filename without its suffix
  180. $< expands to: the first dependent filename
  181. $^ expands to: all dependents of target newer than target (not-implemented)
  182. $% expands to: dependent member of the target archive (not-implemented)
  183. $? expands to: all dependents of the target archive (not-implemented)
  184.  
  185. The value of automatic variables depends on where they are referenced.  An
  186. automatic variable has a different value according to the objects of the
  187. rule to which it applies.  $@ does not expand in the target position.
  188. Automatic variables making reference to dependencies do not make sense when
  189. used in the place of a target name or dependency, so they will not be
  190. defined when referenced in those situations; those variables will expand to
  191. their proper values in command lines.
  192.  
  193.  
  194. COMPLEX VARIABLE NAMES and MACRO EXPANSIONS
  195.  
  196. Rarely is it necessary to apply what is discussed in this topic, but the
  197. information will be given for completeness.  Because of the recursive
  198. nature of the macro expansion algorithm, it is possible to construct
  199. variables that act like arrays (or other complex data types) through the
  200. use of variable names that themselves contain a nested macro expansion.
  201. Here is an example of an obscure sort of Makefile that uses this technique:
  202.  
  203. A1    = one.c
  204. A2    = two.c
  205.  
  206. target.o: ${A$(B)}
  207.     $(CC) -c $(CFLAGS) -o $@ $<
  208.  
  209. Depending on whether the value of the variable `B' is set to `1' or `2',
  210. the target file will depend on `one.c' or `two.c'.
  211.  
  212. Although there is no internal limit restricting the level to which macros
  213. can be nested (in the variable name and its value), it is recommended that
  214. nested be kept to a minimum to conserve on memory consumption and stack
  215. usage.  Each level of nesting requires at least an additional 2K of memory.
  216.  
  217. Please note that the maximum length of a variable name is 256 characters.
  218.  
  219.  
  220. FUNCTION CALLS
  221.  
  222. Function calls of the form $(function arguments) or ${function arguments}
  223. will be processed differently than a normal macro expansion.  A function
  224. call acts like a macro expansion in that it returns a string.  All spaces,
  225. except for the sequence of spaces before the first argument (after
  226. expansion), are significant.
  227.  
  228. Please note that the maximum length of the string within the parentheses is
  229. 1024 characters.
  230.  
  231.  
  232. STRING FUNCTIONS  (see section 9.2 of the GNU Make manual)
  233.  
  234. $(filter pattern,text)
  235.  
  236.     A pattern is a word that optionally contains a single wildcard
  237.     character `%'.  All words in `text' that do not match the
  238.     `pattern' are removed, so that this function call returns only
  239.     matching words.
  240.  
  241.  
  242. $(filter-out pattern,text)
  243.  
  244.     All words in `text' that match the `pattern' are removed, so
  245.     that this function call returns only non-matching words.  The
  246.     result is the complement of the result of $(filter).
  247.  
  248.  
  249. $(findstring find,in)
  250.  
  251.     if the `in' string contains the `find' string then the `find'
  252.     string is returned, otherwise the result is an empty string
  253.  
  254. $(getenv name)
  255.  
  256.     The result is the contents of the environment variable ENV:name.
  257.     Note that referencing an undefined macro automatically performs
  258.     the equivalent of $(getenv macro).  This function call is
  259.     offered to allow the Makefile to explicitly reference an
  260.     environment variable, instead of the internal Make variable.
  261.  
  262. $(patsubst pattern,replacement,text)
  263.  
  264.     The result is a list of words derived from `text'.    `text' is a
  265.     whitespace separated list of words.  Each word is compared with
  266.     `pattern'.  A `%' character in the pattern matches any number of
  267.     characters; only one `%' may appear in the pattern.  If the
  268.     pattern does not match the word then the word is appended unchanged
  269.     to the result, otherwise a substitution is performed on the    word,
  270.     the result of which is appended to the result.
  271.  
  272.     If a substitution is necessary, then the resulting word is formed
  273.     by any characters preceding the `%' of `replacement', plus every
  274.     character of the current word of `text' that was matched by the
  275.     `%' of `pattern', plus any characters following the `%' of
  276.     `replacement'.  In other words, if the `%' character occurs in
  277.     both `pattern' and `replacement' then the substring matched by
  278.     the `%' will be substituted for the `%' in the `replacement'
  279.     string, which will then be used as the next word of the result.
  280.     For example, $(patsubst pre%post,a%b,dogfood preAApost) will
  281.     result in the string `dogfood aAAb'.
  282.  
  283.  
  284. $(sort list)
  285.  
  286.     Not implemented yet
  287.  
  288. $(strip string)
  289.  
  290.     strips leading and trailing whitespace from string, and replaces
  291.     embedded sequences of spaces with a single space.
  292.  
  293. $(subst from,to,text)
  294.  
  295.     replaces all occurrences in `text' that match the string `from'
  296.     with the string `to'.
  297.  
  298.  
  299. FILENAME FUNCTIONS  (see section 9.3 of the GNU Make manual)
  300.  
  301. $(dir names)
  302.  
  303.     Extracts the directory part of each path name in `names', including
  304.     the trailing slash or colon.  No checking is done to determine whether
  305.     the result is actually a directory or not; this command acts only as
  306.     a string function, and knows nothing about the organization of the
  307.     filesystem.
  308.  
  309. $(notdir names)
  310.  
  311.     Extracts the file part of each path name in `names'.  The result is
  312.     the complement of $(dir names).
  313.  
  314. $(suffix names)
  315.  
  316.     Extracts only the suffix of each path name in `names'.  The
  317.     suffix is the rightmost part of the name starting at the last
  318.     `.' character.
  319.  
  320. $(basename names)
  321.  
  322.     Extracts all but the suffix of each path name in `names'.  The
  323.     result is the complement of $(suffix names).
  324.     
  325. $(addsuffix suffix,names)
  326.  
  327.     The result is the list of names with `suffix' appended to each
  328.     word of the list.
  329.  
  330. $(addprefix prefix,names)
  331.  
  332.     The result is the list of names with `suffix' prepended to each
  333.     word of the list.
  334.  
  335. $(join list1,list2)
  336.  
  337.     The result is the wordwise concatenation of `list1' with `list2'.
  338.  
  339. $(word n,text)
  340.  
  341.     Returns the nth word of `text'.  The first word of text is numbered
  342.     1, and the last word of text is numbered $(words text).
  343.  
  344. $(words text)
  345.  
  346.     Returns the number of words in `text'.
  347.  
  348. $(firstword names)
  349.  
  350.     Returns the first word of `names'.  The result is the same as
  351.     $(word 1,names)
  352.  
  353. $(wildcard pattern)
  354.  
  355.     The `pattern' argument is an Amiga OS wildcard pattern.  The
  356.     result is a list of files matching that pattern.
  357.  
  358.     NOTE:  Wildcards are only supported under Amiga OS 2.0
  359.  
  360.     An example of a generic makefile that can be used to compile a
  361.     program that depends only upon all of the .c files in the
  362.     current directory follows:
  363.  
  364.     SRCS := $(wildcard #?.c)
  365.     OBJS := $(subst .c,.o,$(SRCS))
  366.  
  367.     a.out:    $(OBJS)
  368.         $(CC) -o $@ $(CFLAGS) $(OBJS)
  369.  
  370.  
  371. SPECIAL FUNCTIONS
  372.  
  373. $(foreach var,list,text)    (see section 9.4 of the GNU Make manual)
  374.  
  375.     This function call is not implemented.  A workaround might be to
  376.     unroll the loop manually.
  377.  
  378. $(origin variable)    (see section 9.5 of the GNU Make manual)
  379.  
  380.     Not implemented.
  381.  
  382. $(shell command line)    (see section 9.6 of the GNU Make manual)
  383.  
  384.     This function call is not implemented.  A workaround might be to
  385.     redirect the `command line' standard output into an environment
  386.     variable and then capture the environment variable's value into
  387.     a macro for Make to use.
  388.  
  389.  
  390. PATTERN RULES
  391.  
  392. When no explicit rule is defined for a target, the Make program must use
  393. other means to determine how to make the target up to date.  Rules of
  394. inference are defined by pattern rules.  An example of a double pattern
  395. rule is:
  396.  
  397. %.o: %.c
  398.     $(CC) -c $(CFLAGS) -o $@ $<
  399.  
  400. The above suffix rule defines how to make any target with a filename ending
  401. in `.o' if there is a corresponding dependent filename that ends in `.c'.
  402. The commands associated with a pattern rule are executed if the dependent
  403. file is newer than the target file, which matches the pattern.  The `%'
  404. character matches any number of characters in the target name.  Only one
  405. such wildcard character may exist per name.
  406.  
  407. There may be only one dependent in a pattern rule (extra dependents given
  408. on the line are ignored).  The `%' character in the dependency pattern is
  409. replaced with the stem (the sequence of characters which were matched by
  410. the `%') from the target name.
  411.  
  412. A single pattern rule of the form:
  413.  
  414. %.Z:
  415.     compress $*
  416.  
  417. is the same as a double pattern rule, except that there is no dependency
  418. pattern.  As a result, the automatic variable `$<' is not defined in the
  419. scope of a single suffix rule.  Since there are no dependencies, any target
  420. matching a single suffix rule will always be remade; the commands will
  421. always be executed.
  422.  
  423. There may be more than one pattern rule applicable per target name.  The
  424. first matching pattern rule will have priority.  If several pattern rules
  425. are defined with the same target pattern, then the pattern rule that was
  426. defined earlier will have priority over all later definitions.  Thus,
  427. pattern rules with the same target but different dependencies can be
  428. defined in natural prioritized order; the first one defined will be the
  429. first one applied to inference rules.
  430.  
  431. However, if a new definition is given that exactly duplicates both the
  432. target pattern and the dependency pattern then the new definition will
  433. replace the old pattern rule.
  434.  
  435.  
  436. DIFFERENCES BETWEEN PATTERN RULES AND WILDCARDS
  437.  
  438. The pattern rule `a%b : c%d' is roughly equivalent to
  439.  
  440. $(wildcard a#?b) : $(patsubst a%b,c%d,$@)
  441.  
  442. except that the target pattern `a%b' matches even more leniently than the
  443. wildcard `a#?b'.  The target pattern would also match the target name
  444. `a/y/z/b', whereas a#?b would not.
  445.  
  446. Patterns match strings, while wildcards match the names of actual files in
  447. the filesystem.  Thus, pattern rules require fewer disk accesses than
  448. explicit target rules and wildcards.  Pattern rules are used to define
  449. implicit rules, while wildcards are used to define explicit target rules.
  450.  
  451. The author is not sure if this is different from GNU Make's interpretation
  452. of how pattern rules work.  It appears as though GNU Make will only allow a
  453. pattern rule to match the file part of a pathname (so `a%c' would match
  454. `foobar/abc').  This behaviour seems to be inconsistent with how the
  455. patsubst function call works.
  456.  
  457.  
  458. .SUFFIX RULES
  459.  
  460. To maintain compatibility with older versions of Make, suffix rules can be
  461. defined.  They are a poor man's style of pattern rules.  An example of a
  462. double suffix rule is:
  463.  
  464. .c.o:
  465.     $(CC) -c $(CFLAGS) -o $@ $<
  466. .SUFFIXES: .c .o
  467.  
  468. The above suffix rule defines how to make any target with a filename ending
  469. in `.o' if there is a corresponding dependent filename that ends in `.c'.
  470. The commands associated with a suffix rule are executed if the dependent
  471. file is newer than the target file.
  472.  
  473. A suffix rule has no dependencies listed to the right of the colon.  If
  474. such dependencies exist, then the rule definition is considered to be an
  475. ordinary target rule.
  476.  
  477. The .SUFFIXES directive is used to cause the Make program to find all
  478. ordinary rules, that can be interpreted as suffix rules matching the suffix
  479. arguments.  Each suffix rule is transformed into its equivalent pattern
  480. rule at this time.
  481.  
  482. PATTERN RULES versus SUFFIX RULES
  483.  
  484. Pattern rules should be used because they are far more flexible than suffix
  485. rules.  Suffix rules are internally represented by pattern rules anyway,
  486. but an extra `.SUFFIXES' directive must be given before a suffix rule is
  487. recognized.
  488.  
  489.  
  490. COMMAND LINES IN RULES
  491.  
  492. Command lines are executed in order of appearance if any dependency is
  493. newer than the target.  The commands executed for a rule should do
  494. something that causes the target's modification date to be updated.
  495.  
  496. The Make program knows nothing about what the command lines mean or do.
  497. The command lines are simply passed to the shell for execution.  If
  498. executing the command line results in an error, then the Make program will
  499. terminate.
  500.  
  501. Sometimes it is desirable to ignore the error returned by a command,
  502. because failure to execute the command does not affect the successful
  503. completion of the Makefile.  If this is true then the error returned by a
  504. command can be ignored by preceding the command with a `-' character.  For
  505. example:
  506.  
  507. clean:
  508.     -delete #?.o
  509.  
  510. Normally, each command is printed (echoed) before execution.  Echoing for
  511. each command can be disabled by preceding it with a `@' character.  This
  512. does not affect its execution.  The `@' character does not redirect the
  513. standard output of the program being executed.  Redirection must be stated
  514. explicitly.
  515.  
  516. SPECIAL COMMANDS
  517.  
  518. The `cd' command can be used to change the current directory of the Make
  519. program.  This command is special; it is handled by the Make program
  520. itself, instead of being executed by the shell.  After the current
  521. directory is changed, all subsequent commands which are executed from
  522. within Make will inherit the new current directory, until another `cd'
  523. command is issued.  If no argument is given to `cd' then the original
  524. current directory is restored.  The original current directory, where the
  525. Make program was executed, will be restored before the Make program exits.
  526.  
  527. Conditional commands are also handled internally by the Make program.
  528. Refer to the section on CONDITIONAL DIRECTIVES on the behaviour of
  529. conditional commands.
  530.  
  531.  
  532. DEFAULT TARGET RULE
  533.  
  534. Sometimes it might be desirable to define a rule that is only executed when
  535. all other rules have failed to make a target up to date.  As a last resort,
  536. one might wish to simply `touch' the target file, or perform no action at
  537. all, and allow the Make to continue.
  538.  
  539. .DEFAULT:
  540.     command lines
  541.  
  542. If the .DEFAULT target is given no commands (as is the default behaviour)
  543. then the Make program will terminate with an error whenever it encounters a
  544. target name that cannot be made.
  545.  
  546.  
  547. BUILTIN RULES
  548.  
  549. By default, the Make program knows several builtin pattern rules.  Here is
  550. a list of their definitions:
  551.  
  552. %.a: RCS/%.a,v
  553.     $(CO) -u $@
  554. %.a: %
  555.  
  556. %.c: RCS/%.c,v
  557.     $(CO) -u $@
  558. %.c: %
  559.  
  560. %.h: RCS/%.h,v
  561.     $(CO) -u $@
  562. %.h: %
  563.  
  564. %.i: RCS/%.i,v
  565.     $(CO) -u $@
  566. %.i: %
  567.  
  568. %.o: %.c
  569.     $(CC) -c $(CFLAGS) -o $@ $<
  570.  
  571. %.o: %.a
  572.     $(AS) -c $(AFLAGS) -o $@ $<
  573.  
  574. Notice that assembler and C language headers and source files have no
  575. dependencies and require no commands to be executed in order to make them
  576. up to date.  User defined rules should be added to the Makefile if that is
  577. not the case.
  578.  
  579.  
  580. USER DEFINED BUILTIN RULES
  581.  
  582. If the user needs to supplement the internal builtin rules with addition
  583. suffix rules and variable definitions, they can be declared in one of two
  584. files:  `S:builtins.make' or `builtins.make'.  If they exist, these two
  585. files are read (in the order listed above) before the Makefile by the Make
  586. program.  All rules and variables in these files may be referenced (or
  587. overridden) in the Makefile.
  588.  
  589.  
  590. CONDITIONAL DIRECTIVES
  591.  
  592. A conditional directive can be used to control which parts of a Makefile
  593. are executed, based upon the value assigned to certain variables.  The
  594. familiar
  595.  
  596. if condition
  597.     ...true...
  598. else
  599.     ...false...
  600. endif
  601.  
  602. syntax is used for this purpose, where `...true...' represents any number
  603. of lines which are executed if the condition is true, and `...false...'
  604. represents any number of lines which are executed if the condition is
  605. false.  Each of the three conditional directives must appear as the first
  606. word on a line.  The `else' directive is optional.  The condition may be
  607. one of the following:
  608.  
  609. eq(arg1,arg2)    true if arg1 is exactly equal to arg2
  610. neq(arg1,arg2)    true if arg1 is not equal to arg2
  611. def(variable)    true if variable is defined
  612. ndef(variable)    true if variable is undefined
  613. exists(pathname)    true if pathname exists in the filesystem
  614. nexists(pathname)    true if pathname does not exist in the filesystem
  615.  
  616.  
  617. Nested conditionals are acceptable.  There is no way to perform logical AND
  618. and logical OR operations within the condition expression, so nested
  619. conditionals will have to be used instead to do the same job.  Each `if'
  620. and `else' must have a matching `endif' directive associated with its
  621. conditional construct.
  622.  
  623. The use of conditional directives in a Makefile is vaguely analogous to the
  624. use of #if, #else, and #endif preprocessor directives in C source code to
  625. control conditional compilation.
  626.  
  627.  
  628. CONDITIONAL COMMANDS
  629.  
  630. The conditional commands can be used to control the behaviour of the
  631. command lines of rules.  The syntax is exactly the same as the syntax for
  632. conditional directives, except that conditional commands are indented with
  633. a tab; they appear in the body of a rule along with other commands.
  634. Nesting is supported.
  635.  
  636. Here is a example of where a conditional command might be useful for the
  637. checking out RCS files, when the RCS directory is not accessible by the
  638. Make program (when knowledge of RCS file organization is private to RCS
  639. itself):
  640.  
  641. %.c:
  642.     if nexists($@)
  643.         $(CO) -u $@
  644.     endif
  645.  
  646.  
  647. PRAGMA DIRECTIVE
  648.  
  649. Command line arguments for the Make program may be added to a line
  650. beginning in `pragma'.  For example,
  651.  
  652. pragma +m2048
  653.  
  654. will set the maximum line length to at least 2048 bytes, if that parameter
  655. has not already been set to a higher value.
  656.  
  657.  
  658. .INCLUDE DIRECTIVE
  659.  
  660. Other Makefiles can be included from a Makefile with the `include'
  661. directive (it must appear at the beginning of a line, like any other
  662. directive).  For example,
  663.  
  664. .INCLUDE submakefile
  665.  
  666. will read in all the rules and macros from a file called `submakefile' and
  667. then continue reading the current Makefile.  This can be done from the
  668. builtins Makefiles as well as any user Makefile.  Nesting of includes is
  669. allowed; the maximum nesting level is indefinite.
  670.  
  671.  
  672.