home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume15 / dmake-3.6 / part14 < prev    next >
Text File  |  1990-10-14  |  40KB  |  927 lines

  1. Newsgroups: comp.sources.misc
  2. X-UNIX-From: dvadura@watdragon.waterloo.edu
  3. subject: v15i066: dmake version 3.6 (part 14/25)
  4. from: Dennis Vadura <dvadura@watdragon.waterloo.edu>
  5. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  6.  
  7. Posting-number: Volume 15, Issue 66
  8. Submitted-by: Dennis Vadura <dvadura@watdragon.waterloo.edu>
  9. Archive-name: dmake-3.6/part14
  10.  
  11. #!/bin/sh
  12. # this is part 14 of a multipart archive
  13. # do not concatenate these parts, unpack them in order with /bin/sh
  14. # file man/dmake.p continued
  15. #
  16. CurArch=14
  17. if test ! -r s2_seq_.tmp
  18. then echo "Please unpack part 1 first!"
  19.      exit 1; fi
  20. ( read Scheck
  21.   if test "$Scheck" != $CurArch
  22.   then echo "Please unpack part $Scheck next!"
  23.        exit 1;
  24.   else exit 0; fi
  25. ) < s2_seq_.tmp || exit 1
  26. echo "x - Continuing file man/dmake.p"
  27. sed 's/^X//' << 'SHAR_EOF' >> man/dmake.p
  28. X          b.h then both recipes are invoked to make a.o.  In the
  29. X          last case the order of invocation corresponds to the
  30. X          order in which the rule definitions appear in the
  31. X          makefile.
  32. X
  33. X     Targets defined using a single `:' operator with a recipe
  34. X     may be redefined again with a new recipe by using a `:'
  35. X     operator with a `:' modifier.  This is equivalent to a tar-
  36. X     get having been initially defined with a rule using a `:'
  37. X     modifier.  Once a target is defined using a `:' modifier it
  38. X
  39. X
  40. X
  41. XVersion 3.50                    UW                             16
  42. X
  43. X
  44. X
  45. X
  46. XDMAKE(p)               Unsupported Software               DMAKE(p)
  47. X
  48. X
  49. X
  50. X     may not be defined again with a recipe using only the `:'
  51. X     operator with no `:' modifier.  In both cases the use of a
  52. X     `:' modifier creates a new list of prerequisites and makes
  53. X     it the current prerequisite list for the target.  The `:'
  54. X     operator with no recipe always modifies the current list of
  55. X     prerequisites.  Thus assuming each of the following defini-
  56. X     tions has a recipe attached, then:
  57. X
  58. X          joe :  fred ...     (1)
  59. X          joe :: more ...     (2)
  60. X
  61. X          and
  62. X
  63. X          joe :: fred ...     (3)
  64. X          joe :: more ...     (4)
  65. X
  66. X     are legal and mean:  add the recipe associated with (2), or
  67. X     (4) to the set of recipes for joe, placing them after exist-
  68. X     ing recipes for making joe.  The constructs:
  69. X
  70. X          joe :: fred ...     (5)
  71. X          joe : more ... (6)
  72. X
  73. X          and
  74. X
  75. X          joe : fred ... (7)
  76. X          joe : more ... (8)
  77. X
  78. X     are errors since we have two sets of perfectly good recipes
  79. X     for making the target.
  80. X
  81. X     _p_r_e_r_e_q_u_i_s_i_t_e_s is a possibly empty list of targets that must
  82. X     be brought up to date before making the current target.
  83. X
  84. X     _r_e_c_i_p_e is a short form and allows the user to specify short
  85. X     rule definitions on a single line.  It is taken to be the
  86. X     first recipe line in a larger recipe if additional lines
  87. X     follow the rule definition.  If the semi-colon is present
  88. X     but the recipe line is empty (ie. null string) then it is
  89. X     taken to be an empty rule.  Any target so defined causes the
  90. X     _D_o_n_'_t _k_n_o_w _h_o_w _t_o _m_a_k_e _._._. error message to be suppressed
  91. X     when ddmmaakkee tries to make the target and fails.  This silence
  92. X     is maintained for rules that are terminated by a semicolon
  93. X     and have no following recipe lines, for targets listed on
  94. X     the command line, and for the first target found in the
  95. X     makefile.
  96. X
  97. XRREECCIIPPEESS
  98. X     The traditional format used by most versions of Make defines
  99. X     the recipe lines as arbitrary strings that may contain macro
  100. X     expansions.  They follow a rule definition line and may be
  101. X     spaced apart by comment or blank lines.  The list of recipe
  102. X
  103. X
  104. X
  105. XVersion 3.50                    UW                             17
  106. X
  107. X
  108. X
  109. X
  110. XDMAKE(p)               Unsupported Software               DMAKE(p)
  111. X
  112. X
  113. X
  114. X     lines defining the recipe is terminated by a new target
  115. X     definition, a macro definition, or end-of-file.  Each recipe
  116. X     line MMUUSSTT begin with a <<TTAABB>> character which may optionally
  117. X     be followed with one or all of the characters _'_@_%_+_-_'.  The
  118. X     _'_-_' indicates that non-zero exit values (ie. errors) are to
  119. X     be ignored when this recipe line is executed, the _'_+_' indi-
  120. X     cates that the current recipe line is to be executed using
  121. X     the shell, the _'_%_' indicates that ddmmaakkee should swap itself
  122. X     out to secondary storage (MSDOS only) before running the
  123. X     recipe and the _'_@_' indicates that the recipe line should NOT
  124. X     be echoed to the terminal prior to being executed.  Each
  125. X     switch is off by default (ie. by default, errors are signi-
  126. X     ficant, commands are echoed, no swapping is done and a shell
  127. X     is used only if the recipe line contains a character found
  128. X     in the value of the SHELLMETAS macro).  Global settings
  129. X     activated via command line options or special attribute or
  130. X     target names may also affect these settings.  An example
  131. X     recipe:
  132. X
  133. X          target :
  134. X               first recipe line
  135. X               second recipe line, executed independently of the first.
  136. X               @a recipe line that is not echoed
  137. X               -and one that has errors ignored
  138. X               %and one that causes dmake to swap out
  139. X               +and one that is executed using a shell.
  140. X
  141. X     The second and new format of the recipe block begins the
  142. X     block with the character '[' (the open group character) in
  143. X     the last non-white space position of a line, and terminates
  144. X     the block with the character ']' (the close group character)
  145. X     in the first non-white space position of a line.  In this
  146. X     form each recipe line need not have a leading TAB.  This is
  147. X     called a recipe group.  Groups so defined are fed intact as
  148. X     a single unit to a shell for execution whenever the
  149. X     corresponding target needs to be updated.  If the open group
  150. X     character '[' is preceded by one or all of -, @ or % then
  151. X     they apply to the entire group in the same way that they
  152. X     apply to single recipe lines.  You may also specify '+' but
  153. X     it is redundant as a shell is already being used to run the
  154. X     recipe.  See the MAKING TARGETS section for a description of
  155. X     how ddmmaakkee invokes recipes.  Here is an example of a group
  156. X     recipe:
  157. X
  158. X          target :
  159. X          [
  160. X               first recipe line
  161. X               second recipe line
  162. X               all of these recipe lines are fed to a
  163. X               single copy of a shell for execution.
  164. X          ]
  165. X
  166. X
  167. X
  168. X
  169. XVersion 3.50                    UW                             18
  170. X
  171. X
  172. X
  173. X
  174. XDMAKE(p)               Unsupported Software               DMAKE(p)
  175. X
  176. X
  177. X
  178. XTTEEXXTT DDIIVVEERRSSIIOONNSS
  179. X     ddmmaakkee supports the notion of text diversions.  If a recipe
  180. X     line contains the macro expression
  181. X
  182. X          $(mktmp[,_n_a_m_e___m_o_d_i_f_i_e_r] _d_a_t_a)
  183. X
  184. X     then all text contained in the _d_a_t_a expression is expanded
  185. X     and is written to a new temporary file.  The name of that
  186. X     file is then returned as the value of the macro expansion
  187. X     and is substituted for the text of the macro expression if
  188. X     no _n_a_m_e___m_o_d_i_f_i_e_r is present.
  189. X
  190. X     _d_a_t_a can be any text and must be separated from the 'mktmp'
  191. X     portion of the macro name by white-space.  The only restric-
  192. X     tion on the data text is that it must contain an balanced
  193. X     number of parentheses of the same kind as are used to ini-
  194. X     tiate the $(mktmp ...) expression.  For example:
  195. X
  196. X          $(mktmp $(XXX))
  197. X
  198. X     is legal and works as expected, but:
  199. X
  200. X          $(mktmp text (to dump to file)
  201. X
  202. X     is not legal.  You can achieve what you wish by either
  203. X     defining a macro that expands to '(' or by using {} in the
  204. X     macro expression; like this:
  205. X
  206. X          ${mktmp text (to dump to file}
  207. X
  208. X     which works as expected.  Since the temporary file is opened
  209. X     when the macro containg the text diversion expression is
  210. X     expanded, diversions may now be nested and any diversions
  211. X     that are created as part of ':=' macro expansions persist
  212. X     for the duration of the ddmmaakkee run.  The diversion text may
  213. X     contain the same escape codes as those described in the MAC-
  214. X     ROS section.  Thus if the _d_a_t_a text is to contain new lines
  215. X     they must be inserted using the \n escape sequence.  For
  216. X     example the expression:
  217. X
  218. X          all:
  219. X               cat $(mktmp this is a\n\
  220. X               test of the text diversion\n)
  221. X
  222. X     is replaced by:
  223. X
  224. X          cat /tmp/mk12294AA
  225. X
  226. X     where the temporary file contains two lines both of which
  227. X     are terminated by a new-line.  If the _d_a_t_a text spans multi-
  228. X     ple lines in the makefile then each line must be continued
  229. X     via the use of a \.  A second more illustrative example
  230. X
  231. X
  232. X
  233. XVersion 3.50                    UW                             19
  234. X
  235. X
  236. X
  237. X
  238. XDMAKE(p)               Unsupported Software               DMAKE(p)
  239. X
  240. X
  241. X
  242. X     generates a response file to an MSDOS link command:
  243. X
  244. X          OBJ = fred.obj mary.obj joe.obj
  245. X          all : $(OBJ)
  246. X               link @$(mktmp $(^:t"+\n")\n)
  247. X
  248. X     The result of making `all' in the second example is the com-
  249. X     mand:
  250. X
  251. X          link @/tmp/mk02394AA
  252. X
  253. X     where the temporary file contains:
  254. X
  255. X          fred.obj+
  256. X          mary.obj+
  257. X          joe.obj
  258. X
  259. X     The last line of the file is terminated by a new-line which
  260. X     is inserted due to the \n found at the end of the _d_a_t_a
  261. X     string.
  262. X
  263. X     If the optional _n_a_m_e___m_o_d_i_f_i_e_r is supplied in the diversion
  264. X     expression then the returned value of the expression is the
  265. X     expanded value of _n_a_m_e___m_o_d_i_f_i_e_r.  Together with the special
  266. X     macros TMPFILE and USESHELL this can be used to alter the
  267. X     name of the temporary file returned as the result of the
  268. X     $(mktmp ...) expansion.
  269. X
  270. X     Under MS-DOS text diversions may be a problem.  Many DOS
  271. X     tools require that path names which contain directories use
  272. X     the \ character to delimit the directories.  Some users how-
  273. X     ever wish to use the '/' to delimit pathnames on their sys-
  274. X     tem and use environments that allow them to do so.  These
  275. X     environments usually accept the \ delimited path names as
  276. X     well.  In order to allow the user the most flexibility ddmmaakkee
  277. X     defines three macros that can be used when text diversion
  278. X     file names are being placed into the recipe text to be exe-
  279. X     cuted.  The macro TMPFILE contains the name of the most
  280. X     recently opened temporary file, and the macro, USESHELL, is
  281. X     set to "yes" if the current recipe is forced to use a shell
  282. X     via the .USESHELL or '+' directives, otherwise its value is
  283. X     "no".  In the absence of a _n_a_m_e___m_o_d_i_f_i_e_r in the diversion
  284. X     expression the result of expanding the diversion expression
  285. X     is the value of TMPFILE.  The ddmmaakkee startup files define the
  286. X     macro DIVFILE whose value is either the value of TMPFILE or
  287. X     the value of TMPFILE editted to replace any '/' characters
  288. X     to the appropriate value based on the current shell and
  289. X     whether it will be used to execute the recipe.
  290. X
  291. X     Previous versions of ddmmaakkee defined text diversions using <+,
  292. X     +> strings, where <+ started a text diversion and +> ter-
  293. X     minated one.  ddmmaakkee is backward compatible with this
  294. X
  295. X
  296. X
  297. XVersion 3.50                    UW                             20
  298. X
  299. X
  300. X
  301. X
  302. XDMAKE(p)               Unsupported Software               DMAKE(p)
  303. X
  304. X
  305. X
  306. X     construct if the <+ and +> appear literally on the same
  307. X     recipe line or in the same macro value string.  In such
  308. X     instances the expression:
  309. X
  310. X          <+data text+>
  311. X
  312. X     is mapped to:
  313. X
  314. X          $(mktmp data text)
  315. X
  316. X     which is fully output compatible with the earlier construct.
  317. X     <+, +> constructs whose text spans multiple lines must be
  318. X     converted by hand to use $(mktmp ...).
  319. X
  320. X     If the environment variable TMPDIR is defined then the tem-
  321. X     porary file is placed into the directory specified by that
  322. X     variable.  A makefile can modify the location of temporary
  323. X     files by defining a macro named TMPDIR and exporting it
  324. X     using the .EXPORT special target.
  325. X
  326. XSSPPEECCIIAALL TTAARRGGEETTSS
  327. X     This section describes the special targets that are recog-
  328. X     nized by ddmmaakkee.  Some are affected by attributes and others
  329. X     are not.
  330. X
  331. X     ..EERRRROORR        If defined then the recipe associated with
  332. X                   this target is executed whenever an error con-
  333. X                   dition is detected by ddmmaakkee.  All attributes
  334. X                   that can be used with any other target may be
  335. X                   used with this target.  Any prerequisites of
  336. X                   this target will be brought up to date during
  337. X                   it's processing.  NOTE:  errors will be
  338. X                   ignored while making this target, in extreme
  339. X                   cases this may cause some problems.
  340. X
  341. X     ..EEXXPPOORRTT       All prerequisites associated with this target
  342. X                   are assumed to correspond to macro names and
  343. X                   they and their values are exported to the
  344. X                   environment as environment strings at the
  345. X                   point in the makefile at which this target
  346. X                   appears.  Any attributes specified with this
  347. X                   target are ignored.  Only macros which have
  348. X                   been assigned a value in the makefile prior to
  349. X                   the export directive are exported, macros as
  350. X                   yet undefined are not exported.
  351. X
  352. X     ..IIMMPPOORRTT       Prerequisite names specified for this target
  353. X                   are searched for in the environment and
  354. X                   defined as macros with their value taken from
  355. X                   the environment.  If the name cannot be found
  356. X                   in the environment an error message is issued.
  357. X                   .IMPORT accepts the .IGNORE attribute.  When
  358. X
  359. X
  360. X
  361. XVersion 3.50                    UW                             21
  362. X
  363. X
  364. X
  365. X
  366. XDMAKE(p)               Unsupported Software               DMAKE(p)
  367. X
  368. X
  369. X
  370. X                   given, it causes ddmmaakkee to ignore the above
  371. X                   error.  See the MACROS section for a descrip-
  372. X                   tion of the processing of imported macro
  373. X                   values.
  374. X
  375. X     ..IINNCCLLUUDDEE      Parse another makefile just as if it had been
  376. X                   located at the point of the .INCLUDE in the
  377. X                   current makefile.  The list of prerequisites
  378. X                   gives the list of makefiles to try to read.
  379. X                   If the list contains multiple makefiles then
  380. X                   they are read in order from left to right.
  381. X                   The following search rules are used when try-
  382. X                   ing to locate the file.  If the filename is
  383. X                   surrounded by " or just by itself then it is
  384. X                   searched for in the current directory.  If it
  385. X                   is not found it is then searched for in each
  386. X                   of the directories specified for the .INCLU-
  387. X                   DEDIRS special target.  If the file name is
  388. X                   surrounded by < and >, (ie.
  389. X                   <my_spiffy_new_makefile>) then it is searched
  390. X                   for only in the directories given by the
  391. X                   .INCLUDEDIRS special target.  In both cases if
  392. X                   the file name is a fully qualified name start-
  393. X                   ing at the root of the file system then it is
  394. X                   only searched for once, and the .INCLUDEDIRS
  395. X                   list is ignored.  .INCLUDE accepts the .IGNORE
  396. X                   and .SETDIR attributes.  If .IGNORE attribute
  397. X                   is given and the file cannot be found then
  398. X                   ddmmaakkee continues processing, otherwise an error
  399. X                   message is generated.  The .SETDIR attribute
  400. X                   causes ddmmaakkee to change directories to the
  401. X                   specified directory prior to attempting the
  402. X                   include operation.
  403. X
  404. X     ..IINNCCLLUUDDEEDDIIRRSS  The list of prerequisites specified for this
  405. X                   target defines the set of directories to
  406. X                   search when trying to include a makefile.
  407. X
  408. X     ..MMAAKKEEFFIILLEESS    The list of prerequisites is the set of files
  409. X                   to try to read as the default makefile.  By
  410. X                   default this target is defined as:
  411. X
  412. X                        .MAKEFILES : makefile.mk Makefile
  413. X                   makefile
  414. X
  415. X
  416. X     ..SSOOUURRCCEE       The prerequisite list of this target defines a
  417. X                   set of directories to check when trying to
  418. X                   locate a target file name.  See the section on
  419. X                   BINDING of targets for more information.
  420. X
  421. X
  422. X
  423. X
  424. X
  425. XVersion 3.50                    UW                             22
  426. X
  427. X
  428. X
  429. X
  430. XDMAKE(p)               Unsupported Software               DMAKE(p)
  431. X
  432. X
  433. X
  434. X     ..SSOOUURRCCEE..ssuuffff  The same as .SOURCE, except that the
  435. X                   .SOURCE.suff list is searched first when try-
  436. X                   ing to locate a file matching the a target
  437. X                   whose name ends in the suffix .suff.
  438. X
  439. X     ..RREEMMOOVVEE       The recipe of this target is used whenever
  440. X                   ddmmaakkee needs to remove intermediate targets
  441. X                   that were made but do not need to be kept
  442. X                   around.  Such targets result from the applica-
  443. X                   tion of transitive closure on the dependency
  444. X                   graph.
  445. X
  446. X     In addition to the special targets above, several other
  447. X     forms of targets are recognized and are considered special,
  448. X     their exact form and use is defined in the sections that
  449. X     follow.
  450. X
  451. XSSPPEECCIIAALL MMAACCRROOSS
  452. X     ddmmaakkee defines a number of special macros.  They are divided
  453. X     into three classes: control macros, run-time macros, and
  454. X     function macros.  The control macros are used by ddmmaakkee to
  455. X     configure it's actions, and are the preferred method of
  456. X     doing so.  In the case when a control macro has the same
  457. X     function as a special target or attribute they share the
  458. X     same name as the special target or attribute.  The run-time
  459. X     macros are defined when ddmmaakkee makes targets and may be used
  460. X     by the user inside recipes.  The function macros provide
  461. X     higher level functions dealing with macro expansion and
  462. X     diversion file processing.
  463. X
  464. XCCOONNTTRROOLL MMAACCRROOSS
  465. X     To use the control macros simply assign them a value just
  466. X     like any other macro.  The control macros are divided into
  467. X     three groups: string valued macros, character valued macros,
  468. X     and boolean valued macros.
  469. X
  470. X     The following are all of the string valued macros.  This
  471. X     list is divided into two groups.  The first group gives the
  472. X     string valued macros that are defined internally and cannot
  473. X     be directly set by the user.
  474. X
  475. X     DDIIRRBBRRKKSSTTRR     Contains the string of chars used to terminate
  476. X                   the name of a directory in a pathname.  Under
  477. X                   UNIX it's value is "/", under MSDOS it's value
  478. X                   is "/\:".
  479. X
  480. X     IINNCCDDEEPPTTHH      This macro's value is a string of digits
  481. X                   representing the current depth of makefile
  482. X                   inclusion.  In the first makefile level this
  483. X                   value is zero.
  484. X
  485. X
  486. X
  487. X
  488. X
  489. XVersion 3.50                    UW                             23
  490. X
  491. X
  492. X
  493. X
  494. XDMAKE(p)               Unsupported Software               DMAKE(p)
  495. X
  496. X
  497. X
  498. X     MMFFLLAAGGSS        Is the list of flags that were given on the
  499. X                   command line including a leading switch char-
  500. X                   acter.  The -f flag is not included in this
  501. X                   list.
  502. X
  503. X     MMAAKKEECCMMDD       Is the name with which ddmmaakkee was invoked.
  504. X
  505. X     MMAAKKEEDDIIRR       Is the full path to the initial directory in
  506. X                   which ddmmaakkee was invoked.
  507. X
  508. X     MMAAKKEEFFIILLEE      Contains the string "-f _m_a_k_e_f_i_l_e" where,
  509. X                   _m_a_k_e_f_i_l_e is the name of initial user makefile
  510. X                   that was first read.
  511. X
  512. X     MMAAKKEEFFLLAAGGSS     Is the same as $(MFLAGS) but has no leading
  513. X                   switch character. (ie. MFLAGS = -$(MAKEFLAGS))
  514. X
  515. X     MMAAKKEEMMAACCRROOSS    Contains the complete list of macro expres-
  516. X                   sions that were specified on the command line.
  517. X
  518. X     MMAAKKEETTAARRGGEETTSS   Contains the name(s) of the target(s), if any,
  519. X                   that were specified on the command line.
  520. X
  521. X     MMAAXXPPRROOCCEESSSSLLIIMMIITT
  522. X                   Is a numeric string representing the maximum
  523. X                   number of processes that ddmmaakkee can use when
  524. X                   making targets using parallel mode.
  525. X
  526. X     NNUULLLL          Is permanently defined to be the NULL string.
  527. X                   This is useful when comparing a conditional
  528. X                   expression to an NULL value.
  529. X
  530. X     PPWWDD           Is the full path to the current directory in
  531. X                   which make is executing.
  532. X
  533. X     TTMMPPFFIILLEE       Is set to the name of the most recent tem-
  534. X                   porary file opened by ddmmaakkee.  Temporary files
  535. X                   are used for text diversions and for group
  536. X                   recipe processing.
  537. X
  538. X     TTMMDD           Stands for "To Make Dir", and is the path from
  539. X                   the present directory (value of $(PWD)) to the
  540. X                   directory that ddmmaakkee was started up in (value
  541. X                   of $(MAKEDIR)).  This macro is modified when
  542. X                   .SETDIR attributes are processed.
  543. X
  544. X     UUSSEESSHHEELLLL      The value of this macro is set to "yes" if the
  545. X                   current recipe is forced to use a shell for
  546. X                   its execution via the .USESHELL or '+' direc-
  547. X                   tives, its value is "no" otherwise.
  548. X
  549. X
  550. X
  551. X
  552. X
  553. XVersion 3.50                    UW                             24
  554. X
  555. X
  556. X
  557. X
  558. XDMAKE(p)               Unsupported Software               DMAKE(p)
  559. X
  560. X
  561. X
  562. X     The second group of string valued macros control ddmmaakkee
  563. X     behavior and may be set by the user.
  564. X
  565. X     ..SSEETTDDIIRR         If this macro is assigned a value then ddmmaakkee
  566. X                     will change to the directory given by that
  567. X                     value before making any targets.  This macro
  568. X                     is equivalent to the .SETDIR attribute.
  569. X                     Thus the two lines:
  570. X
  571. X                     .SETDIR=fred/hello :
  572. X
  573. X                     .SETDIR := fred/hello
  574. X
  575. X                     are completely equivalent.  The difference
  576. X                     being that the first is processed as a rule
  577. X                     definition and the other as a macro.
  578. X
  579. X     AAUUGGMMAAKKEE         If set to a non NULL value will enable the
  580. X                     transformation of special meta targets to
  581. X                     support special AUGMAKE inferences.
  582. X
  583. X     DDIIRRSSEEPPSSTTRR       Contains the string that is used to separate
  584. X                     directory components when path names are
  585. X                     constructed.  It is defined with a default
  586. X                     value at startup.
  587. X
  588. X     DDIIVVFFIILLEE         Is defined in the startup file and gives the
  589. X                     name that should be used for the diversion
  590. X                     file name when specified as the name modif-
  591. X                     ier in $(mktmp ...) expansions, see the TEXT
  592. X                     DIVERSION section for details.
  593. X
  594. X     GGRROOUUPPFFLLAAGGSS      This macro gives the set of flags to pass to
  595. X                     the shell when invoking it to execute a
  596. X                     group recipe.  The value of the macro is the
  597. X                     list of flags with a leading switch indica-
  598. X                     tor.  (ie. `-' under UNIX)
  599. X
  600. X     GGRROOUUPPSSHHEELLLL      This macro defines the full path to the exe-
  601. X                     cutable image to be used as the shell when
  602. X                     processing group recipes.  This macro must
  603. X                     be defined if group recipes are used.  It is
  604. X                     assigned a default value in the startup
  605. X                     makefile.  Under UNIX this value is /bin/sh.
  606. X
  607. X     GGRROOUUPPSSUUFFFFIIXX     If defined, this macro gives the string to
  608. X                     use as a suffix when creating group recipe
  609. X                     files to be handed to the command inter-
  610. X                     preter.  For example, if it is defined as
  611. X                     .sh, then all temporary files created by
  612. X                     ddmmaakkee will end in the suffix .sh.  Under
  613. X                     MSDOS if you are using command.com as your
  614. X
  615. X
  616. X
  617. XVersion 3.50                    UW                             25
  618. X
  619. X
  620. X
  621. X
  622. XDMAKE(p)               Unsupported Software               DMAKE(p)
  623. X
  624. X
  625. X
  626. X                     GROUPSHELL, then this suffix must be set to
  627. X                     .bat in order for group recipes to function
  628. X                     correctly.
  629. X
  630. X     MMAAKKEE            Is defined in the startup file by default.
  631. X                     The string $(MAKE) is recognized when using
  632. X                     the -n option for single line recipes.  Ini-
  633. X                     tially this macro is defined to have the
  634. X                     value "$(MAKECMD) $(MFLAGS)".
  635. X
  636. X     MMAAKKEESSTTAARRTTUUPP     This macro defines the full path to the ini-
  637. X                     tial startup makefile.  Use the --VV command
  638. X                     line option to discover it's initial value.
  639. X
  640. X     MMAAXXLLIINNEELLEENNGGTTHH   This macro defines the maximum size of a
  641. X                     single line of makefile input text.  The
  642. X                     size is specified as a number, the default
  643. X                     value is defined internally and is shown via
  644. X                     the --VV option.  A buffer of this size plus 2
  645. X                     is allocated for reading makefile text.  The
  646. X                     buffer is freed before any targets are made,
  647. X                     thereby allowing files containing long input
  648. X                     lines to be processed without consuming
  649. X                     memory during the actual make.
  650. X
  651. X     MMAAXXPPRROOCCEESSSS      Specify the maximum number of child
  652. X                     processes to use when making targets.  The
  653. X                     default value of this macro is "1" and it's
  654. X                     value cannot exceed the value of the macro
  655. X                     MAXPROCESSLIMIT.  Setting the value of MAX-
  656. X                     PROCESS on the command line or in the
  657. X                     makefile is equivalent to supplying a
  658. X                     corresponding value to the -P flag on the
  659. X                     command line.
  660. X
  661. X     PPRREEPP            This macro defines the number of iterations
  662. X                     to be expanded automatically when processing
  663. X                     % rule definitions of the form:
  664. X
  665. X                     % : %.suff
  666. X
  667. X                     See the sections on PERCENT(%) RULES for
  668. X                     details on how PREP is used.
  669. X
  670. X     SSHHEELLLL           This macro defines the full path to the exe-
  671. X                     cutable image to be used as the shell when
  672. X                     processing single line recipes.  This macro
  673. X                     must be defined if recipes requiring the
  674. X                     shell for execution are to be used.  It is
  675. X                     assigned a default value in the startup
  676. X                     makefile.  Under UNIX this value is /bin/sh.
  677. X
  678. X
  679. X
  680. X
  681. XVersion 3.50                    UW                             26
  682. X
  683. X
  684. X
  685. X
  686. XDMAKE(p)               Unsupported Software               DMAKE(p)
  687. X
  688. X
  689. X
  690. X     SSHHEELLLLFFLLAAGGSS      This macro gives the set of flags to pass to
  691. X                     the shell when invoking it to execute a sin-
  692. X                     gle line recipe.  The value of the macro is
  693. X                     the list of flags with a leading switch
  694. X                     indicator.  (ie. `-' under UNIX)
  695. X
  696. X     SSHHEELLLLMMEETTAASS      Each time ddmmaakkee executes a single recipe
  697. X                     line (not a group recipe) the line is
  698. X                     searched for any occurrence of a character
  699. X                     defined in the value of SHELLMETAS.  If such
  700. X                     a character is found the recipe line is
  701. X                     defined to require a shell to ensure it's
  702. X                     correct execution.  In such instances a
  703. X                     shell is used to invoke the recipe line.  If
  704. X                     no match is found the recipe line is exe-
  705. X                     cuted without the use of a shell.
  706. X
  707. X
  708. X     There is only one character valued macro defined by ddmmaakkee:
  709. X     SSWWIITTCCHHAARR contains the switch character used to introduce
  710. X     options on command lines.  On UNIX it's value is '-', on
  711. X     MSDOS it's value may be '/' or '-'.  The macro is internally
  712. X     defined and is not user setable.  The MSDOS version of ddmmaakkee
  713. X     attempts to first extract SWITCHAR from an environment vari-
  714. X     able of the same name.  If that fails it then attempts to
  715. X     use the undocumented getswitchar interrupt call, and returns
  716. X     the result of that.  Thus under MSDOS version 4.0 you must
  717. X     set the value of the environment macro SWITCHAR to '/' to
  718. X     obtain predictable behaviour.
  719. X
  720. X     All boolean macros currently understood by ddmmaakkee correspond
  721. X     directly to the previously defined attributes.  These macros
  722. X     provide a second way to apply global attributes, and
  723. X     represent the preferred method of doing so.  They are used
  724. X     by assigning them a value.  If the value is not a NULL
  725. X     string then the boolean condition is set to on.  If the
  726. X     value is a NULL string then the condition is set to off.
  727. X     There are five conditions defined and they correspond
  728. X     directly to the attributes of the same name.  Their meanings
  729. X     are defined in the ATTRIBUTES section above.  The macros
  730. X     are: ..EEPPIILLOOGG, ..IIGGNNOORREE, ..MMKKSSAARRGGSS, ..PPRREECCIIOOUUSS, ..PPRROOLLOOGG,
  731. X     ..SSEEQQUUEENNTTIIAALL, ..SSIILLEENNTT, ..SSWWAAPP, and ..UUSSEESSHHEELLLL.  Assigning any
  732. X     of these a non NULL value will globally set the correspond-
  733. X     ing attribute to on.
  734. X
  735. XRRUUNN__TTIIMMEE MMAACCRROOSS
  736. X     These macros are defined when ddmmaakkee is making targets, and
  737. X     may take on different values for each target.  $$@@ is defined
  738. X     to be the full target name, $$?? is the list of all out of
  739. X     date prerequisites, $$&& is the list of all prerequisites, $$>>
  740. X     is the name of the library if the current target is a
  741. X     library member, and $$<< is the list of prerequisites
  742. X
  743. X
  744. X
  745. XVersion 3.50                    UW                             27
  746. X
  747. X
  748. X
  749. X
  750. XDMAKE(p)               Unsupported Software               DMAKE(p)
  751. X
  752. X
  753. X
  754. X     specified in the current rule.  If the current target had a
  755. X     recipe inferred then $$<< is the name of the inferred prere-
  756. X     quisite even if the target had a list of prerequisites sup-
  757. X     plied using an explicit rule that did not provide a recipe.
  758. X     In such situations $$&& gives the full list of prerequisites.
  759. X
  760. X     $$** is defined as $$((@@::ddbb)) when making targets with explicit
  761. X     recipes and is defined as the value of % when making targets
  762. X     whose recipe is the result of an inference.  In the first
  763. X     case $$** is the target name with no suffix, and in the second
  764. X     case, is the value of the matched % pattern from the associ-
  765. X     ated %-rule.  $$^^ expands to the set of out of date prere-
  766. X     quisites taken from the current value of $$<<.  In addition to
  767. X     these, $$$$ expands to $, {{{{ expands to {, }}}} expands to },
  768. X     and the strings <<++ and ++>> are recognized as respectively
  769. X     starting and terminating a text diversion when they appear
  770. X     literally together in the same input line.
  771. X
  772. X     The difference between $? and $^ can best be illustrated by
  773. X     an example, consider:
  774. X
  775. X          fred.out : joe amy hello
  776. X               rules for making fred
  777. X
  778. X          fred.out : my.c your.h his.h her.h   # more prerequisites
  779. X
  780. X     Assume joe, amy, and my.c are newer then fred.out.  When
  781. X     ddmmaakkee executes the recipe for making fred.out the values of
  782. X     the following macros will be:
  783. X
  784. X          $@ --> fred.out
  785. X          $* --> fred
  786. X          $? --> joe amy my.c  # note the difference between $? and $^
  787. X          $^ --> joe amy
  788. X          $< --> joe amy hello
  789. X          $& --> joe amy hello my.c your.h his.h her.h
  790. X
  791. X
  792. XFFUUNNCCTTIIOONN MMAACCRROOSS
  793. X     Only one function macro is defined at this time.  The
  794. X     $(mktmp ...) construct can be used to create a temporary
  795. X     file containing data and returns the name of that file as
  796. X     it's result.  See the TEXT DIVERSION section for details on
  797. X     its use.  Temporary files created using this macro persist
  798. X     for the duration of the ddmmaakkee run if processed as part of a
  799. X     macro assignment operation, or until an associated target's
  800. X     recipe is fully completed at which time the temporary file
  801. X     is removed.  NOTE:  Specifying '-v' on the command line
  802. X     causes all temporary files to be retained when ddmmaakkee exits.
  803. X
  804. X
  805. X
  806. X
  807. X
  808. X
  809. XVersion 3.50                    UW                             28
  810. X
  811. X
  812. X
  813. X
  814. XDMAKE(p)               Unsupported Software               DMAKE(p)
  815. X
  816. X
  817. X
  818. XDDYYNNAAMMIICC PPRREERREEQQUUIISSIITTEESS
  819. X     ddmmaakkee looks for prerequisites whose names contain macro
  820. X     expansions during target processing.  Any such prerequisites
  821. X     are expanded and the result of the expansion is used as the
  822. X     prerequisite name.  As an example the line:
  823. X
  824. X          fred : $$@.c
  825. X
  826. X     causes the $$@ to be expanded when ddmmaakkee is making fred, and
  827. X     it resolves to the target _f_r_e_d.  This enables dynamic prere-
  828. X     quisites to be generated.  The value of @ may be modified by
  829. X     any of the valid macro modifiers.  So you can say for exam-
  830. X     ple:
  831. X
  832. X          fred.out : $$(@:b).c
  833. X
  834. X     where the $$(@:b) expands to _f_r_e_d.  Note the use of $$
  835. X     instead of $ to indicate the dynamic expansion, this is due
  836. X     to the fact that the rule line is expanded when it is ini-
  837. X     tially parsed, and $$ then returns $ which later triggers
  838. X     the dynamic prerequisite expansion.  If you really want a $
  839. X     to be part of a prerequisite name you must use $$$$.
  840. X     Dynamic macro expansion is performed in all user defined
  841. X     rules, and the special targets .SOURCE*, and .INCLUDEDIRS.
  842. X
  843. XBBIINNDDIINNGG TTAARRGGEETTSS
  844. X     This operation takes a target name and binds it to an exist-
  845. X     ing file, if possible.  ddmmaakkee makes a distinction between
  846. X     the internal target name of a target and it's associated
  847. X     external file name.  Thus it is possible for a target's
  848. X     internal name and its external file name to differ.  To per-
  849. X     form the binding, the following set of rules is used.
  850. X     Assume that we are trying to bind a target whose name is of
  851. X     the form _X_._s_u_f_f, where _._s_u_f_f is the suffix and _X is the stem
  852. X     portion (ie. that part which contains the directory and the
  853. X     basename).  ddmmaakkee takes this target name and performs a
  854. X     series of search operations that try to find a suitably
  855. X     named file in the external file system.  The search opera-
  856. X     tion is user controlled via the settings of the various
  857. X     .SOURCE targets.
  858. X
  859. X          1.   If target has the .SYMBOL attribute set then look
  860. X               for it in the library.  If found, replace the tar-
  861. X               get name with the library member name and continue
  862. X               with step 2.  If the name is not found then
  863. X               return.
  864. X
  865. X          2.   Extract the suffix portion (that following the
  866. X               `.') of the target name.  If the suffix is not
  867. X               null, look up the special target .SOURCE.<suff>
  868. X               (<suff> is the suffix). If the special target
  869. X               exists then search each directory given in the
  870. X
  871. X
  872. X
  873. XVersion 3.50                    UW                             29
  874. X
  875. X
  876. X
  877. X
  878. XDMAKE(p)               Unsupported Software               DMAKE(p)
  879. X
  880. X
  881. X
  882. X               .SOURCE.<suff> prerequisite list for the target.
  883. X               If the target's suffix was null (ie. _._s_u_f_f was
  884. X               empty) then perform the above search but use the
  885. X               special target .SOURCE.NULL instead.  If at any
  886. X               point a match is found then terminate the search.
  887. X               If a directory in the prerequisite list is the
  888. X               special name `.NULL ' perform a search for the
  889. X               full target name without prepending any directory
  890. X               portion (ie. prepend the NULL directory).  (a
  891. X               default target of '.SOURCE : .NULL' is defined by
  892. X               ddmmaakkee at startup, and is user redefinable)
  893. X
  894. X          3.   The search in step 2. failed.  Repeat the same
  895. X               search but this time use the special target
  896. X               .SOURCE.
  897. X
  898. X          4.   The search in step 3. failed.  If the target has
  899. X               the library member attribute (.LIBMEMBER) set then
  900. X               try to find the target in the library which was
  901. X               passed along with the .LIBMEMBER attribute (see
  902. X               the MAKING LIBRARIES section).  The bound file
  903. X               name assigned to a target which is successfully
  904. X               located in a library is the same name that would
  905. X               be assigned had the search failed (see 5.).
  906. X
  907. X          5.   The search failed.  Either the target was not
  908. X               found in any of the search directories or no
  909. X               applicable .SOURCE special targets exist.  If
  910. X               applicable .SOURCE special targets exist, but the
  911. X               target was not found, then ddmmaakkee assigns the first
  912. X               name searched as the bound file name.  If no
  913. X               applicable .SOURCE special targets exist, then the
  914. X               full original target name becomes the bound file
  915. X               name.
  916. X
  917. X     There is potential here for a lot of search operations.  The
  918. X     trick is to define .SOURCE.x special targets with short
  919. X     search lists and leave .SOURCE as short as possible.  The
  920. X     search algorithm has the following useful side effect.  When
  921. SHAR_EOF
  922. echo "End of part 14"
  923. echo "File man/dmake.p is continued in part 15"
  924. echo "15" > s2_seq_.tmp
  925. exit 0
  926.  
  927.