home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / programm / programi / ixemlib9.lha / man / dmake.p
Encoding:
Text File  |  1992-01-13  |  110.1 KB  |  2,817 lines

  1.  
  2.  
  3.  
  4.  
  5. DMAKE(p)               Unsupported Software               DMAKE(p)
  6.  
  7.  
  8.  
  9. NNAAMMEE
  10.      ddmmaakkee - maintain program groups, or interdependent files
  11.  
  12. SSYYNNOOPPSSIISS
  13.      ddmmaakkee [-AeEhiknpqersStTuvVx] [-P#] [macro[*][+][:]=_v_a_l_u_e]
  14.      [-f file] [target ...]
  15.  
  16. DDEESSCCRRIIPPTTIIOONN
  17.      ddmmaakkee executes commands found in an external file called a
  18.      _m_a_k_e_f_i_l_e to update one or more target names.  Each target
  19.      may depend on zero or more prerequisite targets.  If any of
  20.      the target's prerequisites is newer than the target or if
  21.      the target itself does not exist, then ddmmaakkee will attempt to
  22.      make the target.
  23.  
  24.      If no --ff command line option is present then ddmmaakkee searches
  25.      for an existing _m_a_k_e_f_i_l_e from the list of prerequisites
  26.      specified for the special target _._M_A_K_E_F_I_L_E_S (see the STARTUP
  27.      section for more details).  If "-" is the name of the file
  28.      specified to the --ff flag then ddmmaakkee uses standard input as
  29.      the source of the makefile text.
  30.  
  31.      Any macro definitions (arguments with embedded "=" signs)
  32.      that appear on the command line are processed first and
  33.      supercede definitions for macros of the same name found
  34.      within the makefile.  In general it is impossible for defin-
  35.      itions found inside the makefile to redefine a macro defined
  36.      on the command line, see the MACROS section for an excep-
  37.      tion.
  38.  
  39.      If no _t_a_r_g_e_t names are specified on the command line, then
  40.      ddmmaakkee uses the first non-special target found in the
  41.      makefile as the default target.  See the SSPPEECCIIAALL TTAARRGGEETTSS
  42.      section for the list of special targets and their function.
  43.      ddmmaakkee is a re-implementation of the UNIX Make utility with
  44.      significant enhancements.  Makefiles written for most previ-
  45.      ous versions of _m_a_k_e will be handled correctly by ddmmaakkee..
  46.      Known differences between ddmmaakkee and other versions of make
  47.      are discussed in the CCOOMMPPAATTIIBBIILLIITTYY section found at the end
  48.      of this document.
  49.  
  50. OOPPTTIIOONNSS
  51.      --AA   Enable AUGMAKE special inference rule transformations
  52.           (see the "PERCENT(%) RULES" section), these are set to
  53.           off by default.
  54.  
  55.      --ee   Read the environment and define all strings of the form
  56.           'EENNVV--VVAARR=_e_v_a_l_u_e' defined within as macros whose name is
  57.           EENNVV--VVAARR, and whose value is '_e_v_a_l_u_e'.  The environment
  58.           is processed prior to processing the user specified
  59.           makefile thereby allowing definitions in the makefile
  60.           to override definitions in the environment.
  61.  
  62.  
  63.  
  64. Version 3.50                    UW                              1
  65.  
  66.  
  67.  
  68.  
  69. DMAKE(p)               Unsupported Software               DMAKE(p)
  70.  
  71.  
  72.  
  73.      --EE   Same as -e, except that the environment is processed
  74.           after the user specified makefile has been processed
  75.           (thus definitions in the environment override defini-
  76.           tions in the makefile).  The -e and -E options are
  77.           mutually exclusive.  If both are given the latter one
  78.           takes effect.
  79.  
  80.      --ff ffiillee
  81.           Use ffiillee as the source for the makefile text.  Only one
  82.           --ff option is allowed.
  83.  
  84.      --hh   Print the command summary for ddmmaakkee.
  85.  
  86.      --ii   Tells ddmmaakkee to ignore errors, and continue making other
  87.           targets.  This is equivalent to the .IGNORE attribute
  88.           or macro.
  89.  
  90.      --kk   Causes ddmmaakkee to ignore errors caused by command execu-
  91.           tion and to make all targets not depending on targets
  92.           that could not be made. Ordinarily ddmmaakkee stops after a
  93.           command returns a non-zero status, specifying --kk causes
  94.           ddmmaakkee to ignore the error and continue to make as much
  95.           as possible.
  96.  
  97.      --nn   Causes ddmmaakkee to print out what it would have executed,
  98.           but does not actually execute the commands.  A special
  99.           check is made for the string "$(MAKE)" inside a recipe
  100.           line, if found, the line is expanded and invoked,
  101.           thereby enabling recursive makes to give a full
  102.           description of all that they will do.  The check for
  103.           "$(MAKE)" is disabled inside group recipes.
  104.  
  105.      --pp   Print out a version of the digested makefile in human
  106.           readable form.  (useful for debugging, but cannot be
  107.           re-read by ddmmaakkee)
  108.  
  109.      --PP##  On systems that support multi-processing cause ddmmaakkee to
  110.           use _# concurrent child processes to make targets.  See
  111.           the "MULTI PROCESSING" section for more information.
  112.  
  113.      --qq   Check and see if the target is up to date.  Exits with
  114.           code 0 if up to date, 1 otherwise.
  115.  
  116.      --rr   Tells ddmmaakkee not to read the initial startup makefile,
  117.           see STARTUP section for more details.
  118.  
  119.      --ss   Tells ddmmaakkee to do all its work silently and not echo
  120.           the commands it is executing to stdout (also suppresses
  121.           warnings).  This  is equivalent to the .SILENT attri-
  122.           bute or macro.
  123.  
  124.  
  125.  
  126.  
  127.  
  128. Version 3.50                    UW                              2
  129.  
  130.  
  131.  
  132.  
  133. DMAKE(p)               Unsupported Software               DMAKE(p)
  134.  
  135.  
  136.  
  137.      --SS   Force sequential execution of recipes on architectures
  138.           which support concurrent makes.  For backward compati-
  139.           bility with old makefiles that have nasty side-effect
  140.           prerequisite dependencies.
  141.  
  142.      --tt   Causes ddmmaakkee to touch the targets and bring them up to
  143.           date without executing any commands.
  144.  
  145.      --TT   Tells ddmmaakkee to not perform transitive closure on the
  146.           inference graph.
  147.  
  148.      --uu   Force an unconditional update.  (ie. do everything that
  149.           would be done if everything that a target depended on
  150.           was out of date)
  151.  
  152.      --vv   Verbose flag, when making targets print to stdout what
  153.           we are going to make and what we think it's timestamp
  154.           is.
  155.  
  156.      --VV   Print the version of ddmmaakkee, and values of builtin mac-
  157.           ros.
  158.  
  159.      --xx   Upon processing the user makefile export all non-
  160.           internally defined macros to the user's environment.
  161.           This option together with the -e option allows SYSV
  162.           AUGMAKE recursive makes to function as expected.
  163.  
  164. IINNDDEEXX
  165.      Here is a list of the sections that follow and a short
  166.      description of each.  Perhaps you won't have to read the
  167.      whole man page to find what you need.
  168.  
  169.      SSTTAARRTTUUPP            Describes ddmmaakkee initialization.
  170.  
  171.      SSYYNNTTAAXX             Describes the syntax of makefile expres-
  172.                         sions.
  173.  
  174.      AATTTTRRIIBBUUTTEESS         Describes the notion of attributes and
  175.                         how they are used when making targets.
  176.  
  177.      MMAACCRROOSS             Defining and expanding macros.
  178.  
  179.      RRUULLEESS AANNDD TTAARRGGEETTSS  How to define targets and their prere-
  180.                         quisites.
  181.  
  182.      RREECCIIPPEESS            How to tell ddmmaakkee how to make a target.
  183.  
  184.      TTEEXXTT DDIIVVEERRSSIIOONNSS    How to use text diversions in recipes and
  185.                         macro expansions.
  186.  
  187.      SSPPEECCIIAALL TTAARRGGEETTSS    Some targets are special.
  188.  
  189.  
  190.  
  191.  
  192. Version 3.50                    UW                              3
  193.  
  194.  
  195.  
  196.  
  197. DMAKE(p)               Unsupported Software               DMAKE(p)
  198.  
  199.  
  200.  
  201.      SSPPEECCIIAALL MMAACCRROOSS     Macros used by ddmmaakkee to alter the pro-
  202.                         cessing of the makefile, and those
  203.                         defined by ddmmaakkee for the user.
  204.  
  205.      CCOONNTTRROOLL MMAACCRROOSS     Itemized list of special control macros.
  206.  
  207.      RRUUNN--TTIIMMEE MMAACCRROOSS    Discussion of special run-time macros
  208.                         such as $@ and $<.
  209.  
  210.      FFUUNNCCTTIIOONN MMAACCRROOSS    GNU style function macros, only $(mktmp
  211.                         ...) for now.
  212.  
  213.      DDYYNNAAMMIICC PPRREERREEQQUUIISSIITTEESS
  214.                         Processing of prerequisites which contain
  215.                         macro expansions in their name.
  216.  
  217.      BBIINNDDIINNGG TTAARRGGEETTSS    The rules that ddmmaakkee uses to bind a tar-
  218.                         get to an existing file in the file sys-
  219.                         tem.
  220.  
  221.      PPEERRCCEENNTT((%%)) RRUULLEESS   Specification of recipes to be used by
  222.                         the inference algorithm.
  223.  
  224.      MMAAKKIINNGG IINNFFEERREENNCCEESS  The rules that ddmmaakkee uses when inferring
  225.                         how to make a target which has no expli-
  226.                         cit recipe.  This and the previous sec-
  227.                         tion are really a single section in the
  228.                         text.
  229.  
  230.      MMAAKKIINNGG TTAARRGGEETTSS     How ddmmaakkee makes targets other than
  231.                         libraries.
  232.  
  233.      MMAAKKIINNGG LLIIBBRRAARRIIEESS   How ddmmaakkee makes libraries.
  234.  
  235.      MMUULLTTII PPRROOCCEESSSSIINNGG   Discussion of ddmmaakkee''ss parallel make
  236.                         facilities for architectures that support
  237.                         them.
  238.  
  239.      CCOONNDDIITTIIOONNAALLSS       Conditional expressions which control the
  240.                         processing of the makefile.
  241.  
  242.      EEXXAAMMPPLLEESS           Some hopefully useful examples.
  243.  
  244.      CCOOMMPPAATTIIBBIILLIITTYY      How ddmmaakkee compares with previous versions
  245.                         of make.
  246.  
  247.      LLIIMMIITTSS             Limitations of ddmmaakkee.
  248.  
  249.      PPOORRTTAABBIILLIITTYY        Comments on writing portable makefiles.
  250.  
  251.      FFIILLEESS              Files used by ddmmaakkee.
  252.  
  253.  
  254.  
  255.  
  256. Version 3.50                    UW                              4
  257.  
  258.  
  259.  
  260.  
  261. DMAKE(p)               Unsupported Software               DMAKE(p)
  262.  
  263.  
  264.  
  265.      SSEEEE AALLSSOO           Other related programs, and man pages.
  266.  
  267.      AAUUTTHHOORR             The guy responsible for this thing.
  268.  
  269.      BBUUGGSS               Hope not.
  270.  
  271. SSTTAARRTTUUPP
  272.      When ddmmaakkee begins execution it first processes the command
  273.      line and then processes an initial startup-makefile.  This
  274.      is followed by an attempt to locate and process a user sup-
  275.      plied makefile.  The startup file defines the default values
  276.      of all required control macros and the set of default rules
  277.      for making inferences.  When searching for the startup
  278.      makefile, ddmmaakkee searches the following locations, in order,
  279.      until a startup file is located:
  280.  
  281.           1.   The location given as the value of the macro MAK-
  282.                ESTARTUP defined on the command line.
  283.  
  284.           2.   The location given as the value of the environment
  285.                variable MAKESTARTUP defined in the current
  286.                environment.
  287.  
  288.           3.   The location given as the value of the macro MAK-
  289.                ESTARTUP defined internally within ddmmaakkee.
  290.  
  291.      The above search is disabled by specifying the -r option on
  292.      the command line.  An error is issued if a startup makefile
  293.      cannot be found and the -r option was not specified.  A user
  294.      may substitute a custom startup file by defining the MAKES-
  295.      TARTUP environment variable or by redefining the MAKESTARTUP
  296.      macro on the command line.  To determine where ddmmaakkee looks
  297.      for the default startup file, check your environment or
  298.      issue the command _"_d_m_a_k_e _-_V_".
  299.  
  300.      A similar search is performed to locate a default user
  301.      makefile when no --ff command line option is specified.  The
  302.      special target .MAKEFILES is defined by default.  This
  303.      target's prerequisite list specifies the names of files and
  304.      the order that ddmmaakkee will use to search for them when
  305.      attempting to locate the default makefile.  A typical defin-
  306.      ition for this target is:
  307.  
  308.           .MAKEFILES : makefile.mk Makefile makefile
  309.  
  310.      ddmmaakkee will first look for makefile.mk and then the others.
  311.      If a prerequisite cannot be found ddmmaakkee will try to make it
  312.      before going on to the next prerequisite.  For example,
  313.      makefile.mk can be checked out of an RCS file if the proper
  314.      rules for doing so are defined in the startup file.
  315.  
  316.  
  317.  
  318.  
  319.  
  320. Version 3.50                    UW                              5
  321.  
  322.  
  323.  
  324.  
  325. DMAKE(p)               Unsupported Software               DMAKE(p)
  326.  
  327.  
  328.  
  329. SSYYNNTTAAXX
  330.      This section is a summary of the syntax of makefile state-
  331.      ments.  The description is given in a style similar to BNF,
  332.      where { } enclose items that may appear zero or more times,
  333.      and [ ] enclose items that are optional.  Alternative pro-
  334.      ductions for a left hand side are indicated by '->', and
  335.      newlines are significant.  All symbols in bboolldd type are text
  336.      or names representing text supplied by the user.
  337.  
  338.  
  339.  
  340.           Makefile -> { Statement }
  341.  
  342.           Statement -> Macro-Definition
  343.                     -> Conditional
  344.                     -> Rule-Definition
  345.                     -> Attribute-Definition
  346.  
  347.           Macro-Definition -> MMAACCRROO == LLIINNEE
  348.                            -> MMAACCRROO **== LLIINNEE
  349.                            -> MMAACCRROO ::== LLIINNEE
  350.                            -> MMAACCRROO **::== LLIINNEE
  351.                            -> MMAACCRROO ++== LLIINNEE
  352.                            -> MMAACCRROO ++::== LLIINNEE
  353.  
  354.           Conditional ->  ..IIFF expression
  355.                              Makefile
  356.                           [ ..EELLSSEE
  357.                              Makefile ]
  358.                           ..EENNDD
  359.  
  360.           expression -> LLIINNEE
  361.                      -> SSTTRRIINNGG ==== LLIINNEE
  362.                      -> SSTTRRIINNGG !!== LLIINNEE
  363.  
  364.  
  365.           Rule-Definition ->  target-definition
  366.                                  [ recipe ]
  367.  
  368.           target-definition -> targets [attrs] op { PPRREERREEQQUUIISSIITTEE } [;; rcp-line]
  369.  
  370.           targets -> target { targets }
  371.                   -> ""target"" { targets }
  372.  
  373.           target -> special-target
  374.                  -> TTAARRGGEETT
  375.  
  376.           attrs -> attribute { attrs }
  377.                 -> ""attribute"" { attrs }
  378.  
  379.           op -> :: { modifier }
  380.  
  381.  
  382.  
  383.  
  384. Version 3.50                    UW                              6
  385.  
  386.  
  387.  
  388.  
  389. DMAKE(p)               Unsupported Software               DMAKE(p)
  390.  
  391.  
  392.  
  393.           modifier -> ::
  394.                    -> ^^
  395.                    -> !!
  396.                    -> --
  397.  
  398.           recipe -> { TTAABB rcp-line }
  399.                  -> [@@][%%][--] [[
  400.                        { LLIINNEE }
  401.                     ]]
  402.  
  403.           rcp-line -> [@@][%%][--][++] LLIINNEE
  404.  
  405.  
  406.           Attribute-Definition -> attrs :: targets
  407.  
  408.  
  409.           attribute -> ..EEPPIILLOOGG
  410.                     -> ..IIGGNNOORREE
  411.                     -> ..LLIIBBRRAARRYY
  412.                     -> ..MMKKSSAARRGGSS
  413.                     -> ..NNOOIINNFFEERR
  414.                     -> ..PPRREECCIIOOUUSS
  415.                     -> ..PPRROOLLOOGG
  416.                     -> ..SSEETTDDIIRR==_p_a_t_h
  417.                     -> ..SSIILLEENNTT
  418.                     -> ..SSEEQQUUEENNTTIIAALL
  419.                     -> ..SSWWAAPP
  420.                     -> ..UUSSEESSHHEELLLL
  421.                     -> ..SSYYMMBBOOLL
  422.                     -> ..UUPPDDAATTEEAALLLL
  423.  
  424.           special-target -> ..EERRRROORR
  425.                          -> ..EEXXPPOORRTT
  426.                          -> ..GGRROOUUPPEEPPIILLOOGG
  427.                          -> ..GGRROOUUPPPPRROOLLOOGG
  428.                          -> ..IIMMPPOORRTT
  429.                          -> ..IINNCCLLUUDDEE
  430.                          -> ..IINNCCLLUUDDEEDDIIRRSS
  431.                          -> ..MMAAKKEEFFIILLEESS
  432.                          -> ..RREEMMOOVVEE
  433.                          -> ..SSOOUURRCCEE
  434.                          -> ..SSOOUURRCCEE.._s_u_f_f_i_x
  435.                          -> ._s_u_f_f_i_x_1._s_u_f_f_i_x_2
  436.  
  437.  
  438.      Where, TTAABB represents a <tab> character, SSTTRRIINNGG represents
  439.      an arbitrary sequence of characters, and LLIINNEE represents a
  440.      possibly empty sequence of characters terminated by a non-
  441.      escaped (not immediately preceded by a backslash '\') new-
  442.      line character.  MMAACCRROO, PPRREERREEQQUUIISSIITTEE, and TTAARRGGEETT each
  443.      represent a string of characters not including space or tab
  444.      which respectively form the name of a macro, prerequisite or
  445.  
  446.  
  447.  
  448. Version 3.50                    UW                              7
  449.  
  450.  
  451.  
  452.  
  453. DMAKE(p)               Unsupported Software               DMAKE(p)
  454.  
  455.  
  456.  
  457.      target.  The name may itself be a macro expansion expres-
  458.      sion.  A LLIINNEE can be continued over several physical lines
  459.      by terminating it with a single backslash character.  Com-
  460.      ments are initiated by the pound '##' character and extend to
  461.      the end of line.  All comment text is discarded, a '#' may
  462.      be placed into the makefile text by escaping it with '\'
  463.      (ie. \# translates to # when it is parsed).  A group of con-
  464.      tinued lines may be commented out by placing a single # at
  465.      the start of the first line of the group.  A continued line
  466.      may not span more than one makefile.
  467.  
  468.      wwhhiittee ssppaaccee is defined to be any combination of <space>,
  469.      <tab>, and the sequence \<nl> when \<nl> is used to ter-
  470.      minate a LINE.  When processing mmaaccrroo definition lines, any
  471.      amount of white space is allowed on either side of the macro
  472.      operator (=, *=, :=, *:=, += or +:=), and white space is
  473.      stripped from both before and after the macro value string.
  474.      The sequence \<nl> is treated as white space during recipe
  475.      expansion and is deleted from the final recipe string.  You
  476.      must escape the \<nl> with a \ in order to get a \ at the
  477.      end of a recipe line.  The \<nl> sequence is deleted from
  478.      macro values when they are expanded.
  479.  
  480.      When processing ttaarrggeett definition lines, the recipe for a
  481.      target must, in general, follow the first definition of the
  482.      target (See the RULES AND TARGETS section for an exception),
  483.      and the recipe may not span across multiple makefiles.  Any
  484.      targets and prerequisites found on a target definition line
  485.      are taken to be white space separated tokens.  The rule
  486.      operator (_o_p in SYNTAX section) is also considered to be a
  487.      token but does not require white space to precede or follow
  488.      it.  Since the rule operator begins with a `:', traditional
  489.      versions of make do not allow the `:' character to form a
  490.      valid target name.  ddmmaakkee allows `:' to be present in
  491.      target/prerequisite names as long as the entire
  492.      target/prerequisite name is quoted.  For example:
  493.  
  494.           a:fred : test
  495.  
  496.      would be parsed as TARGET = a, PREREQUISITES are fred, :,
  497.      and test, which is not what was intended.  To fix this you
  498.      must write:
  499.  
  500.           "a:fred" : test
  501.  
  502.      Which will be parsed as expected.  See the EXAMPLES section
  503.      for how to apply this to a list of targets.
  504.  
  505. AATTTTRRIIBBUUTTEESS
  506.      ddmmaakkee defines several target attributes.  Attributes may be
  507.      assigned to a single target, a group of targets, or to all
  508.      targets in the makefile.  Attributes are used to modify
  509.  
  510.  
  511.  
  512. Version 3.50                    UW                              8
  513.  
  514.  
  515.  
  516.  
  517. DMAKE(p)               Unsupported Software               DMAKE(p)
  518.  
  519.  
  520.  
  521.      ddmmaakkee actions during target update.  The recognized attri-
  522.      butes are:
  523.  
  524.  
  525.      ..EEPPIILLOOGG     Insert shell epilog code when executing a group
  526.                  recipe associated with any target having this
  527.                  attribute set.
  528.  
  529.      ..IIGGNNOORREE     Ignore an error when trying to make any target
  530.                  with this attribute set.
  531.  
  532.      ..LLIIBBRRAARRYY    Target is a library.
  533.  
  534.      ..MMKKSSAARRGGSS    If in an MSDOS environment then use MKS extended
  535.                  argument passing conventions to pass arguments
  536.                  to commands.  Non-MSDOS environments ignore this
  537.                  attribute.
  538.  
  539.      ..NNOOIINNFFEERR    Any target with this attribute set will not be
  540.                  subjected to transitive closure if it is
  541.                  inferred as a prerequisite of a target whose
  542.                  recipe and prerequisites are being inferred.
  543.                  (i.e. the inference algorithm will not use any
  544.                  prerequisite with this attribute set, as a tar-
  545.                  get)
  546.  
  547.      ..PPRREECCIIOOUUSS   Do not remove this target under any cir-
  548.                  cumstances.  Set by default for any targets
  549.                  whose corresponding files exist in the file sys-
  550.                  tem prior to the execution of ddmmaakkee.
  551.  
  552.      ..PPRROOLLOOGG     Insert shell prolog code when executing a group
  553.                  recipe associated with any target having this
  554.                  attribute set.
  555.  
  556.      ..SSEEQQUUEENNTTIIAALL Force a sequential make of the associated
  557.                  target's prerequisites.
  558.  
  559.      ..SSEETTDDIIRR     Change current working directory to specified
  560.                  directory when making the associated target.
  561.                  You must specify the directory at the time the
  562.                  attribute is specified.  To do this simply give
  563.                  _._S_E_T_D_I_R_=_p_a_t_h as the attribute.  _p_a_t_h is expanded
  564.                  and the result is used as the value of the
  565.                  directory to change to.  If path is surrounded
  566.                  by single quotes then path is not expanded, and
  567.                  is used literally as the directory name.  If the
  568.                  _p_a_t_h contains any `:' characters then the entire
  569.                  attribute string must be quoted using ".  If a
  570.                  target having this attribute set also has the
  571.                  .IGNORE attribute set then if the change to the
  572.                  specified directory fails it will be ignored,
  573.  
  574.  
  575.  
  576. Version 3.50                    UW                              9
  577.  
  578.  
  579.  
  580.  
  581. DMAKE(p)               Unsupported Software               DMAKE(p)
  582.  
  583.  
  584.  
  585.                  and no error message will be issued.
  586.  
  587.      ..SSIILLEENNTT     Do not echo the recipe lines when making any
  588.                  target with this attribute set, and do not issue
  589.                  any warnings.
  590.  
  591.      ..SSWWAAPP       Under MSDOS when making a target with this
  592.                  attribute set swap the ddmmaakkee executable to disk
  593.                  prior to executing the recipe line.
  594.  
  595.      ..SSYYMMBBOOLL     Target is a library member and is an entry point
  596.                  into a module in the library.  This attribute is
  597.                  used only when searching a library for a target.
  598.                  Targets of the form lib((entry)) have this
  599.                  attribute set automatically.
  600.  
  601.      ..UUSSEESSHHEELLLL   Force each recipe line of a target to be exe-
  602.                  cuted using a shell.  Specifying this attribute
  603.                  is equivalent to specifying the '+' character at
  604.                  the start of each line of a non-group recipe.
  605.  
  606.      ..UUPPDDAATTEEAALLLL  Indicates that all the targets listed in this
  607.                  rule are updated by the execution of the accom-
  608.                  panying recipe.  A common example is the produc-
  609.                  tion of the _y_._t_a_b_._c and _y_._t_a_b_._h files by yyaacccc
  610.                  when it is run on a grammar.  Specifying
  611.                  .UPDATEALL in such a rule prevents the running
  612.                  of yacc twice, once for the y.tab.c file and
  613.                  once for the y.tab.h file.
  614.  
  615.  
  616.      All attributes are user setable and except for .UPDATEALL
  617.      and .MKSARGS may be used in one of two forms.  The .MKSARGS
  618.      attribute is restricted to use as a global attribute, and
  619.      the use of the .UPDATEALL attribute is restricted to rules
  620.      of the second form only.
  621.  
  622.           ATTRIBUTE_LIST : _t_a_r_g_e_t_s
  623.  
  624.      assigns the attributes specified by ATTRIBUTE_LIST to each
  625.      target in _t_a_r_g_e_t_s or
  626.  
  627.           _t_a_r_g_e_t_s ATTRIBUTE_LIST : ...
  628.  
  629.      assigns the attributes specified by ATTRIBUTE_LIST to each
  630.      target in _t_a_r_g_e_t_s_. In the first form if _t_a_r_g_e_t_s is empty
  631.      (ie. a NULL list), then the list of attributes will apply to
  632.      all targets in the makefile (this is equivalent to the com-
  633.      mon Make construct of _"_._I_G_N_O_R_E _:_" but has been modified to
  634.      the notion of an attribute instead of a special target).
  635.      Not all of the attributes have global meaning.  In particu-
  636.      lar, .LIBRARY, .SYMBOL, and .UPDATEALL have no assigned
  637.  
  638.  
  639.  
  640. Version 3.50                    UW                             10
  641.  
  642.  
  643.  
  644.  
  645. DMAKE(p)               Unsupported Software               DMAKE(p)
  646.  
  647.  
  648.  
  649.      global meaning.
  650.  
  651.      Any attribute may be used with any target, even with the
  652.      special targets.  Some combinations are useless (e.g.
  653.      .INCLUDE .PRECIOUS: ... ), while others are useful (e.g.
  654.      .INCLUDE .IGNORE : "file.mk" will not complain if file.mk
  655.      cannot be found using the include file search rules, see the
  656.      section on SPECIAL TARGETS for a description of .INCLUDE).
  657.      If a specified attribute will not be used with the special
  658.      target a warning is issued and the attribute is ignored.
  659.  
  660. MMAACCRROOSS
  661.      ddmmaakkee supports six types of macro assignment.
  662.  
  663.  
  664.      MMAACCRROO == LLIINNEE    This is the most common and familiar form of
  665.                      macro assignment.  It assigns LINE literally
  666.                      as the value of MACRO.  Future expansions of
  667.                      MACRO recursively expand it's value.
  668.  
  669.      MMAACCRROO **== LLIINNEE   This form behaves exactly as the simple '='
  670.                      form with the exception that if MACRO
  671.                      already has a value then the assignment is
  672.                      not performed.
  673.  
  674.      MMAACCRROO ::== LLIINNEE   This form differs from the simple '=' form
  675.                      in that it expands LINE prior to assigning
  676.                      it as the value of MACRO.  Future expansions
  677.                      of MACRO do not recursively expand it's
  678.                      value.
  679.  
  680.      MMAACCRROO **::== LLIINNEE  This form behaves exactly as the ':=' form
  681.                      with the exception that if MACRO already has
  682.                      a value then the assignment and expansion
  683.                      are not performed.
  684.  
  685.      MMAACCRROO ++== LLIINNEE   This form of macro assignment allows macro
  686.                      values to grow.  It takes the literal value
  687.                      of LINE and appends it to the previous value
  688.                      of MACRO separating the two by a single
  689.                      space.  Future expansions of MACRO recur-
  690.                      sively expand it's value.
  691.  
  692.      MMAACCRROO ++::== LLIINNEE  This form is similar to the '+=' form except
  693.                      that the value of LINE is expanded prior to
  694.                      being added to the value of MACRO.
  695.  
  696.      Macro expressions specified on the command line allow the
  697.      macro value to be redefined within the makefile only if the
  698.      macro is defined using the '+=' and '+:=' operators.  Other
  699.      operators will define a macro that cannot be further modi-
  700.      fied.
  701.  
  702.  
  703.  
  704. Version 3.50                    UW                             11
  705.  
  706.  
  707.  
  708.  
  709. DMAKE(p)               Unsupported Software               DMAKE(p)
  710.  
  711.  
  712.  
  713.      When ddmmaakkee defines a non-environment macro it strips leading
  714.      and trailing white space from the macro value.  Macros
  715.      imported from the environment via either the .IMPORT special
  716.      target (see the SPECIAL TARGETS section), or the --ee, or --EE
  717.      flags are an exception to this rule.  Their values are
  718.      always taken literally and white space is never stripped.
  719.      In addition, macros defined using the .IMPORT special target
  720.      do not have their values expanded when they are used within
  721.      a makefile.  In contrast, environment macros that are
  722.      imported due to the specification of the --ee or --EE flags are
  723.      subject to expansion when used.
  724.  
  725.      To specify a macro expansion enclose the name in () or {}
  726.      and precede it with a dollar sign $.  Thus $(TEST)
  727.      represents an expansion of the macro variable named TEST.
  728.      If TEST is defined then $(TEST) is replaced by its expanded
  729.      value.  If TEST is not defined then $(TEST) expands to the
  730.      NULL string (this is equivalent to defining a macro as
  731.      'TEST=' ).  A short form may be used for single character
  732.      named macros.  In this case the parentheses are optional,
  733.      and $(I) is equivalent to $I.  Macro expansion is recursive,
  734.      hence, if the value string contains an expression represent-
  735.      ing a macro expansion, the expansion is performed.  Circular
  736.      macro expansions are detected and cause an error to be
  737.      issued.
  738.  
  739.      When defining a macro the given macro name is first expanded
  740.      before being used to define the macro.  Thus it is possible
  741.      to define macros whose names depend on values of other mac-
  742.      ros.  For example, suppose
  743.  
  744.           CWD = $(PWD:b)
  745.  
  746.      is defined, then the value of $(CWD) is the name of the
  747.      current directory.  This can be used to define macros
  748.      specific to this directory, for example:
  749.  
  750.           _$(CWD).prt = list of files to print...
  751.  
  752.      The actual name of the defined macro is a function of the
  753.      current directory.  A construct such as this is useful when
  754.      processing a hierarchy of directories using .SETDIR attri-
  755.      buted targets and a collection of small distributed makefile
  756.      stubs.
  757.  
  758.      Macro variables may be defined within the makefile, on the
  759.      command line, or imported from the environment.
  760.  
  761.      ddmmaakkee supports several non-standard macro expansions: The
  762.      first is of the form:
  763.  
  764.  
  765.  
  766.  
  767.  
  768. Version 3.50                    UW                             12
  769.  
  770.  
  771.  
  772.  
  773. DMAKE(p)               Unsupported Software               DMAKE(p)
  774.  
  775.  
  776.  
  777.           _$_(_m_a_c_r_o___n_a_m_e_:_m_o_d_i_f_i_e_r___l_i_s_t_:_m_o_d_i_f_i_e_r___l_i_s_t_:_._._._)
  778.  
  779.      where _m_o_d_i_f_i_e_r___l_i_s_t is chosen from the set { D or d, F or f,
  780.      B or b, S or s, T or t } and
  781.  
  782.           d - directory portion of all path names
  783.           f - file (including suffix) portion of path names
  784.           b - file (not including suffix) portion of path names
  785.           s - simple pattern substitution
  786.           t - tokenization.
  787.  
  788.      Thus if we have the example:
  789.  
  790.           test = d1/d2/d3/a.out f.out d1/k.out
  791.  
  792.      The following macro expansions produce the values on the
  793.      right of '-->' after expansion.
  794.  
  795.           $(test:d)            --> d1/d2/d3/ d1/
  796.           $(test:b)            --> a f k
  797.           $(test:f)            --> a.out f.out k.out
  798.           ${test:db}           --> d1/d2/d3/a f d1/k
  799.           ${test:s/out/in/:f}  --> a.in f.in k.in
  800.           $(test:f:t"+")       --> a.out+f.out+k.out
  801.  
  802.      If a token ends in a string composed from the value of the
  803.      macro DIRBRKSTR (ie. ends in a directory separator string,
  804.      e.g. '/' in UNIX) and you use the ::dd modifier then the
  805.      expansion returns the directory name less the final direc-
  806.      tory separator string.  Thus successive pairs of :d modif-
  807.      iers each remove a level of directory in the token string.
  808.  
  809.      The tokenization modifier takes all white space separated
  810.      tokens from the macro value and separates them by the quoted
  811.      separator string.  The separator string may contain the fol-
  812.      lowing escape codes \a => <bel>, \b => <backspace>, \f =>
  813.      <formfeed>, \n => <nl>, \r => <cr>, \t => <tab>, \v =>
  814.      <vertical tab>, \" => ", and \xxx => <xxx> where xxx is the
  815.      octal representation of a character.  Thus the expansion:
  816.  
  817.           $(test:f:t"+\n")
  818.      produces:
  819.           a.out+
  820.           f.out+
  821.           k.out
  822.  
  823.      The second non-standard form of macro expansion allows for
  824.      recursive macros.  It is possible to specify a $(_m_a_c_r_o___n_a_m_e)
  825.      or ${_m_a_c_r_o___n_a_m_e} expansion where _m_a_c_r_o___n_a_m_e contains more $(
  826.      ... ) or ${ ... } macro expansions itself.
  827.  
  828.  
  829.  
  830.  
  831.  
  832. Version 3.50                    UW                             13
  833.  
  834.  
  835.  
  836.  
  837. DMAKE(p)               Unsupported Software               DMAKE(p)
  838.  
  839.  
  840.  
  841.      For example $(CC$(_HOST)$(_COMPILER)) will first expand
  842.      CC$(_HOST)$(_COMPILER) to get a result and use that result
  843.      as the name of the macro to expand.  This is useful for
  844.      writing a makefile for more than one target environment.  As
  845.      an example consider the following hypothetical case. Suppose
  846.      that _HOST and _COMPILER are imported from the environment
  847.      and are set to represent the host machine type and the host
  848.      compiler respectively.
  849.  
  850.           CFLAGS_VAX_CC = -c -O    # _HOST == "_VAX", _COMPILER == "_CC"
  851.           CFLAGS_PC_MSC = -c -ML   # _HOST == "_PC",  _COMPILER == "_MSC"
  852.  
  853.           # redefine CFLAGS macro as:
  854.  
  855.           CFLAGS := $(CFLAGS$(_HOST)$(_COMPILER))
  856.  
  857.      This causes CFLAGS to take on a value that corresponds to
  858.      the environment in which the make is being invoked.
  859.  
  860.      The final non-standard macro expansion is of the form:
  861.  
  862.           string1{token_list}string2
  863.  
  864.      where string1, string2 and token_list are expanded.  After
  865.      expansion, string1 is prepended to each token found in
  866.      token_list and string2 is appended to each resulting token
  867.      from the previous prepend.  string1 and string2 are not del-
  868.      imited by white space whereas the tokens in token_list are.
  869.      A null token in the token list is specified using "".  Thus
  870.      using another example we have:
  871.  
  872.           test/{f1 f2}.o            --> test/f1.o test/f2.o
  873.           test/ {f1 f2}.o           --> test/ f1.o f2.o
  874.           test/{f1 f2} .o           --> test/f1 test/f2 .o
  875.           test/{ f1  "f2" "" }.o    --> test/f1.o test/f2.o
  876.                                     test/.o
  877.  
  878.           and
  879.  
  880.           test/{ d1 d2 }/{ f1 f2 }.o --> test/d1/f1.o
  881.                                          test/d1/f2.o
  882.                                          test/d2/f1.o
  883.                                          test/d2/f2.o
  884.  
  885.      See the SPECIAL MACROS section for a description of the spe-
  886.      cial macros that ddmmaakkee defines and understands.
  887.  
  888. RRUULLEESS AANNDD TTAARRGGEETTSS
  889.      A makefile contains a series of entries that specify depen-
  890.      dencies.  Such entries are called _t_a_r_g_e_t_/_p_r_e_r_e_q_u_i_s_i_t_e or
  891.      _r_u_l_e definitions.  Each rule definition is optionally fol-
  892.      lowed by a set of lines that provide a recipe for updating
  893.  
  894.  
  895.  
  896. Version 3.50                    UW                             14
  897.  
  898.  
  899.  
  900.  
  901. DMAKE(p)               Unsupported Software               DMAKE(p)
  902.  
  903.  
  904.  
  905.      any targets defined by the rule.  Whenever ddmmaakkee attempts to
  906.      bring a target up to date and an explicit recipe is provided
  907.      with a rule defining the target, that recipe is used to
  908.      update the target.  A rule definition begins with a line
  909.      having the following syntax:
  910.  
  911.           _<_t_a_r_g_e_t_s_> [_<_a_t_t_r_i_b_u_t_e_s_>] _<_r_u_l_e_o_p_> [_<_p_r_e_r_e_q_u_i_s_i_t_e_s_>] [;_<_r_e_c_i_p_e_>]
  912.  
  913.      _t_a_r_g_e_t_s is a non-empty list of targets.  If the target is a
  914.      special target (see SPECIAL TARGETS section below) then it
  915.      must appear alone on the rule line.  For example:
  916.  
  917.           .IMPORT .ERROR : ...
  918.  
  919.      is not allowed since both .IMPORT and .ERROR are special
  920.      targets.  Special targets are not used in the construction
  921.      of the dependency graph and will not be made.
  922.  
  923.      _a_t_t_r_i_b_u_t_e_s is a possibly empty list of attributes.  Any
  924.      attribute defined in the ATTRIBUTES section above may be
  925.      specified.  All attributes will be applied to the list of
  926.      named targets in the rule definition.  No other targets will
  927.      be affected.
  928.  
  929.  
  930.      NOTE:   As stated earlier, if both the target list and
  931.              prerequisite list are empty but the attributes list
  932.              is not, then the specified attributes affect all
  933.              targets in the makefile.
  934.  
  935.  
  936.      _r_u_l_e_o_p is a separator which is used to identify the targets
  937.      from the prerequisites.  Optionally it also provides a
  938.      facility for modifying the way in which ddmmaakkee handles the
  939.      making of the associated targets.  In its simplest form the
  940.      operator is a single ':', and need not be separated by white
  941.      space from its neighbouring tokens.  It may additionally be
  942.      followed by any of the modifiers { !, ^, -, : }, where:
  943.  
  944.  
  945.      !!    says execute the recipe for the associated targets once
  946.           for each out of date prerequisite.  Ordinarily the
  947.           recipe is executed once for all out of date prere-
  948.           quisites at the same time.
  949.  
  950.      ^^    says to insert the specified prerequisites, if any,
  951.           before any other prerequisites already associated with
  952.           the specified targets.  In general, it is not useful to
  953.           specify ^ with an empty list of prerequisites.
  954.  
  955.      --    says to clear the previous list of prerequisites before
  956.           adding the new prerequisites.  Thus,
  957.  
  958.  
  959.  
  960. Version 3.50                    UW                             15
  961.  
  962.  
  963.  
  964.  
  965. DMAKE(p)               Unsupported Software               DMAKE(p)
  966.  
  967.  
  968.  
  969.                .SUFFIXES :
  970.                .SUFFIXES : .a .b
  971.  
  972.           can be replaced by
  973.  
  974.                .SUFFIXES :- .a .b
  975.  
  976.           however the old form still works as expected.  NOTE:
  977.           .SUFFIXES is ignored by ddmmaakkee it is used here simply as
  978.           an example.
  979.  
  980.      ::    When the rule operator is not modified by a second ':'
  981.           only one set of rules may be specified for making a
  982.           target.  Multiple definitions may be used to add to the
  983.           list of prerequisites that a target depends on.  How-
  984.           ever, if a target is multiply defined only one defini-
  985.           tion may specify a recipe for making the target.
  986.  
  987.           When a target's rule operator is modified by a second
  988.           ':' (:: for example) then this definition may not be
  989.           the only definition with a recipe for the target.
  990.           There may be other :: target definition lines that
  991.           specify a different set of prerequisites with a dif-
  992.           ferent recipe for updating the target. Any such target
  993.           is made if any of the definitions find it to be out of
  994.           date with respect to the related prerequisites and the
  995.           corresponding recipe is used to update the target.
  996.  
  997.           In the following simple example, each rule has a `::'
  998.           _r_u_l_e_o_p.  In such an operator we call the first `:' the
  999.           operator, and the second `:' the modifier.
  1000.  
  1001.           a.o :: a.c b.h
  1002.              first recipe for making a.o
  1003.  
  1004.           a.o :: a.y b.h
  1005.              second recipe for making a.o
  1006.  
  1007.           If a.o is found to be out of date with respect to a.c
  1008.           then the first recipe is used to make a.o.  If it is
  1009.           found out of date with respect to a.y then the second
  1010.           recipe is used.  If a.o is out of date with respect to
  1011.           b.h then both recipes are invoked to make a.o.  In the
  1012.           last case the order of invocation corresponds to the
  1013.           order in which the rule definitions appear in the
  1014.           makefile.
  1015.  
  1016.      Targets defined using a single `:' operator with a recipe
  1017.      may be redefined again with a new recipe by using a `:'
  1018.      operator with a `:' modifier.  This is equivalent to a tar-
  1019.      get having been initially defined with a rule using a `:'
  1020.      modifier.  Once a target is defined using a `:' modifier it
  1021.  
  1022.  
  1023.  
  1024. Version 3.50                    UW                             16
  1025.  
  1026.  
  1027.  
  1028.  
  1029. DMAKE(p)               Unsupported Software               DMAKE(p)
  1030.  
  1031.  
  1032.  
  1033.      may not be defined again with a recipe using only the `:'
  1034.      operator with no `:' modifier.  In both cases the use of a
  1035.      `:' modifier creates a new list of prerequisites and makes
  1036.      it the current prerequisite list for the target.  The `:'
  1037.      operator with no recipe always modifies the current list of
  1038.      prerequisites.  Thus assuming each of the following defini-
  1039.      tions has a recipe attached, then:
  1040.  
  1041.           joe :  fred ...     (1)
  1042.           joe :: more ...     (2)
  1043.  
  1044.           and
  1045.  
  1046.           joe :: fred ...     (3)
  1047.           joe :: more ...     (4)
  1048.  
  1049.      are legal and mean:  add the recipe associated with (2), or
  1050.      (4) to the set of recipes for joe, placing them after exist-
  1051.      ing recipes for making joe.  The constructs:
  1052.  
  1053.           joe :: fred ...     (5)
  1054.           joe : more ... (6)
  1055.  
  1056.           and
  1057.  
  1058.           joe : fred ... (7)
  1059.           joe : more ... (8)
  1060.  
  1061.      are errors since we have two sets of perfectly good recipes
  1062.      for making the target.
  1063.  
  1064.      _p_r_e_r_e_q_u_i_s_i_t_e_s is a possibly empty list of targets that must
  1065.      be brought up to date before making the current target.
  1066.  
  1067.      _r_e_c_i_p_e is a short form and allows the user to specify short
  1068.      rule definitions on a single line.  It is taken to be the
  1069.      first recipe line in a larger recipe if additional lines
  1070.      follow the rule definition.  If the semi-colon is present
  1071.      but the recipe line is empty (ie. null string) then it is
  1072.      taken to be an empty rule.  Any target so defined causes the
  1073.      _D_o_n_'_t _k_n_o_w _h_o_w _t_o _m_a_k_e _._._. error message to be suppressed
  1074.      when ddmmaakkee tries to make the target and fails.  This silence
  1075.      is maintained for rules that are terminated by a semicolon
  1076.      and have no following recipe lines, for targets listed on
  1077.      the command line, and for the first target found in the
  1078.      makefile.
  1079.  
  1080. RREECCIIPPEESS
  1081.      The traditional format used by most versions of Make defines
  1082.      the recipe lines as arbitrary strings that may contain macro
  1083.      expansions.  They follow a rule definition line and may be
  1084.      spaced apart by comment or blank lines.  The list of recipe
  1085.  
  1086.  
  1087.  
  1088. Version 3.50                    UW                             17
  1089.  
  1090.  
  1091.  
  1092.  
  1093. DMAKE(p)               Unsupported Software               DMAKE(p)
  1094.  
  1095.  
  1096.  
  1097.      lines defining the recipe is terminated by a new target
  1098.      definition, a macro definition, or end-of-file.  Each recipe
  1099.      line MMUUSSTT begin with a <<TTAABB>> character which may optionally
  1100.      be followed with one or all of the characters _'_@_%_+_-_'.  The
  1101.      _'_-_' indicates that non-zero exit values (ie. errors) are to
  1102.      be ignored when this recipe line is executed, the _'_+_' indi-
  1103.      cates that the current recipe line is to be executed using
  1104.      the shell, the _'_%_' indicates that ddmmaakkee should swap itself
  1105.      out to secondary storage (MSDOS only) before running the
  1106.      recipe and the _'_@_' indicates that the recipe line should NOT
  1107.      be echoed to the terminal prior to being executed.  Each
  1108.      switch is off by default (ie. by default, errors are signi-
  1109.      ficant, commands are echoed, no swapping is done and a shell
  1110.      is used only if the recipe line contains a character found
  1111.      in the value of the SHELLMETAS macro).  Global settings
  1112.      activated via command line options or special attribute or
  1113.      target names may also affect these settings.  An example
  1114.      recipe:
  1115.  
  1116.           target :
  1117.                first recipe line
  1118.                second recipe line, executed independently of the first.
  1119.                @a recipe line that is not echoed
  1120.                -and one that has errors ignored
  1121.                %and one that causes dmake to swap out
  1122.                +and one that is executed using a shell.
  1123.  
  1124.      The second and new format of the recipe block begins the
  1125.      block with the character '[' (the open group character) in
  1126.      the last non-white space position of a line, and terminates
  1127.      the block with the character ']' (the close group character)
  1128.      in the first non-white space position of a line.  In this
  1129.      form each recipe line need not have a leading TAB.  This is
  1130.      called a recipe group.  Groups so defined are fed intact as
  1131.      a single unit to a shell for execution whenever the
  1132.      corresponding target needs to be updated.  If the open group
  1133.      character '[' is preceded by one or all of -, @ or % then
  1134.      they apply to the entire group in the same way that they
  1135.      apply to single recipe lines.  You may also specify '+' but
  1136.      it is redundant as a shell is already being used to run the
  1137.      recipe.  See the MAKING TARGETS section for a description of
  1138.      how ddmmaakkee invokes recipes.  Here is an example of a group
  1139.      recipe:
  1140.  
  1141.           target :
  1142.           [
  1143.                first recipe line
  1144.                second recipe line
  1145.                all of these recipe lines are fed to a
  1146.                single copy of a shell for execution.
  1147.           ]
  1148.  
  1149.  
  1150.  
  1151.  
  1152. Version 3.50                    UW                             18
  1153.  
  1154.  
  1155.  
  1156.  
  1157. DMAKE(p)               Unsupported Software               DMAKE(p)
  1158.  
  1159.  
  1160.  
  1161. TTEEXXTT DDIIVVEERRSSIIOONNSS
  1162.      ddmmaakkee supports the notion of text diversions.  If a recipe
  1163.      line contains the macro expression
  1164.  
  1165.           $(mktmp[,_n_a_m_e___m_o_d_i_f_i_e_r] _d_a_t_a)
  1166.  
  1167.      then all text contained in the _d_a_t_a expression is expanded
  1168.      and is written to a new temporary file.  The name of that
  1169.      file is then returned as the value of the macro expansion
  1170.      and is substituted for the text of the macro expression if
  1171.      no _n_a_m_e___m_o_d_i_f_i_e_r is present.
  1172.  
  1173.      _d_a_t_a can be any text and must be separated from the 'mktmp'
  1174.      portion of the macro name by white-space.  The only restric-
  1175.      tion on the data text is that it must contain an balanced
  1176.      number of parentheses of the same kind as are used to ini-
  1177.      tiate the $(mktmp ...) expression.  For example:
  1178.  
  1179.           $(mktmp $(XXX))
  1180.  
  1181.      is legal and works as expected, but:
  1182.  
  1183.           $(mktmp text (to dump to file)
  1184.  
  1185.      is not legal.  You can achieve what you wish by either
  1186.      defining a macro that expands to '(' or by using {} in the
  1187.      macro expression; like this:
  1188.  
  1189.           ${mktmp text (to dump to file}
  1190.  
  1191.      which works as expected.  Since the temporary file is opened
  1192.      when the macro containg the text diversion expression is
  1193.      expanded, diversions may now be nested and any diversions
  1194.      that are created as part of ':=' macro expansions persist
  1195.      for the duration of the ddmmaakkee run.  The diversion text may
  1196.      contain the same escape codes as those described in the MAC-
  1197.      ROS section.  Thus if the _d_a_t_a text is to contain new lines
  1198.      they must be inserted using the \n escape sequence.  For
  1199.      example the expression:
  1200.  
  1201.           all:
  1202.                cat $(mktmp this is a\n\
  1203.                test of the text diversion\n)
  1204.  
  1205.      is replaced by:
  1206.  
  1207.           cat /tmp/mk12294AA
  1208.  
  1209.      where the temporary file contains two lines both of which
  1210.      are terminated by a new-line.  If the _d_a_t_a text spans multi-
  1211.      ple lines in the makefile then each line must be continued
  1212.      via the use of a \.  A second more illustrative example
  1213.  
  1214.  
  1215.  
  1216. Version 3.50                    UW                             19
  1217.  
  1218.  
  1219.  
  1220.  
  1221. DMAKE(p)               Unsupported Software               DMAKE(p)
  1222.  
  1223.  
  1224.  
  1225.      generates a response file to an MSDOS link command:
  1226.  
  1227.           OBJ = fred.obj mary.obj joe.obj
  1228.           all : $(OBJ)
  1229.                link @$(mktmp $(^:t"+\n")\n)
  1230.  
  1231.      The result of making `all' in the second example is the com-
  1232.      mand:
  1233.  
  1234.           link @/tmp/mk02394AA
  1235.  
  1236.      where the temporary file contains:
  1237.  
  1238.           fred.obj+
  1239.           mary.obj+
  1240.           joe.obj
  1241.  
  1242.      The last line of the file is terminated by a new-line which
  1243.      is inserted due to the \n found at the end of the _d_a_t_a
  1244.      string.
  1245.  
  1246.      If the optional _n_a_m_e___m_o_d_i_f_i_e_r is supplied in the diversion
  1247.      expression then the returned value of the expression is the
  1248.      expanded value of _n_a_m_e___m_o_d_i_f_i_e_r.  Together with the special
  1249.      macros TMPFILE and USESHELL this can be used to alter the
  1250.      name of the temporary file returned as the result of the
  1251.      $(mktmp ...) expansion.
  1252.  
  1253.      Under MS-DOS text diversions may be a problem.  Many DOS
  1254.      tools require that path names which contain directories use
  1255.      the \ character to delimit the directories.  Some users how-
  1256.      ever wish to use the '/' to delimit pathnames on their sys-
  1257.      tem and use environments that allow them to do so.  These
  1258.      environments usually accept the \ delimited path names as
  1259.      well.  In order to allow the user the most flexibility ddmmaakkee
  1260.      defines three macros that can be used when text diversion
  1261.      file names are being placed into the recipe text to be exe-
  1262.      cuted.  The macro TMPFILE contains the name of the most
  1263.      recently opened temporary file, and the macro, USESHELL, is
  1264.      set to "yes" if the current recipe is forced to use a shell
  1265.      via the .USESHELL or '+' directives, otherwise its value is
  1266.      "no".  In the absence of a _n_a_m_e___m_o_d_i_f_i_e_r in the diversion
  1267.      expression the result of expanding the diversion expression
  1268.      is the value of TMPFILE.  The ddmmaakkee startup files define the
  1269.      macro DIVFILE whose value is either the value of TMPFILE or
  1270.      the value of TMPFILE editted to replace any '/' characters
  1271.      to the appropriate value based on the current shell and
  1272.      whether it will be used to execute the recipe.
  1273.  
  1274.      Previous versions of ddmmaakkee defined text diversions using <+,
  1275.      +> strings, where <+ started a text diversion and +> ter-
  1276.      minated one.  ddmmaakkee is backward compatible with this
  1277.  
  1278.  
  1279.  
  1280. Version 3.50                    UW                             20
  1281.  
  1282.  
  1283.  
  1284.  
  1285. DMAKE(p)               Unsupported Software               DMAKE(p)
  1286.  
  1287.  
  1288.  
  1289.      construct if the <+ and +> appear literally on the same
  1290.      recipe line or in the same macro value string.  In such
  1291.      instances the expression:
  1292.  
  1293.           <+data text+>
  1294.  
  1295.      is mapped to:
  1296.  
  1297.           $(mktmp data text)
  1298.  
  1299.      which is fully output compatible with the earlier construct.
  1300.      <+, +> constructs whose text spans multiple lines must be
  1301.      converted by hand to use $(mktmp ...).
  1302.  
  1303.      If the environment variable TMPDIR is defined then the tem-
  1304.      porary file is placed into the directory specified by that
  1305.      variable.  A makefile can modify the location of temporary
  1306.      files by defining a macro named TMPDIR and exporting it
  1307.      using the .EXPORT special target.
  1308.  
  1309. SSPPEECCIIAALL TTAARRGGEETTSS
  1310.      This section describes the special targets that are recog-
  1311.      nized by ddmmaakkee.  Some are affected by attributes and others
  1312.      are not.
  1313.  
  1314.      ..EERRRROORR        If defined then the recipe associated with
  1315.                    this target is executed whenever an error con-
  1316.                    dition is detected by ddmmaakkee.  All attributes
  1317.                    that can be used with any other target may be
  1318.                    used with this target.  Any prerequisites of
  1319.                    this target will be brought up to date during
  1320.                    it's processing.  NOTE:  errors will be
  1321.                    ignored while making this target, in extreme
  1322.                    cases this may cause some problems.
  1323.  
  1324.      ..EEXXPPOORRTT       All prerequisites associated with this target
  1325.                    are assumed to correspond to macro names and
  1326.                    they and their values are exported to the
  1327.                    environment as environment strings at the
  1328.                    point in the makefile at which this target
  1329.                    appears.  Any attributes specified with this
  1330.                    target are ignored.  Only macros which have
  1331.                    been assigned a value in the makefile prior to
  1332.                    the export directive are exported, macros as
  1333.                    yet undefined are not exported.
  1334.  
  1335.      ..IIMMPPOORRTT       Prerequisite names specified for this target
  1336.                    are searched for in the environment and
  1337.                    defined as macros with their value taken from
  1338.                    the environment.  If the name cannot be found
  1339.                    in the environment an error message is issued.
  1340.                    .IMPORT accepts the .IGNORE attribute.  When
  1341.  
  1342.  
  1343.  
  1344. Version 3.50                    UW                             21
  1345.  
  1346.  
  1347.  
  1348.  
  1349. DMAKE(p)               Unsupported Software               DMAKE(p)
  1350.  
  1351.  
  1352.  
  1353.                    given, it causes ddmmaakkee to ignore the above
  1354.                    error.  See the MACROS section for a descrip-
  1355.                    tion of the processing of imported macro
  1356.                    values.
  1357.  
  1358.      ..IINNCCLLUUDDEE      Parse another makefile just as if it had been
  1359.                    located at the point of the .INCLUDE in the
  1360.                    current makefile.  The list of prerequisites
  1361.                    gives the list of makefiles to try to read.
  1362.                    If the list contains multiple makefiles then
  1363.                    they are read in order from left to right.
  1364.                    The following search rules are used when try-
  1365.                    ing to locate the file.  If the filename is
  1366.                    surrounded by " or just by itself then it is
  1367.                    searched for in the current directory.  If it
  1368.                    is not found it is then searched for in each
  1369.                    of the directories specified for the .INCLU-
  1370.                    DEDIRS special target.  If the file name is
  1371.                    surrounded by < and >, (ie.
  1372.                    <my_spiffy_new_makefile>) then it is searched
  1373.                    for only in the directories given by the
  1374.                    .INCLUDEDIRS special target.  In both cases if
  1375.                    the file name is a fully qualified name start-
  1376.                    ing at the root of the file system then it is
  1377.                    only searched for once, and the .INCLUDEDIRS
  1378.                    list is ignored.  .INCLUDE accepts the .IGNORE
  1379.                    and .SETDIR attributes.  If .IGNORE attribute
  1380.                    is given and the file cannot be found then
  1381.                    ddmmaakkee continues processing, otherwise an error
  1382.                    message is generated.  The .SETDIR attribute
  1383.                    causes ddmmaakkee to change directories to the
  1384.                    specified directory prior to attempting the
  1385.                    include operation.
  1386.  
  1387.      ..IINNCCLLUUDDEEDDIIRRSS  The list of prerequisites specified for this
  1388.                    target defines the set of directories to
  1389.                    search when trying to include a makefile.
  1390.  
  1391.      ..MMAAKKEEFFIILLEESS    The list of prerequisites is the set of files
  1392.                    to try to read as the default makefile.  By
  1393.                    default this target is defined as:
  1394.  
  1395.                         .MAKEFILES : makefile.mk Makefile
  1396.                    makefile
  1397.  
  1398.  
  1399.      ..SSOOUURRCCEE       The prerequisite list of this target defines a
  1400.                    set of directories to check when trying to
  1401.                    locate a target file name.  See the section on
  1402.                    BINDING of targets for more information.
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408. Version 3.50                    UW                             22
  1409.  
  1410.  
  1411.  
  1412.  
  1413. DMAKE(p)               Unsupported Software               DMAKE(p)
  1414.  
  1415.  
  1416.  
  1417.      ..SSOOUURRCCEE..ssuuffff  The same as .SOURCE, except that the
  1418.                    .SOURCE.suff list is searched first when try-
  1419.                    ing to locate a file matching the a target
  1420.                    whose name ends in the suffix .suff.
  1421.  
  1422.      ..RREEMMOOVVEE       The recipe of this target is used whenever
  1423.                    ddmmaakkee needs to remove intermediate targets
  1424.                    that were made but do not need to be kept
  1425.                    around.  Such targets result from the applica-
  1426.                    tion of transitive closure on the dependency
  1427.                    graph.
  1428.  
  1429.      In addition to the special targets above, several other
  1430.      forms of targets are recognized and are considered special,
  1431.      their exact form and use is defined in the sections that
  1432.      follow.
  1433.  
  1434. SSPPEECCIIAALL MMAACCRROOSS
  1435.      ddmmaakkee defines a number of special macros.  They are divided
  1436.      into three classes: control macros, run-time macros, and
  1437.      function macros.  The control macros are used by ddmmaakkee to
  1438.      configure it's actions, and are the preferred method of
  1439.      doing so.  In the case when a control macro has the same
  1440.      function as a special target or attribute they share the
  1441.      same name as the special target or attribute.  The run-time
  1442.      macros are defined when ddmmaakkee makes targets and may be used
  1443.      by the user inside recipes.  The function macros provide
  1444.      higher level functions dealing with macro expansion and
  1445.      diversion file processing.
  1446.  
  1447. CCOONNTTRROOLL MMAACCRROOSS
  1448.      To use the control macros simply assign them a value just
  1449.      like any other macro.  The control macros are divided into
  1450.      three groups: string valued macros, character valued macros,
  1451.      and boolean valued macros.
  1452.  
  1453.      The following are all of the string valued macros.  This
  1454.      list is divided into two groups.  The first group gives the
  1455.      string valued macros that are defined internally and cannot
  1456.      be directly set by the user.
  1457.  
  1458.      DDIIRRBBRRKKSSTTRR     Contains the string of chars used to terminate
  1459.                    the name of a directory in a pathname.  Under
  1460.                    UNIX it's value is "/", under MSDOS it's value
  1461.                    is "/\:".
  1462.  
  1463.      IINNCCDDEEPPTTHH      This macro's value is a string of digits
  1464.                    representing the current depth of makefile
  1465.                    inclusion.  In the first makefile level this
  1466.                    value is zero.
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472. Version 3.50                    UW                             23
  1473.  
  1474.  
  1475.  
  1476.  
  1477. DMAKE(p)               Unsupported Software               DMAKE(p)
  1478.  
  1479.  
  1480.  
  1481.      MMFFLLAAGGSS        Is the list of flags that were given on the
  1482.                    command line including a leading switch char-
  1483.                    acter.  The -f flag is not included in this
  1484.                    list.
  1485.  
  1486.      MMAAKKEECCMMDD       Is the name with which ddmmaakkee was invoked.
  1487.  
  1488.      MMAAKKEEDDIIRR       Is the full path to the initial directory in
  1489.                    which ddmmaakkee was invoked.
  1490.  
  1491.      MMAAKKEEFFIILLEE      Contains the string "-f _m_a_k_e_f_i_l_e" where,
  1492.                    _m_a_k_e_f_i_l_e is the name of initial user makefile
  1493.                    that was first read.
  1494.  
  1495.      MMAAKKEEFFLLAAGGSS     Is the same as $(MFLAGS) but has no leading
  1496.                    switch character. (ie. MFLAGS = -$(MAKEFLAGS))
  1497.  
  1498.      MMAAKKEEMMAACCRROOSS    Contains the complete list of macro expres-
  1499.                    sions that were specified on the command line.
  1500.  
  1501.      MMAAKKEETTAARRGGEETTSS   Contains the name(s) of the target(s), if any,
  1502.                    that were specified on the command line.
  1503.  
  1504.      MMAAXXPPRROOCCEESSSSLLIIMMIITT
  1505.                    Is a numeric string representing the maximum
  1506.                    number of processes that ddmmaakkee can use when
  1507.                    making targets using parallel mode.
  1508.  
  1509.      NNUULLLL          Is permanently defined to be the NULL string.
  1510.                    This is useful when comparing a conditional
  1511.                    expression to an NULL value.
  1512.  
  1513.      PPWWDD           Is the full path to the current directory in
  1514.                    which make is executing.
  1515.  
  1516.      TTMMPPFFIILLEE       Is set to the name of the most recent tem-
  1517.                    porary file opened by ddmmaakkee.  Temporary files
  1518.                    are used for text diversions and for group
  1519.                    recipe processing.
  1520.  
  1521.      TTMMDD           Stands for "To Make Dir", and is the path from
  1522.                    the present directory (value of $(PWD)) to the
  1523.                    directory that ddmmaakkee was started up in (value
  1524.                    of $(MAKEDIR)).  This macro is modified when
  1525.                    .SETDIR attributes are processed.
  1526.  
  1527.      UUSSEESSHHEELLLL      The value of this macro is set to "yes" if the
  1528.                    current recipe is forced to use a shell for
  1529.                    its execution via the .USESHELL or '+' direc-
  1530.                    tives, its value is "no" otherwise.
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536. Version 3.50                    UW                             24
  1537.  
  1538.  
  1539.  
  1540.  
  1541. DMAKE(p)               Unsupported Software               DMAKE(p)
  1542.  
  1543.  
  1544.  
  1545.      The second group of string valued macros control ddmmaakkee
  1546.      behavior and may be set by the user.
  1547.  
  1548.      ..SSEETTDDIIRR         If this macro is assigned a value then ddmmaakkee
  1549.                      will change to the directory given by that
  1550.                      value before making any targets.  This macro
  1551.                      is equivalent to the .SETDIR attribute.
  1552.                      Thus the two lines:
  1553.  
  1554.                      .SETDIR=fred/hello :
  1555.  
  1556.                      .SETDIR := fred/hello
  1557.  
  1558.                      are completely equivalent.  The difference
  1559.                      being that the first is processed as a rule
  1560.                      definition and the other as a macro.
  1561.  
  1562.      AAUUGGMMAAKKEE         If set to a non NULL value will enable the
  1563.                      transformation of special meta targets to
  1564.                      support special AUGMAKE inferences.
  1565.  
  1566.      DDIIRRSSEEPPSSTTRR       Contains the string that is used to separate
  1567.                      directory components when path names are
  1568.                      constructed.  It is defined with a default
  1569.                      value at startup.
  1570.  
  1571.      DDIIVVFFIILLEE         Is defined in the startup file and gives the
  1572.                      name that should be used for the diversion
  1573.                      file name when specified as the name modif-
  1574.                      ier in $(mktmp ...) expansions, see the TEXT
  1575.                      DIVERSION section for details.
  1576.  
  1577.      GGRROOUUPPFFLLAAGGSS      This macro gives the set of flags to pass to
  1578.                      the shell when invoking it to execute a
  1579.                      group recipe.  The value of the macro is the
  1580.                      list of flags with a leading switch indica-
  1581.                      tor.  (ie. `-' under UNIX)
  1582.  
  1583.      GGRROOUUPPSSHHEELLLL      This macro defines the full path to the exe-
  1584.                      cutable image to be used as the shell when
  1585.                      processing group recipes.  This macro must
  1586.                      be defined if group recipes are used.  It is
  1587.                      assigned a default value in the startup
  1588.                      makefile.  Under UNIX this value is /bin/sh.
  1589.  
  1590.      GGRROOUUPPSSUUFFFFIIXX     If defined, this macro gives the string to
  1591.                      use as a suffix when creating group recipe
  1592.                      files to be handed to the command inter-
  1593.                      preter.  For example, if it is defined as
  1594.                      .sh, then all temporary files created by
  1595.                      ddmmaakkee will end in the suffix .sh.  Under
  1596.                      MSDOS if you are using command.com as your
  1597.  
  1598.  
  1599.  
  1600. Version 3.50                    UW                             25
  1601.  
  1602.  
  1603.  
  1604.  
  1605. DMAKE(p)               Unsupported Software               DMAKE(p)
  1606.  
  1607.  
  1608.  
  1609.                      GROUPSHELL, then this suffix must be set to
  1610.                      .bat in order for group recipes to function
  1611.                      correctly.
  1612.  
  1613.      MMAAKKEE            Is defined in the startup file by default.
  1614.                      The string $(MAKE) is recognized when using
  1615.                      the -n option for single line recipes.  Ini-
  1616.                      tially this macro is defined to have the
  1617.                      value "$(MAKECMD) $(MFLAGS)".
  1618.  
  1619.      MMAAKKEESSTTAARRTTUUPP     This macro defines the full path to the ini-
  1620.                      tial startup makefile.  Use the --VV command
  1621.                      line option to discover it's initial value.
  1622.  
  1623.      MMAAXXLLIINNEELLEENNGGTTHH   This macro defines the maximum size of a
  1624.                      single line of makefile input text.  The
  1625.                      size is specified as a number, the default
  1626.                      value is defined internally and is shown via
  1627.                      the --VV option.  A buffer of this size plus 2
  1628.                      is allocated for reading makefile text.  The
  1629.                      buffer is freed before any targets are made,
  1630.                      thereby allowing files containing long input
  1631.                      lines to be processed without consuming
  1632.                      memory during the actual make.
  1633.  
  1634.      MMAAXXPPRROOCCEESSSS      Specify the maximum number of child
  1635.                      processes to use when making targets.  The
  1636.                      default value of this macro is "1" and it's
  1637.                      value cannot exceed the value of the macro
  1638.                      MAXPROCESSLIMIT.  Setting the value of MAX-
  1639.                      PROCESS on the command line or in the
  1640.                      makefile is equivalent to supplying a
  1641.                      corresponding value to the -P flag on the
  1642.                      command line.
  1643.  
  1644.      PPRREEPP            This macro defines the number of iterations
  1645.                      to be expanded automatically when processing
  1646.                      % rule definitions of the form:
  1647.  
  1648.                      % : %.suff
  1649.  
  1650.                      See the sections on PERCENT(%) RULES for
  1651.                      details on how PREP is used.
  1652.  
  1653.      SSHHEELLLL           This macro defines the full path to the exe-
  1654.                      cutable image to be used as the shell when
  1655.                      processing single line recipes.  This macro
  1656.                      must be defined if recipes requiring the
  1657.                      shell for execution are to be used.  It is
  1658.                      assigned a default value in the startup
  1659.                      makefile.  Under UNIX this value is /bin/sh.
  1660.  
  1661.  
  1662.  
  1663.  
  1664. Version 3.50                    UW                             26
  1665.  
  1666.  
  1667.  
  1668.  
  1669. DMAKE(p)               Unsupported Software               DMAKE(p)
  1670.  
  1671.  
  1672.  
  1673.      SSHHEELLLLFFLLAAGGSS      This macro gives the set of flags to pass to
  1674.                      the shell when invoking it to execute a sin-
  1675.                      gle line recipe.  The value of the macro is
  1676.                      the list of flags with a leading switch
  1677.                      indicator.  (ie. `-' under UNIX)
  1678.  
  1679.      SSHHEELLLLMMEETTAASS      Each time ddmmaakkee executes a single recipe
  1680.                      line (not a group recipe) the line is
  1681.                      searched for any occurrence of a character
  1682.                      defined in the value of SHELLMETAS.  If such
  1683.                      a character is found the recipe line is
  1684.                      defined to require a shell to ensure it's
  1685.                      correct execution.  In such instances a
  1686.                      shell is used to invoke the recipe line.  If
  1687.                      no match is found the recipe line is exe-
  1688.                      cuted without the use of a shell.
  1689.  
  1690.  
  1691.      There is only one character valued macro defined by ddmmaakkee:
  1692.      SSWWIITTCCHHAARR contains the switch character used to introduce
  1693.      options on command lines.  On UNIX it's value is '-', on
  1694.      MSDOS it's value may be '/' or '-'.  The macro is internally
  1695.      defined and is not user setable.  The MSDOS version of ddmmaakkee
  1696.      attempts to first extract SWITCHAR from an environment vari-
  1697.      able of the same name.  If that fails it then attempts to
  1698.      use the undocumented getswitchar interrupt call, and returns
  1699.      the result of that.  Thus under MSDOS version 4.0 you must
  1700.      set the value of the environment macro SWITCHAR to '/' to
  1701.      obtain predictable behaviour.
  1702.  
  1703.      All boolean macros currently understood by ddmmaakkee correspond
  1704.      directly to the previously defined attributes.  These macros
  1705.      provide a second way to apply global attributes, and
  1706.      represent the preferred method of doing so.  They are used
  1707.      by assigning them a value.  If the value is not a NULL
  1708.      string then the boolean condition is set to on.  If the
  1709.      value is a NULL string then the condition is set to off.
  1710.      There are five conditions defined and they correspond
  1711.      directly to the attributes of the same name.  Their meanings
  1712.      are defined in the ATTRIBUTES section above.  The macros
  1713.      are: ..EEPPIILLOOGG, ..IIGGNNOORREE, ..MMKKSSAARRGGSS, ..PPRREECCIIOOUUSS, ..PPRROOLLOOGG,
  1714.      ..SSEEQQUUEENNTTIIAALL, ..SSIILLEENNTT, ..SSWWAAPP, and ..UUSSEESSHHEELLLL.  Assigning any
  1715.      of these a non NULL value will globally set the correspond-
  1716.      ing attribute to on.
  1717.  
  1718. RRUUNN__TTIIMMEE MMAACCRROOSS
  1719.      These macros are defined when ddmmaakkee is making targets, and
  1720.      may take on different values for each target.  $$@@ is defined
  1721.      to be the full target name, $$?? is the list of all out of
  1722.      date prerequisites, $$&& is the list of all prerequisites, $$>>
  1723.      is the name of the library if the current target is a
  1724.      library member, and $$<< is the list of prerequisites
  1725.  
  1726.  
  1727.  
  1728. Version 3.50                    UW                             27
  1729.  
  1730.  
  1731.  
  1732.  
  1733. DMAKE(p)               Unsupported Software               DMAKE(p)
  1734.  
  1735.  
  1736.  
  1737.      specified in the current rule.  If the current target had a
  1738.      recipe inferred then $$<< is the name of the inferred prere-
  1739.      quisite even if the target had a list of prerequisites sup-
  1740.      plied using an explicit rule that did not provide a recipe.
  1741.      In such situations $$&& gives the full list of prerequisites.
  1742.  
  1743.      $$** is defined as $$((@@::ddbb)) when making targets with explicit
  1744.      recipes and is defined as the value of % when making targets
  1745.      whose recipe is the result of an inference.  In the first
  1746.      case $$** is the target name with no suffix, and in the second
  1747.      case, is the value of the matched % pattern from the associ-
  1748.      ated %-rule.  $$^^ expands to the set of out of date prere-
  1749.      quisites taken from the current value of $$<<.  In addition to
  1750.      these, $$$$ expands to $, {{{{ expands to {, }}}} expands to },
  1751.      and the strings <<++ and ++>> are recognized as respectively
  1752.      starting and terminating a text diversion when they appear
  1753.      literally together in the same input line.
  1754.  
  1755.      The difference between $? and $^ can best be illustrated by
  1756.      an example, consider:
  1757.  
  1758.           fred.out : joe amy hello
  1759.                rules for making fred
  1760.  
  1761.           fred.out : my.c your.h his.h her.h   # more prerequisites
  1762.  
  1763.      Assume joe, amy, and my.c are newer then fred.out.  When
  1764.      ddmmaakkee executes the recipe for making fred.out the values of
  1765.      the following macros will be:
  1766.  
  1767.           $@ --> fred.out
  1768.           $* --> fred
  1769.           $? --> joe amy my.c  # note the difference between $? and $^
  1770.           $^ --> joe amy
  1771.           $< --> joe amy hello
  1772.           $& --> joe amy hello my.c your.h his.h her.h
  1773.  
  1774.  
  1775. FFUUNNCCTTIIOONN MMAACCRROOSS
  1776.      Only one function macro is defined at this time.  The
  1777.      $(mktmp ...) construct can be used to create a temporary
  1778.      file containing data and returns the name of that file as
  1779.      it's result.  See the TEXT DIVERSION section for details on
  1780.      its use.  Temporary files created using this macro persist
  1781.      for the duration of the ddmmaakkee run if processed as part of a
  1782.      macro assignment operation, or until an associated target's
  1783.      recipe is fully completed at which time the temporary file
  1784.      is removed.  NOTE:  Specifying '-v' on the command line
  1785.      causes all temporary files to be retained when ddmmaakkee exits.
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792. Version 3.50                    UW                             28
  1793.  
  1794.  
  1795.  
  1796.  
  1797. DMAKE(p)               Unsupported Software               DMAKE(p)
  1798.  
  1799.  
  1800.  
  1801. DDYYNNAAMMIICC PPRREERREEQQUUIISSIITTEESS
  1802.      ddmmaakkee looks for prerequisites whose names contain macro
  1803.      expansions during target processing.  Any such prerequisites
  1804.      are expanded and the result of the expansion is used as the
  1805.      prerequisite name.  As an example the line:
  1806.  
  1807.           fred : $$@.c
  1808.  
  1809.      causes the $$@ to be expanded when ddmmaakkee is making fred, and
  1810.      it resolves to the target _f_r_e_d.  This enables dynamic prere-
  1811.      quisites to be generated.  The value of @ may be modified by
  1812.      any of the valid macro modifiers.  So you can say for exam-
  1813.      ple:
  1814.  
  1815.           fred.out : $$(@:b).c
  1816.  
  1817.      where the $$(@:b) expands to _f_r_e_d.  Note the use of $$
  1818.      instead of $ to indicate the dynamic expansion, this is due
  1819.      to the fact that the rule line is expanded when it is ini-
  1820.      tially parsed, and $$ then returns $ which later triggers
  1821.      the dynamic prerequisite expansion.  If you really want a $
  1822.      to be part of a prerequisite name you must use $$$$.
  1823.      Dynamic macro expansion is performed in all user defined
  1824.      rules, and the special targets .SOURCE*, and .INCLUDEDIRS.
  1825.  
  1826. BBIINNDDIINNGG TTAARRGGEETTSS
  1827.      This operation takes a target name and binds it to an exist-
  1828.      ing file, if possible.  ddmmaakkee makes a distinction between
  1829.      the internal target name of a target and it's associated
  1830.      external file name.  Thus it is possible for a target's
  1831.      internal name and its external file name to differ.  To per-
  1832.      form the binding, the following set of rules is used.
  1833.      Assume that we are trying to bind a target whose name is of
  1834.      the form _X_._s_u_f_f, where _._s_u_f_f is the suffix and _X is the stem
  1835.      portion (ie. that part which contains the directory and the
  1836.      basename).  ddmmaakkee takes this target name and performs a
  1837.      series of search operations that try to find a suitably
  1838.      named file in the external file system.  The search opera-
  1839.      tion is user controlled via the settings of the various
  1840.      .SOURCE targets.
  1841.  
  1842.           1.   If target has the .SYMBOL attribute set then look
  1843.                for it in the library.  If found, replace the tar-
  1844.                get name with the library member name and continue
  1845.                with step 2.  If the name is not found then
  1846.                return.
  1847.  
  1848.           2.   Extract the suffix portion (that following the
  1849.                `.') of the target name.  If the suffix is not
  1850.                null, look up the special target .SOURCE.<suff>
  1851.                (<suff> is the suffix). If the special target
  1852.                exists then search each directory given in the
  1853.  
  1854.  
  1855.  
  1856. Version 3.50                    UW                             29
  1857.  
  1858.  
  1859.  
  1860.  
  1861. DMAKE(p)               Unsupported Software               DMAKE(p)
  1862.  
  1863.  
  1864.  
  1865.                .SOURCE.<suff> prerequisite list for the target.
  1866.                If the target's suffix was null (ie. _._s_u_f_f was
  1867.                empty) then perform the above search but use the
  1868.                special target .SOURCE.NULL instead.  If at any
  1869.                point a match is found then terminate the search.
  1870.                If a directory in the prerequisite list is the
  1871.                special name `.NULL ' perform a search for the
  1872.                full target name without prepending any directory
  1873.                portion (ie. prepend the NULL directory).  (a
  1874.                default target of '.SOURCE : .NULL' is defined by
  1875.                ddmmaakkee at startup, and is user redefinable)
  1876.  
  1877.           3.   The search in step 2. failed.  Repeat the same
  1878.                search but this time use the special target
  1879.                .SOURCE.
  1880.  
  1881.           4.   The search in step 3. failed.  If the target has
  1882.                the library member attribute (.LIBMEMBER) set then
  1883.                try to find the target in the library which was
  1884.                passed along with the .LIBMEMBER attribute (see
  1885.                the MAKING LIBRARIES section).  The bound file
  1886.                name assigned to a target which is successfully
  1887.                located in a library is the same name that would
  1888.                be assigned had the search failed (see 5.).
  1889.  
  1890.           5.   The search failed.  Either the target was not
  1891.                found in any of the search directories or no
  1892.                applicable .SOURCE special targets exist.  If
  1893.                applicable .SOURCE special targets exist, but the
  1894.                target was not found, then ddmmaakkee assigns the first
  1895.                name searched as the bound file name.  If no
  1896.                applicable .SOURCE special targets exist, then the
  1897.                full original target name becomes the bound file
  1898.                name.
  1899.  
  1900.      There is potential here for a lot of search operations.  The
  1901.      trick is to define .SOURCE.x special targets with short
  1902.      search lists and leave .SOURCE as short as possible.  The
  1903.      search algorithm has the following useful side effect.  When
  1904.      a target having the .LIBMEMBER (library member) attribute is
  1905.      searched for, it is first searched for as an ordinary file.
  1906.      When a number of library members require updating it is
  1907.      desirable to compile all of them first and to update the
  1908.      library at the end in a single operation.  If one of the
  1909.      members does not compile and ddmmaakkee stops, then the user may
  1910.      fix the error and make again.  ddmmaakkee will not remake any of
  1911.      the targets whose object files have already been generated
  1912.      as long as none of their prerequisite files have been modi-
  1913.      fied as a result of the fix.
  1914.  
  1915.      When defining .SOURCE and .SOURCE.x targets the construct
  1916.  
  1917.  
  1918.  
  1919.  
  1920. Version 3.50                    UW                             30
  1921.  
  1922.  
  1923.  
  1924.  
  1925. DMAKE(p)               Unsupported Software               DMAKE(p)
  1926.  
  1927.  
  1928.  
  1929.           .SOURCE :
  1930.           .SOURCE : fred gery
  1931.  
  1932.      is equivalent to
  1933.  
  1934.           .SOURCE :- fred gery
  1935.  
  1936.      ddmmaakkee correctly handles the UNIX Make variable VPATH.  By
  1937.      definition VPATH contains a list of ':' separated direc-
  1938.      tories to search when looking for a target.  ddmmaakkee maps
  1939.      VPATH to the following special rule:
  1940.  
  1941.           .SOURCE :^ $(VPATH:s/:/ /)
  1942.  
  1943.      Which takes the value of VPATH and sets .SOURCE to the same
  1944.      set of directories as specified in VPATH.
  1945.  
  1946. PPEERRCCEENNTT((%%)) RRUULLEESS AANNDD MMAAKKIINNGG IINNFFEERREENNCCEESS
  1947.      When ddmmaakkee makes a target it's set of prerequisites (if any)
  1948.      must exist and the target must have a recipe which ddmmaakkee can
  1949.      use to make it.  If the makefile does not specify an expli-
  1950.      cit recipe for the target then ddmmaakkee uses special rules to
  1951.      try to infer a recipe which it can use to make the target.
  1952.      Previous versions of Make perform this task by using rules
  1953.      that are defined by targets of the form .<suffix>.<suffix>
  1954.      and by using the .SUFFIXES list of suffixes.  The exact
  1955.      workings of this mechanism were sometimes difficult to
  1956.      understand and often limiting in their usefulness.  Instead,
  1957.      ddmmaakkee supports the concept of _%_-_m_e_t_a rules. The syntax and
  1958.      semantics of these rules differ from standard rule lines as
  1959.      follows:
  1960.  
  1961.           _<_%_-_t_a_r_g_e_t_> [_<_a_t_t_r_i_b_u_t_e_s_>] _<_r_u_l_e_o_p_> [_<_%_-_p_r_e_r_e_q_u_i_s_i_t_e_s_>] [;_<_r_e_c_i_p_e_>]
  1962.  
  1963.      where _%_-_t_a_r_g_e_t is a target containing exactly a single `%'
  1964.      sign, _a_t_t_r_i_b_u_t_e_s is a list (possibly empty) of attributes,
  1965.      _r_u_l_e_o_p is the standard set of rule operators, _%_-_p_r_e_r_e_-
  1966.      _q_u_i_s_i_t_e_s , if present, is a list of prerequisites containing
  1967.      zero or more `%' signs, and _r_e_c_i_p_e_, if present, is the first
  1968.      line of the recipe.
  1969.  
  1970.      The _%_-_t_a_r_g_e_t defines a pattern against which a target whose
  1971.      recipe is being inferred gets matched.  The pattern match
  1972.      goes as follows:  all chars are matched exactly from left to
  1973.      right up to but not including the % sign in the pattern, %
  1974.      then matches the longest string from the actual target name
  1975.      not ending in the suffix given after the % sign in the pat-
  1976.      tern.  Consider the following examples:
  1977.  
  1978.           %.c       matches fred.c but not joe.c.Z
  1979.           dir/%.c   matches dir/fred.c but not dd/fred.c
  1980.           fred/%    matches fred/joe.c but not f/joe.c
  1981.  
  1982.  
  1983.  
  1984. Version 3.50                    UW                             31
  1985.  
  1986.  
  1987.  
  1988.  
  1989. DMAKE(p)               Unsupported Software               DMAKE(p)
  1990.  
  1991.  
  1992.  
  1993.           %         matches anything
  1994.  
  1995.      In each case the part of the target name that matched the %
  1996.      sign is retained and is substituted for any % signs in the
  1997.      prerequisite list of the %-meta rule when the rule is
  1998.      selected during inference and ddmmaakkee constructs the depen-
  1999.      dency specified by the %-meta rule for the actual target.
  2000.      As an example the following %-meta rules describe the fol-
  2001.      lowing:
  2002.  
  2003.           %.c : %.y ; recipe...
  2004.  
  2005.      describes how to make any file ending in .c if a correspond-
  2006.      ing file ending in .y can be found.
  2007.  
  2008.           foo%.o : fee%.k ; recipe...
  2009.  
  2010.      is used to describe how to make fooxxxx.o from feexxxx.k.
  2011.  
  2012.           %.a :; recipe...
  2013.  
  2014.      describes how to make a file whose suffix is .a without
  2015.      inferring any prerequisites.
  2016.  
  2017.           %.c : %.y yaccsrc/%.y ; recipe...
  2018.  
  2019.      is a short form for the construct:
  2020.  
  2021.           %.c : %.y ; recipe...
  2022.           %.c : yaccsrc/%.y ; recipe...
  2023.  
  2024.      ie. It is possible to specify the same recipe for two
  2025.      %-rules by giving more than one prerequisite in the prere-
  2026.      quisite list.  A more interesting example is:
  2027.  
  2028.           % : RCS/%,v ; co $@
  2029.  
  2030.      which describes how to take any target and check it out of
  2031.      the RCS directory if the corresponding file exists in the
  2032.      RCS directory.  The equivalent SCCS rule would be:
  2033.  
  2034.           % : s.% ; get $@
  2035.  
  2036.  
  2037.      The previous RCS example defines an infinite rule, because
  2038.      it says how to make _a_n_y_t_h_i_n_g from RCS/%,v, and _a_n_y_t_h_i_n_g also
  2039.      includes RCS/fred.c,v.  To limit the size of the graph that
  2040.      results from such rules ddmmaakkee uses the macro variable PREP
  2041.      (stands for % repetition).  By default the value of this
  2042.      variable is 0, which says that no repetitions of a %-rule
  2043.      are to be generated.  If it is set to something greater than
  2044.      0, then that many repetitions of any infinite %-rule are
  2045.  
  2046.  
  2047.  
  2048. Version 3.50                    UW                             32
  2049.  
  2050.  
  2051.  
  2052.  
  2053. DMAKE(p)               Unsupported Software               DMAKE(p)
  2054.  
  2055.  
  2056.  
  2057.      allowed.  If in the above example PREP was set to 1, then
  2058.      ddmmaakkee would generate the dependency graph:
  2059.  
  2060.           % --> RCS/%,v --> RCS/RCS/%,v,v
  2061.  
  2062.      Where each link is assigned the same recipe as the first
  2063.      link.  PREP should be used only in special cases, since it
  2064.      may result in a large increase in the number of possible
  2065.      prerequisites tested.
  2066.  
  2067.      ddmmaakkee supports dynamic prerequisite generation for prere-
  2068.      quisites of %-meta rules.  This is best illustrated by an
  2069.      example.  The RCS rule shown above can infer how to check
  2070.      out a file from a corresponding RCS file only if the target
  2071.      is a simple file name with no directory information.  That
  2072.      is, the above rule can infer how to find _R_C_S_/_f_r_e_d_._c_,_v from
  2073.      the target _f_r_e_d_._c, but cannot infer how to find
  2074.      _s_r_c_d_i_r_/_R_C_S_/_f_r_e_d_._c_,_v from _s_r_c_d_i_r_/_f_r_e_d_._c because the above
  2075.      rule will cause ddmmaakkee to look for RCS/srcdir/fred.c,v; which
  2076.      does not exist (assume that srcdir has it's own RCS direc-
  2077.      tory as is the common case).
  2078.  
  2079.      A more versatile formulation of the above RCS check out rule
  2080.      is the following:
  2081.  
  2082.           % :  $$(@:d)RCS/$$(@:f),v : co $@
  2083.  
  2084.      This rule uses the dynamic macro $@ to specify the prere-
  2085.      quisite to try to infer.  During inference of this rule the
  2086.      macro $@ is set to the value of the target of the %-meta
  2087.      rule and the appropriate prerequisite is generated by
  2088.      extracting the directory portion of the target name (if
  2089.      any), appending the string _R_C_S_/ to it, and appending the
  2090.      target file name with a trailing _,_v attached to the previous
  2091.      result.
  2092.  
  2093.      ddmmaakkee can also infer indirect prerequisites.  An inferred
  2094.      target can have a list of prerequisites added that will not
  2095.      show up in the value of $< but will show up in the value of
  2096.      $? and $&.  Indirect prerequisites are specified in an
  2097.      inference rule by quoting the prerequisite with single
  2098.      quotes.  For example, if you had the explicit dependency:
  2099.  
  2100.           fred.o : fred.c ; rule to make fred.o
  2101.           fred.o : local.h
  2102.  
  2103.      then this can be infered for fred.o from the following
  2104.      inference rule:
  2105.  
  2106.           %.o : %.c 'local.h' ; rule to make a .o from a .c
  2107.  
  2108.      You may infer indirect prerequisites that are a function of
  2109.  
  2110.  
  2111.  
  2112. Version 3.50                    UW                             33
  2113.  
  2114.  
  2115.  
  2116.  
  2117. DMAKE(p)               Unsupported Software               DMAKE(p)
  2118.  
  2119.  
  2120.  
  2121.      the value of '%' in the current rule.  The meta-rule:
  2122.  
  2123.           %.o : %.c '$(INC)/%.h' ; rule to make a .o from a .c
  2124.  
  2125.      infers an indirect prerequisite found in the INC directory
  2126.      whose name is the same as the expansion of $(INC), and the
  2127.      prerequisite name depends on the base name of the current
  2128.      target.  The set of indirect prerequisites is attached to
  2129.      the meta rule in which they are specified and are inferred
  2130.      only if the rule is used to infer a recipe for a target.
  2131.      They do not play an active role in driving the inference
  2132.      algorithm.  The construct:
  2133.  
  2134.           %.o : %.c %.f 'local.h'; recipe
  2135.  
  2136.      is equivalent to:
  2137.  
  2138.           %.o : %.c 'local.h' : recipe
  2139.           %.o : %.f 'local.h' : recipe
  2140.  
  2141.  
  2142.      If any of the attributes .SETDIR, .EPILOG, .PROLOG, .SILENT,
  2143.      .USESHELL, .SWAP, .PRECIOUS, .LIBRARY, and .IGNORE are given
  2144.      for a %-rule then when that rule is bound to a target as the
  2145.      result of an inference, the target's set of attributes is
  2146.      augmented by the attributes from the above set that are
  2147.      specified in the bound %-rule.  Other attributes specified
  2148.      for %-meta rules are not inherited by the target.  The .SET-
  2149.      DIR attribute is treated in a special way.  If the target
  2150.      already had a .SETDIR attribute set and the bound %-rule
  2151.      also specified a .SETDIR attribute then the one originally
  2152.      specified with the target prevails.  During inference any
  2153.      .SETDIR attributes for the inferred prerequisite are
  2154.      honored.  The directories must exist for a %-meta rule to be
  2155.      selected as a possible inference path.  If the directories
  2156.      do not exist no error message is issued, instead the
  2157.      corresponding path in the inference graph is simply
  2158.      rejected.
  2159.  
  2160.      ddmmaakkee also supports the old format special target
  2161.      .<suffix>.<suffix> by identifying any rules of this form and
  2162.      mapping them to the appropriate %-rule.  So for example if
  2163.      an old makefile contains the construct:
  2164.  
  2165.           .c.o :; cc -c $< -o $@
  2166.  
  2167.      ddmmaakkee maps this into the following %-rule:
  2168.  
  2169.           %.o : %.c; cc -c $< -o $@
  2170.  
  2171.      Furthermore, ddmmaakkee understands several SYSV AUGMAKE special
  2172.      targets and maps them into corresponding %-meta rules.
  2173.  
  2174.  
  2175.  
  2176. Version 3.50                    UW                             34
  2177.  
  2178.  
  2179.  
  2180.  
  2181. DMAKE(p)               Unsupported Software               DMAKE(p)
  2182.  
  2183.  
  2184.  
  2185.      These transformation must be enabled by providing the -A
  2186.      flag on the command line or by setting the value of AUGMAKE
  2187.      to non NULL.  The construct
  2188.  
  2189.           .suff :; recipe
  2190.  
  2191.      gets mapped into:
  2192.  
  2193.           % : %.suff; recipe
  2194.  
  2195.      and the construct
  2196.  
  2197.           .c~.o :; recipe
  2198.  
  2199.      gets mapped into:
  2200.  
  2201.           %.o : s.%.c ; recipe
  2202.  
  2203.      In general, a special target of the form .<str>~ is replaced
  2204.      by the %-rule construct s.%.<str>, thereby providing support
  2205.      for the syntax used by SYSV AUGMAKE for providing SCCS sup-
  2206.      port.  When enabled, these mappings allow processing of
  2207.      existing SYSV makefiles without modifications.
  2208.  
  2209.      ddmmaakkee bases all of it's inferences on the inference graph
  2210.      constructed from the %-rules defined in the makefile.  It
  2211.      knows exactly which targets can be made from which prere-
  2212.      quisites by making queries on the inference graph.  For this
  2213.      reason .SUFFIXES is not needed and is completely ignored.
  2214.  
  2215.      For a %-meta rule to be inferred as the rule whose recipe
  2216.      will be used to make a target, the target's name must match
  2217.      the %-target pattern, and any inferred %-prerequisite must
  2218.      already exist or have an explicit recipe so that the prere-
  2219.      quisite can be made.  Without _t_r_a_n_s_i_t_i_v_e _c_l_o_s_u_r_e on the
  2220.      inference graph the above rule describes precisely when an
  2221.      inference match terminates the search.  If transitive clo-
  2222.      sure is enabled (the usual case), and a prerequisite does
  2223.      not exist or cannot be made, then ddmmaakkee invokes the infer-
  2224.      ence algorithm recursively on the prerequisite to see if
  2225.      there is some way the prerequisite can be manufactured.  For
  2226.      if the prerequisite can be made then the current target can
  2227.      also be made using the current %-meta rule.  This means that
  2228.      there is no longer a need to give a rule for making a .o
  2229.      from a .y if you have already given a rule for making a .o
  2230.      from a .c and a .c from a .y.  In such cases ddmmaakkee can infer
  2231.      how to make the .o from the .y via the intermediary .c and
  2232.      will remove the .c when the .o is made.  Transitive closure
  2233.      can be disabled by giving the -T switch on the command line.
  2234.  
  2235.      A word of caution.  ddmmaakkee bases its transitive closure on
  2236.      the %-meta rule targets.  When it performs transitive
  2237.  
  2238.  
  2239.  
  2240. Version 3.50                    UW                             35
  2241.  
  2242.  
  2243.  
  2244.  
  2245. DMAKE(p)               Unsupported Software               DMAKE(p)
  2246.  
  2247.  
  2248.  
  2249.      closure it infers how to make a target from a prerequisite
  2250.      by performing a pattern match as if the potential prere-
  2251.      quisite were a new target.  The set of rules:
  2252.  
  2253.           %.o : %.c :; rule for making .o from .c
  2254.           %.c : %.y :; rule for making .c from .y
  2255.           % : RCS/%,v :; check out of RCS file
  2256.  
  2257.      will, by performing transitive closure, allow ddmmaakkee to infer
  2258.      how to make a .o from a .y using a .c as an intermediate
  2259.      temporary file.  Additionally it will be able to infer how
  2260.      to make a .y from an RCS file, as long as that RCS file is
  2261.      in the RCS directory and has a name which ends in .y,v.  The
  2262.      transitivity computation is performed dynamically for each
  2263.      target that does not have a recipe.  This has potential to
  2264.      be very slow if the %-meta rules are not carefully speci-
  2265.      fied.  The .NOINFER attribute is used to mark a %-meta node
  2266.      as being a final target during inference.  Any node with
  2267.      this attribute set will not be used for subsequent infer-
  2268.      ences.  As an example the node RCS/%,v is marked as a final
  2269.      node since we know that if the RCS file does not exist there
  2270.      likely is no other way to make it.  Thus the standard
  2271.      startup makefile contains the entry:
  2272.           .NOINFER : RCS/%,v
  2273.      Thereby indicating that the RCS file is the end of the
  2274.      inference chain.
  2275.  
  2276.      ddmmaakkee tries to remove intermediate files resulting from
  2277.      transitive closure if the file is not marked as being PRE-
  2278.      CIOUS, or the --uu flag was not given on the command line, and
  2279.      if the inferred intermediate did not previously exist.
  2280.      Intermediate targets that existed prior to being made are
  2281.      never removed.  This is in keeping with the philosophy that
  2282.      ddmmaakkee should never remove things from the file system that
  2283.      it did not add.  If the special target .REMOVE is defined
  2284.      and has a recipe then ddmmaakkee constructs a list of the inter-
  2285.      mediate files to be removed and makes them prerequisites of
  2286.      .REMOVE.  It then makes .REMOVE thereby removing the prere-
  2287.      quisites if the recipe of .REMOVE says to.  Typically
  2288.      .REMOVE is defined in the startup file as:
  2289.  
  2290.           ".REMOVE :; $(RM) $<".
  2291.  
  2292. MMAAKKIINNGG TTAARRGGEETTSS
  2293.      In order to update a target ddmmaakkee must execute a recipe.
  2294.      When a recipe needs to be executed it is first expanded so
  2295.      that any macros in the recipe text are expanded, and it is
  2296.      then either executed directly or passed to a shell.  ddmmaakkee
  2297.      supports two types of recipes.  The regular recipes and
  2298.      group recipes.
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304. Version 3.50                    UW                             36
  2305.  
  2306.  
  2307.  
  2308.  
  2309. DMAKE(p)               Unsupported Software               DMAKE(p)
  2310.  
  2311.  
  2312.  
  2313.      When a regular recipe is invoked ddmmaakkee executes each line of
  2314.      the recipe separately using a new copy of a shell if a shell
  2315.      is required.  Thus effects of commands do not generally per-
  2316.      sist across recipe lines.  (e.g. cd requests in a recipe
  2317.      line do not carry over to the next recipe line) The decision
  2318.      on whether a shell is required to execute a command is based
  2319.      on the value of the macro SHELLMETAS or on the specification
  2320.      of '+' or .USESHELL for the current recipe or target respec-
  2321.      tively.  If any character in the value of SHELLMETAS is
  2322.      found in the expanded recipe text-line or the use of a shell
  2323.      is requested explicitly via '+' or .USESHELL then the com-
  2324.      mand is executed using a shell, otherwise the command is
  2325.      executed directly.  The shell that is used for execution is
  2326.      given by the value of the macro SHELL.  The flags that are
  2327.      passed to the shell are given by the value of SHELLFLAGS.
  2328.      Thus ddmmaakkee constructs the command line:
  2329.  
  2330.           $(SHELL) $(SHELLFLAGS) $(expanded_recipe_command)
  2331.  
  2332.      Normally ddmmaakkee writes the command line that it is about to
  2333.      invoke to standard output.  If the .SILENT attribute is set
  2334.      for the target or for the recipe line (via @), then the
  2335.      recipe line is not echoed.
  2336.  
  2337.      Group recipe processing is similar to that of regular
  2338.      recipes, except that a shell is always invoked.  The shell
  2339.      that is invoked is given by the value of the macro GROUP-
  2340.      SHELL, and its flags are taken from the value of the macro
  2341.      GROUPFLAGS.  If a target has the .PROLOG attribute set then
  2342.      ddmmaakkee prepends to the shell script the recipe associated
  2343.      with the special target .GROUPPROLOG, and if the attribute
  2344.      .EPILOG is set as well, then the recipe associated with the
  2345.      special target .GROUPEPILOG is appended to the script file.
  2346.      This facility can be used to always prepend a common header
  2347.      and common trailer to group recipes.  Group recipes are
  2348.      echoed to standard output just like standard recipes, but
  2349.      are enclosed by lines beginning with [ and ].
  2350.  
  2351. MMAAKKIINNGG LLIIBBRRAARRIIEESS
  2352.      Libraries are easy to maintain using ddmmaakkee.  A library is a
  2353.      file containing a collection of object files.  Thus to make
  2354.      a library you simply specify it as a target with the
  2355.      .LIBRARY attribute set and specify its list of prere-
  2356.      quisites.  The prerequisites should be the object members
  2357.      that are to go into the library.  When ddmmaakkee makes the
  2358.      library target it uses the .LIBRARY attribute to pass to the
  2359.      prerequisites the .LIBMEMBER attribute and the name of the
  2360.      library.  This enables the file binding mechanism to look
  2361.      for the member in the library if an appropriate object file
  2362.      cannot be found. A small example best illustrates this.
  2363.  
  2364.           mylib.a .LIBRARY : mem1.o mem2.o mem3.o
  2365.  
  2366.  
  2367.  
  2368. Version 3.50                    UW                             37
  2369.  
  2370.  
  2371.  
  2372.  
  2373. DMAKE(p)               Unsupported Software               DMAKE(p)
  2374.  
  2375.  
  2376.  
  2377.                rules for making library...
  2378.                # remember to remove .o's when lib is made
  2379.  
  2380.           # equivalent to:  '%.o : %.c ; ...'
  2381.           .c.o :; rules for making .o from .c say
  2382.  
  2383.      ddmmaakkee will use the .c.o rule for making the library members
  2384.      if appropriate .c files can be found using the search rules.
  2385.      NOTE:  this is not specific in any way to C programs, they
  2386.      are simply used as an example.
  2387.  
  2388.      ddmmaakkee tries to handle the old library construct format in a
  2389.      sensible way.  The construct _l_i_b_(_m_e_m_b_e_r_._o_) is separated and
  2390.      the _l_i_b portion is declared as a library target.  The new
  2391.      target is defined with the .LIBRARY attribute set and the
  2392.      _m_e_m_b_e_r_._o portion of the construct is declared as a prere-
  2393.      quisite of the lib target.  If the construct _l_i_b_(_m_e_m_b_e_r_._o_)
  2394.      appears as a prerequisite of a target in the makefile, that
  2395.      target has the new name of the lib assigned as it's prere-
  2396.      quisite.  Thus the following example:
  2397.  
  2398.           a.out : ml.a(a.o) ml.a(b.o); $(CC) -o $@  $<
  2399.  
  2400.           .c.o :; $(CC) -c $(CFLAGS) -o $@  $<
  2401.           %.a:
  2402.                ar rv $@ $<
  2403.                ranlib $@
  2404.                rm -rf $<
  2405.  
  2406.      constructs the following dependency graph.
  2407.  
  2408.           a.out : ml.a; $(CC) -o $@  $<
  2409.           ml.a .LIBRARY : a.o b.o
  2410.  
  2411.           %.o : %.c ; $(CC) -c $(CFLAGS) -o $@  $<
  2412.           %.a :
  2413.                ar rv $@ $<
  2414.                ranlib $@
  2415.                rm -rf $<
  2416.  
  2417.      and making a.out then works as expected.
  2418.  
  2419.      The same thing happens for any target of the form
  2420.      _l_i_b_(_(_e_n_t_r_y_)_).  These targets have an additional feature in
  2421.      that the _e_n_t_r_y target has the .SYMBOL attribute set automat-
  2422.      ically.
  2423.  
  2424.      NOTE:  If the notion of entry points is supported by the
  2425.      archive and by ddmmaakkee (currently not the case) then ddmmaakkee
  2426.      will search the archive for the entry point and return not
  2427.      only the modification time of the member which defines the
  2428.      entry but also the name of the member file.  This name will
  2429.  
  2430.  
  2431.  
  2432. Version 3.50                    UW                             38
  2433.  
  2434.  
  2435.  
  2436.  
  2437. DMAKE(p)               Unsupported Software               DMAKE(p)
  2438.  
  2439.  
  2440.  
  2441.      then replace _e_n_t_r_y and will be used for making the member
  2442.      file.  Once bound to an archive member the .SYMBOL attribute
  2443.      is removed from the target.  This feature is presently dis-
  2444.      abled as there is little standardization among archive for-
  2445.      mats, and we have yet to find a makefile utilizing this
  2446.      feature (possibly due to the fact that it is unimplemented
  2447.      in most versions of UNIX Make).
  2448.  
  2449. MMUULLTTII PPRROOCCEESSSSIINNGG
  2450.      If the architecture supports it then ddmmaakkee is capable of
  2451.      making a target's prerequisites in parallel.  ddmmaakkee will
  2452.      make as much in parallel as it can and use a number of child
  2453.      processes up to the maximum specified by MAXPROCESS or by
  2454.      the value supplied to the -P command line flag.  A parallel
  2455.      make is enabled by setting the value of MAXPROCESS (either
  2456.      directly or via -P option) to a value which is > 1.  ddmmaakkee
  2457.      guarantees that all dependencies as specified in the
  2458.      makefile are honored.  A target will not be made until all
  2459.      of its prerequisites have been made.  If a parallel make is
  2460.      being performed then the following restrictions on parallel-
  2461.      ism are enforced.
  2462.  
  2463.           1.   Individual recipe lines in a non-group recipe are
  2464.                performed sequentially in the order in which they
  2465.                are specified within the makefile and in parallel
  2466.                with the recipes of other targets.
  2467.  
  2468.           2.   If a target contains multiple recipe definitions
  2469.                (cf. :: rules) then these are performed sequen-
  2470.                tially in the order in which the :: rules are
  2471.                specified within the makefile and in parallel with
  2472.                the recipes of other targets.
  2473.  
  2474.           3.   If a target rule contains the `!' modifier, then
  2475.                the recipe is performed sequentially for the list
  2476.                of outdated prerequisites and in parallel with the
  2477.                recipes of other targets.
  2478.  
  2479.           4.   If a target has the .SEQUENTIAL attribute set then
  2480.                all of its prerequisites are made sequentially
  2481.                relative to one another (as if MAXPROCESS=1), but
  2482.                in parallel with other targets in the makefile.
  2483.  
  2484.      Note:  If you specify a parallel make then the order of tar-
  2485.      get update and the order in which the associated recipes are
  2486.      invoked will not correspond to that displayed by the -n
  2487.      flag.
  2488.  
  2489. CCOONNDDIITTIIOONNAALLSS
  2490.      ddmmaakkee supports a makefile construct called a _c_o_n_d_i_t_i_o_n_a_l.
  2491.      It allows the user to conditionally select portions of
  2492.      makefile text for input processing and to discard other
  2493.  
  2494.  
  2495.  
  2496. Version 3.50                    UW                             39
  2497.  
  2498.  
  2499.  
  2500.  
  2501. DMAKE(p)               Unsupported Software               DMAKE(p)
  2502.  
  2503.  
  2504.  
  2505.      portions.  This becomes useful for writing makefiles that
  2506.      are intended to function for more than one target host and
  2507.      environment.  The conditional expression is specified as
  2508.      follows:
  2509.  
  2510.           .IF  _e_x_p_r_e_s_s_i_o_n
  2511.              ... if text ...
  2512.           .ELSE
  2513.              ... else text ...
  2514.           .END
  2515.  
  2516.      The .ELSE portion is optional, and the conditionals may be
  2517.      nested (ie.  the text may contain another conditional).
  2518.      .IF, .ELSE, and .END may appear anywhere in the makefile,
  2519.      but a single conditional expression may not span multiple
  2520.      makefiles.
  2521.  
  2522.      _e_x_p_r_e_s_s_i_o_n can be one of the following three forms:
  2523.  
  2524.           <text> | <text> == <text> | <text> != <text>
  2525.  
  2526.      where _t_e_x_t is either text or a macro expression.  In any
  2527.      case, before the comparison is made, the expression is
  2528.      expanded.  The text portions are then selected and compared.
  2529.      White space at the start and end of the text portion is dis-
  2530.      carded before the comparison.  This means that a macro that
  2531.      evaluates to nothing but white space is considered a NULL
  2532.      value for the purpose of the comparison.  In the first case
  2533.      the expression evaluates TRUE if the text is not NULL other-
  2534.      wise it evaluates FALSE.  The remaining two cases both
  2535.      evaluate the expression on the basis of a string comparison.
  2536.      If a macro expression needs to be equated to a NULL string
  2537.      then compare it to the value of the macro $(NULL).
  2538.  
  2539. EEXXAAMMPPLLEESS
  2540.           # A simple example showing how to use make
  2541.           #
  2542.           prgm : a.o b.o
  2543.                cc a.o b.o -o prgm
  2544.           a.o : a.c g.h
  2545.                cc a.c -o $@
  2546.           b.o : b.c g.h
  2547.                cc b.c -o $@
  2548.  
  2549.      In the previous example prgm is remade only if a.o and/or
  2550.      b.o is out of date with respect to prgm.  These dependencies
  2551.      can be stated more concisely by using the inference rules
  2552.      defined in the standard startup file.  The default rule for
  2553.      making .o's from .c's looks something like this:
  2554.  
  2555.           %.o : %.c; cc -c $(CFLAGS) -o $@ $<
  2556.  
  2557.  
  2558.  
  2559.  
  2560. Version 3.50                    UW                             40
  2561.  
  2562.  
  2563.  
  2564.  
  2565. DMAKE(p)               Unsupported Software               DMAKE(p)
  2566.  
  2567.  
  2568.  
  2569.      Since there exists a rule (defined in the startup file) for
  2570.      making .o's from .c's ddmmaakkee will use that rule for manufac-
  2571.      turing a .o from a .c and we can specify our dependencies
  2572.      more concisely.
  2573.  
  2574.           prgm : a.o b.o
  2575.                cc -o prgm $<
  2576.           a.o b.o : g.h
  2577.  
  2578.      A more general way to say the above using the new macro
  2579.      expansions would be:
  2580.  
  2581.           SRC = a b
  2582.           OBJ = {$(SRC)}.o
  2583.  
  2584.           prgm : $(OBJ)
  2585.                cc -o $@ $<
  2586.  
  2587.           $(OBJ) : g.h
  2588.  
  2589.      If we want to keep the objects in a separate directory,
  2590.      called objdir, then we would write something like this.
  2591.  
  2592.           SRC = a b
  2593.           OBJ = {$(SRC)}.o
  2594.  
  2595.           prgm : $(OBJ)
  2596.                cc $< -o $@
  2597.  
  2598.           $(OBJ) : g.h
  2599.           %.o : %.c
  2600.                $(CC) -c $(CFLAGS) -o $(@:f) $<
  2601.                mv $(@:f) objdir
  2602.  
  2603.           .SOURCE.o : objdir       # tell make to look here for .o's
  2604.  
  2605.      An example of building library members would go something
  2606.      like this: (NOTE:  The same rules as above will be used to
  2607.      produce .o's from .c's)
  2608.  
  2609.           SRC  = a b
  2610.           LIB  = lib
  2611.           LIBm = { $(SRC) }.o
  2612.  
  2613.           prgm: $(LIB)
  2614.                cc -o $@ $(LIB)
  2615.  
  2616.           $(LIB) .LIBRARY : $(LIBm)
  2617.                ar rv $@ $<
  2618.                rm $<
  2619.  
  2620.      Finally, suppose that each of the source files in the
  2621.  
  2622.  
  2623.  
  2624. Version 3.50                    UW                             41
  2625.  
  2626.  
  2627.  
  2628.  
  2629. DMAKE(p)               Unsupported Software               DMAKE(p)
  2630.  
  2631.  
  2632.  
  2633.      previous example had the `:' character in their target name.
  2634.      Then we would write the above example as:
  2635.  
  2636.           SRC  = f:a f:b
  2637.           LIB  = lib
  2638.           LIBm = "{ $(SRC) }.o"         # put quotes around each token
  2639.  
  2640.           prgm: $(LIB)
  2641.                cc -o $@ $(LIB)
  2642.  
  2643.           $(LIB) .LIBRARY : $(LIBm)
  2644.                ar rv $@ $<
  2645.                rm $<
  2646.  
  2647. CCOOMMPPAATTIIBBIILLIITTYY
  2648.      There are two notable differences between ddmmaakkee and the
  2649.      standard version of BSD UNIX 4.2/4.3 Make.
  2650.  
  2651.           1. BSD UNIX 4.2/4.3 Make supports wild card filename
  2652.              expansion for prerequisite names.  Thus if a direc-
  2653.              tory contains a.h, b.h and c.h, then a line like
  2654.  
  2655.                   target: *.h
  2656.  
  2657.              will cause UNIX make to expand the *.h into "a.h b.h
  2658.              c.h".  ddmmaakkee does not support this type of filename
  2659.              expansion.
  2660.  
  2661.           2. Unlike UNIX make, touching a library member causes
  2662.              ddmmaakkee to search the library for the member name and
  2663.              to update the library time stamp.  This is only
  2664.              implemented in the UNIX version.  MSDOS and other
  2665.              versions may not have librarians that keep file time
  2666.              stamps, as a result ddmmaakkee touches the library file
  2667.              itself, and prints a warning.
  2668.  
  2669.      ddmmaakkee is not compatible with GNU Make.  In particular it
  2670.      does not understand GNU Make's macro expansions that query
  2671.      the file system.
  2672.  
  2673.      ddmmaakkee is fully compatible with SYSV AUGMAKE, and supports
  2674.      the following AUGMAKE features:
  2675.  
  2676.           1. The word iinncclluuddee appearing at the start of a line
  2677.              can be used instead of the ".INCLUDE :" construct
  2678.              understood by ddmmaakkee.
  2679.  
  2680.           2. The macro modifier expression $(macro:str=sub) is
  2681.              understood and is equivalent to the expression
  2682.              $(macro:s/str/sub), with the restriction that str
  2683.              must match the following regular expression:
  2684.  
  2685.  
  2686.  
  2687.  
  2688. Version 3.50                    UW                             42
  2689.  
  2690.  
  2691.  
  2692.  
  2693. DMAKE(p)               Unsupported Software               DMAKE(p)
  2694.  
  2695.  
  2696.  
  2697.                   str[ |\t][ |\t]*
  2698.  
  2699.              (ie. str only matches at the end of a token where
  2700.              str is a suffix and is terminated by a space, a tab,
  2701.              or end of line)
  2702.  
  2703.           3. The macro % is defined to be $@ (ie. $% expands to
  2704.              the same value as $@).
  2705.  
  2706.           4. The AUGMAKE notion of libraries is handled
  2707.              correctly.
  2708.  
  2709.           5. When defining special targets for the inference
  2710.              rules and the AUGMAKE special target mapping is
  2711.              enabled then the special target .X is equivalent to
  2712.              the %-rule "% : %.X".
  2713.  
  2714. LLIIMMIITTSS
  2715.      In some environments the length of an argument string is
  2716.      restricted.  (e.g. MSDOS command line arguments cannot be
  2717.      longer than 128 bytes if you are using the standard
  2718.      command.com command interpreter as your shell, ddmmaakkee text
  2719.      diversions may help in these situations.)
  2720.  
  2721. PPOORRTTAABBIILLIITTYY
  2722.      To write makefiles that can be moved from one environment to
  2723.      another requires some forethought.  In particular you must
  2724.      define as macros all those things that may be different in
  2725.      the new environment.  ddmmaakkee has two facilities that help to
  2726.      support writing portable makefiles, recursive macros and
  2727.      conditional expressions.  The recursive macros, allow one to
  2728.      define environment configurations that allow different
  2729.      environments for similar types of operating systems.  For
  2730.      example the same make script can be used for SYSV and BSD
  2731.      but with different macro definitions.
  2732.  
  2733.      To write a makefile that is portable between UNIX and MSDOS
  2734.      requires both features since in almost all cases you will
  2735.      need to define new recipes for making targets.  The recipes
  2736.      will probably be quite different since the capabilities of
  2737.      the tools on each machine are different.  Different macros
  2738.      will be needed to help handle the smaller differences in the
  2739.      two environments.
  2740.  
  2741.      NOTE:  Unlike UNIX, MSDOS ddooeess maintain cd requests cross
  2742.      single recipe lines.  This is not portable, and your
  2743.      makefiles will not work the same way if you depend on it.
  2744.      Use the .IF ... .ELSE ... .END conditionals to supply dif-
  2745.      ferent make scripts as necessary.
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752. Version 3.50                    UW                             43
  2753.  
  2754.  
  2755.  
  2756.  
  2757. DMAKE(p)               Unsupported Software               DMAKE(p)
  2758.  
  2759.  
  2760.  
  2761. FFIILLEESS
  2762.      Makefile, makefile, startup.mk (use dmake -V to tell you
  2763.      where the startup file is)
  2764.  
  2765. SSEEEE AALLSSOO
  2766.      sh(1), csh(1), touch(1), f77(1), pc(1), cc(1)
  2767.      S.I. Feldman  _M_a_k_e _- _A _P_r_o_g_r_a_m _f_o_r _M_a_i_n_t_a_i_n_i_n_g _C_o_m_p_u_t_e_r _P_r_o_-
  2768.      _g_r_a_m_s
  2769.  
  2770. AAUUTTHHOORR
  2771.      Dennis Vadura, CS Dept. University of Waterloo.
  2772.      dvadura@watdragon.uwaterloo.ca
  2773.      Many thanks to Carl Seger for his helpful suggestions, and
  2774.      to Trevor John Thompson for his many excellent ideas and
  2775.      informative bug reports.
  2776.  
  2777. BBUUGGSS
  2778.      Some system commands return non-zero status inappropriately.
  2779.      Use --ii (`-' within the makefile) to overcome the difficulty.
  2780.  
  2781.      Some systems do not have easily accessible time stamps for
  2782.      library members (MSDOS, AMIGA, etc) for these ddmmaakkee uses the
  2783.      time stamp of the library instead and prints a warning the
  2784.      first time it does so.  This is almost always ok, except
  2785.      when multiple makefiles update a single library file.  In
  2786.      these instances it is possible to miss an update if one is
  2787.      not careful.
  2788.  
  2789.  
  2790.  
  2791.  
  2792.  
  2793.  
  2794.  
  2795.  
  2796.  
  2797.  
  2798.  
  2799.  
  2800.  
  2801.  
  2802.  
  2803.  
  2804.  
  2805.  
  2806.  
  2807.  
  2808.  
  2809.  
  2810.  
  2811.  
  2812.  
  2813.  
  2814.  
  2815.  
  2816. Version 3.50                    UW                             44
  2817.