home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume27 / dmake / part15 < prev    next >
Encoding:
Text File  |  1992-01-29  |  40.2 KB  |  1,007 lines

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