home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume14 / dmake / part12 < prev    next >
Encoding:
Text File  |  1990-07-26  |  38.6 KB  |  1,113 lines

  1. Newsgroups: comp.sources.misc
  2. subject: v14i022: dmake version 3.5 part 12/21
  3. From: dvadura@watdragon.waterloo.edu (Dennis Vadura)
  4. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5.  
  6. Posting-number: Volume 14, Issue 22
  7. Submitted-by: dvadura@watdragon.waterloo.edu (Dennis Vadura)
  8. Archive-name: dmake/part12
  9.  
  10. #!/bin/sh
  11. # this is part 12 of a multipart archive
  12. # do not concatenate these parts, unpack them in order with /bin/sh
  13. # file man/dmake.p continued
  14. #
  15. CurArch=12
  16. if test ! -r s2_seq_.tmp
  17. then echo "Please unpack part 1 first!"
  18.      exit 1; fi
  19. ( read Scheck
  20.   if test "$Scheck" != $CurArch
  21.   then echo "Please unpack part $Scheck next!"
  22.        exit 1;
  23.   else exit 0; fi
  24. ) < s2_seq_.tmp || exit 1
  25. echo "x - Continuing file man/dmake.p"
  26. sed 's/^X//' << 'SHAR_EOF' >> man/dmake.p
  27. X     will be needed to help handle the smaller differences in the
  28. X     two environments.
  29. X
  30. X     NOTE:  Unlike UNIX, MSDOS ddooeess maintain cd requests cross
  31. X     single recipe lines.  This is not portable, and your
  32. X     makefiles will not work the same way if you depend on it.
  33. X     Use the .IF ... .ELSE ... .END conditionals to supply dif-
  34. X     ferent make scripts as necessary.
  35. X
  36. XFFIILLEESS
  37. X     Makefile, makefile, startup.mk (use dmake -V to tell you
  38. X     where the startup file is)
  39. X
  40. XSSEEEE AALLSSOO
  41. X     sh(1), csh(1), touch(1), f77(1), pc(1), cc(1)
  42. X     S.I. Feldman  _M_a_k_e _- _A _P_r_o_g_r_a_m _f_o_r _M_a_i_n_t_a_i_n_i_n_g _C_o_m_p_u_t_e_r _P_r_o_-
  43. X     _g_r_a_m_s
  44. X
  45. XAAUUTTHHOORR
  46. X     Dennis Vadura, CS Dept. University of Waterloo.
  47. X     dvadura@watdragon.uwaterloo.ca
  48. X     Many thanks to Carl Seger for his helpful suggestions, and
  49. X     to Trevor John Thompson for his many excellent ideas and
  50. X
  51. X
  52. X
  53. XVersion 3.50                    UW                             40
  54. X
  55. X
  56. X
  57. X
  58. XDMAKE(p)               Unsupported Software               DMAKE(p)
  59. X
  60. X
  61. X
  62. X     informative bug reports.
  63. X
  64. XBBUUGGSS
  65. X     Some system commands return non-zero status inappropriately.
  66. X     Use --ii (`-' within the makefile) to overcome the difficulty.
  67. X
  68. X     Some systems do not have easily accessible time stamps for
  69. X     library members (MSDOS, AMIGA, etc) for these ddmmaakkee uses the
  70. X     time stamp of the library instead and prints a warning the
  71. X     first time it does so.  This is almost always ok, except
  72. X     when multiple makefiles update a single library file.  In
  73. X     these instances it is possible to miss an update if one is
  74. X     not careful.
  75. X
  76. X
  77. X
  78. X
  79. X
  80. X
  81. X
  82. X
  83. X
  84. X
  85. X
  86. X
  87. X
  88. X
  89. X
  90. X
  91. X
  92. X
  93. X
  94. X
  95. X
  96. X
  97. X
  98. X
  99. X
  100. X
  101. X
  102. X
  103. X
  104. X
  105. X
  106. X
  107. X
  108. X
  109. X
  110. X
  111. X
  112. X
  113. X
  114. X
  115. X
  116. X
  117. XVersion 3.50                    UW                             41
  118. SHAR_EOF
  119. echo "File man/dmake.p is complete"
  120. chmod 0640 man/dmake.p || echo "restore of man/dmake.p fails"
  121. echo "x - extracting man/dmake.nc (Text)"
  122. sed 's/^X//' << 'SHAR_EOF' > man/dmake.nc &&
  123. X
  124. X
  125. X
  126. X
  127. XDMAKE(p)               Unsupported Software               DMAKE(p)
  128. X
  129. X
  130. X
  131. XNAME
  132. X     dmake - maintain program groups, or interdependent files
  133. X
  134. XSYNOPSIS
  135. X     dmake [-AeEhiknpqersStTuvVx] [-P#] [macro[+][:]=value] [-f
  136. X     file] [target ...]
  137. X
  138. XDESCRIPTION
  139. X     dmake executes commands found in an external file called a
  140. X     makefile to update one or more target names.  Each target
  141. X     may depend on zero or more prerequisite targets.  If any of
  142. X     the target's prerequisites is newer than the target or if
  143. X     the target itself does not exist, then dmake will attempt to
  144. X     make the target.
  145. X
  146. X     If no -f command line option is present then dmake searches
  147. X     for an existing makefile from the list of prerequisites
  148. X     specified for the special target .MAKEFILES (see the STARTUP
  149. X     section for more details).  If "-" is the name of the file
  150. X     specified to the -f flag then dmake uses standard input as
  151. X     the source of the makefile text.
  152. X
  153. X     Any macro definitions (arguments with embedded "=" signs)
  154. X     that appear on the command line are processed first and
  155. X     supersede definitions for macros of the same name found
  156. X     within the makefile.  It is impossible for definitions found
  157. X     inside the makefile to redefine any macro defined on the
  158. X     command line.
  159. X
  160. X     If no target names are specified on the command line, then
  161. X     dmake uses the first non-special target found in the
  162. X     makefile as the default target.  See the SPECIAL TARGETS
  163. X     section for the list of special targets and their function.
  164. X     dmake is a re-implementation of the UNIX Make utility with
  165. X     significant enhancements.  Makefiles written for most previ-
  166. X     ous versions of make will be handled correctly by dmake.
  167. X     Known differences between dmake and other versions of make
  168. X     are discussed in the COMPATIBILITY section found at the end
  169. X     of this document.
  170. X
  171. XOPTIONS
  172. X     -A   Enable AUGMAKE special inference rule transformations
  173. X          (see the "PERCENT(%) RULES" section), these are set to
  174. X          off by default.
  175. X
  176. X     -e   Read the environment and define all strings of the form
  177. X          'ENV-VAR=evalue' defined within as macros whose name is
  178. X          ENV-VAR, and whose value is 'evalue'.  The environment
  179. X          is processed prior to processing the user specified
  180. X          makefile thereby allowing definitions in the makefile
  181. X          to override definitions in the environment.
  182. X
  183. X
  184. X
  185. X
  186. XVersion 3.50                    UW                              1
  187. X
  188. X
  189. X
  190. X
  191. XDMAKE(p)               Unsupported Software               DMAKE(p)
  192. X
  193. X
  194. X
  195. X     -E   Same as -e, except that the environment is processed
  196. X          after the user specified makefile has been processed
  197. X          (thus definitions in the environment override defini-
  198. X          tions in the makefile).  The -e and -E options are
  199. X          mutually exclusive.  If both are given the latter one
  200. X          takes effect.
  201. X
  202. X     -f file
  203. X          Use file as the source for the makefile text.  Only one
  204. X          -f option is allowed.
  205. X
  206. X     -h   Print the command summary for dmake.
  207. X
  208. X     -i   Tells dmake to ignore errors, and continue making other
  209. X          targets.  This is equivalent to the .IGNORE attribute
  210. X          or macro.
  211. X
  212. X     -k   Causes dmake to ignore errors caused by command execu-
  213. X          tion and to make all targets not depending on targets
  214. X          that could not be made. Ordinarily dmake stops after a
  215. X          command returns a non-zero status, specifying -k causes
  216. X          dmake to ignore the error and continue to make as much
  217. X          as possible.
  218. X
  219. X     -n   Causes dmake to print out what it would have executed,
  220. X          but does not actually execute the commands.  A special
  221. X          check is made for the string "$(MAKE)" inside a recipe
  222. X          line, if found, the line is expanded and invoked,
  223. X          thereby enabling recursive makes to give a full
  224. X          description of all that they will do.  The check for
  225. X          "$(MAKE)" is disabled inside group recipes.
  226. X
  227. X     -p   Print out a version of the digested makefile in human
  228. X          readable form.  (useful for debugging, but cannot be
  229. X          re-read by dmake)
  230. X
  231. X     -P#  On systems that support multi-processing cause dmake to
  232. X          use # concurrent child processes to make targets.  See
  233. X          the "MULTI PROCESSING" section for more information.
  234. X
  235. X     -q   Check and see if the target is up to date.  Exits with
  236. X          code 0 if up to date, 1 otherwise.
  237. X
  238. X     -r   Tells dmake not to read the initial startup makefile,
  239. X          see STARTUP section for more details.
  240. X
  241. X     -s   Tells dmake to do all its work silently and not echo
  242. X          the commands it is executing to stdout (also suppresses
  243. X          warnings).  This  is equivalent to the .SILENT attri-
  244. X          bute or macro.
  245. X
  246. X
  247. X
  248. X
  249. X
  250. XVersion 3.50                    UW                              2
  251. X
  252. X
  253. X
  254. X
  255. XDMAKE(p)               Unsupported Software               DMAKE(p)
  256. X
  257. X
  258. X
  259. X     -S   Force sequential execution of recipes on architectures
  260. X          which support concurrent makes.  For backward compati-
  261. X          bility with old makefiles that have nasty side-effect
  262. X          prerequisite dependencies.
  263. X
  264. X     -t   Causes dmake to touch the targets and bring them up to
  265. X          date without executing any commands.
  266. X
  267. X     -T   Tells dmake to not perform transitive closure on the
  268. X          inference graph.
  269. X
  270. X     -u   Force an unconditional update.  (ie. do everything that
  271. X          would be done if everything that a target depended on
  272. X          was out of date)
  273. X
  274. X     -v   Verbose flag, when making targets print to stdout what
  275. X          we are going to make and what we think it's timestamp
  276. X          is.
  277. X
  278. X     -V   Print the version of dmake, and values of builtin mac-
  279. X          ros.
  280. X
  281. X     -x   Upon processing the user makefile export all non-
  282. X          internally defined macros to the user's environment.
  283. X          This option together with the -e option allows SYSV
  284. X          AUGMAKE recursive makes to function as expected.
  285. X
  286. XINDEX
  287. X     Here is a list of the sections that follow and a short
  288. X     description of each.  Perhaps you won't have to read the
  289. X     whole man page to find what you need.
  290. X
  291. X     STARTUP            Describes dmake initialization.
  292. X
  293. X     SYNTAX             Describes the syntax of makefile expres-
  294. X                        sions.
  295. X
  296. X     ATTRIBUTES         Describes the notion of attributes and
  297. X                        how they are used when making targets.
  298. X
  299. X     MACROS             Defining and expanding macros.
  300. X
  301. X     RULES AND TARGETS  How to define targets and their prere-
  302. X                        quisites.
  303. X
  304. X     RECIPES            How to tell dmake how to make a target.
  305. X
  306. X     TEXT DIVERSIONS    How to use text diversions for long argu-
  307. X                        ment lists in recipes.
  308. X
  309. X     SPECIAL TARGETS    Some targets are special.
  310. X
  311. X
  312. X
  313. X
  314. XVersion 3.50                    UW                              3
  315. X
  316. X
  317. X
  318. X
  319. XDMAKE(p)               Unsupported Software               DMAKE(p)
  320. X
  321. X
  322. X
  323. X     SPECIAL MACROS     Macros used by dmake to alter the pro-
  324. X                        cessing of the makefile, and those
  325. X                        defined by dmake for the user.
  326. X
  327. X     DYNAMIC PREREQUISITES
  328. X                        Processing of prerequisites which contain
  329. X                        macro expansions in their name.
  330. X
  331. X     BINDING TARGETS    The rules that dmake uses to bind a tar-
  332. X                        get to an existing file in the file sys-
  333. X                        tem.
  334. X
  335. X     PERCENT(%) RULES   Specification of recipes to be used by
  336. X                        the inference algorithm.
  337. X
  338. X     MAKING INFERENCES  The rules that dmake uses when inferring
  339. X                        how to make a target which had no expli-
  340. X                        cit recipe.  This and the previous sec-
  341. X                        tion are really a single section in the
  342. X                        text below.
  343. X
  344. X     MAKING TARGETS     How dmake makes targets other than
  345. X                        libraries.
  346. X
  347. X     MAKING LIBRARIES   How dmake makes libraries.
  348. X
  349. X     MULTI PROCESSING   Discussion of dmake's parallel make
  350. X                        facilities for architectures that support
  351. X                        them.
  352. X
  353. X     CONDITIONALS       Conditional expressions which control the
  354. X                        processing of the makefile.
  355. X
  356. X     EXAMPLES           Some hopefully useful examples.
  357. X
  358. X     COMPATIBILITY      How dmake compares with previous versions
  359. X                        of make.
  360. X
  361. X     LIMITS             Limitations of dmake.
  362. X
  363. X     PORTABILITY        Comments on writing portable makefiles.
  364. X
  365. X     FILES              Files used by dmake.
  366. X
  367. X     SEE ALSO           Other related programs, and man pages.
  368. X
  369. X     AUTHOR             The guy responsible for this thing.
  370. X
  371. X     BUGS               Hope not.
  372. X
  373. X
  374. X
  375. X
  376. X
  377. X
  378. XVersion 3.50                    UW                              4
  379. X
  380. X
  381. X
  382. X
  383. XDMAKE(p)               Unsupported Software               DMAKE(p)
  384. X
  385. X
  386. X
  387. XSTARTUP
  388. X     When dmake begins execution it first processes the command
  389. X     line and then it processes an initial startup-makefile.
  390. X     This is followed by an attempt to locate and process a user
  391. X     supplied makefile.  The startup file defines the default
  392. X     values of all required control macros and the set of default
  393. X     rules for making inferences.  When searching for the startup
  394. X     makefile, dmake searches the following locations, in order,
  395. X     until a startup file is located:
  396. X
  397. X          1.   The location given as the value of the macro MAK-
  398. X               ESTARTUP defined on the command line.
  399. X
  400. X          2.   The location given as the value of the environment
  401. X               variable MAKESTARTUP defined in the current
  402. X               environment.
  403. X
  404. X          3.   The location given as the value of the macro MAK-
  405. X               ESTARTUP defined internally within dmake.
  406. X
  407. X     The above search is disabled by specifying the -r option on
  408. X     the command line.  An error is issued if a startup makefile
  409. X     cannot be found and the -r option was not specified.  A user
  410. X     may substitute a custom startup file by defining the MAKES-
  411. X     TARTUP environment variable or by redefining the MAKESTARTUP
  412. X     macro on the command line.  To find out where dmake looks
  413. X     for the default startup file, check your environment or
  414. X     issue the command "dmake -V" to determine the builtin value
  415. X     of MAKESTARTUP.
  416. X
  417. X     A similar search is performed to locate a default user
  418. X     makefile when no -f command line option is specified.  The
  419. X     special target .MAKEFILES is internally defined by default.
  420. X     This target's prerequisite list specifies the names of files
  421. X     and the order that dmake will use to search for them when
  422. X     attempting to locate the default makefile.  A typical defin-
  423. X     ition for this target is:
  424. X
  425. X          .MAKEFILES : makefile.mk Makefile makefile
  426. X
  427. X     dmake will first look for makefile.mk and then the others.
  428. X     If a prerequisite cannot be found dmake will try to make it
  429. X     before going on to the next prerequisite.  For example,
  430. X     makefile.mk can be checked out of an RCS file if the proper
  431. X     rules for doing so are defined in the startup file.
  432. X
  433. XSYNTAX
  434. X     This section is a summary of the syntax of makefile state-
  435. X     ments.  The description is given in a style similar to BNF,
  436. X     where { } enclose items that may appear zero or more times,
  437. X     and [ ] enclose items that are optional.  Alternative pro-
  438. X     ductions for a left hand side are indicated by '->', and
  439. X
  440. X
  441. X
  442. XVersion 3.50                    UW                              5
  443. X
  444. X
  445. X
  446. X
  447. XDMAKE(p)               Unsupported Software               DMAKE(p)
  448. X
  449. X
  450. X
  451. X     newlines are significant.  All symbols in bold type are text
  452. X     or names representing text supplied by the user.
  453. X
  454. X
  455. X
  456. X          Makefile -> { Statement }
  457. X
  458. X          Statement -> Macro-Definition
  459. X                    -> Conditional
  460. X                    -> Rule-Definition
  461. X                    -> Attribute-Definition
  462. X
  463. X          Macro-Definition -> MACRO = LINE
  464. X                           -> MACRO := LINE
  465. X                           -> MACRO += LINE
  466. X                           -> MACRO +:= LINE
  467. X
  468. X          Conditional ->  .IF expression
  469. X                             Makefile
  470. X                          [ .ELSE
  471. X                             Makefile ]
  472. X                          .END
  473. X
  474. X          expression -> LINE
  475. X                     -> STRING == LINE
  476. X                     -> STRING != LINE
  477. X
  478. X
  479. X          Rule-Definition ->  target-definition
  480. X                                 [ recipe ]
  481. X
  482. X          target-definition -> targets [attrs] op { PREREQUISITE } [; rcp-line]
  483. X
  484. X          targets -> target { targets }
  485. X                  -> "target" { targets }
  486. X
  487. X          target -> special-target
  488. X                 -> TARGET
  489. X
  490. X          attrs -> attribute { attrs }
  491. X                -> "attribute" { attrs }
  492. X
  493. X          op -> : { modifier }
  494. X
  495. X          modifier -> :
  496. X                   -> ^
  497. X                   -> !
  498. X                   -> -
  499. X
  500. X          recipe -> { TAB rcp-line }
  501. X                 -> [@][-] [
  502. X                       { LINE }
  503. X
  504. X
  505. X
  506. XVersion 3.50                    UW                              6
  507. X
  508. X
  509. X
  510. X
  511. XDMAKE(p)               Unsupported Software               DMAKE(p)
  512. X
  513. X
  514. X
  515. X                    ]
  516. X
  517. X          rcp-line -> [@][-] LINE
  518. X
  519. X
  520. X          Attribute-Definition -> attrs : targets
  521. X
  522. X
  523. X          attribute -> .EPILOG
  524. X                    -> .IGNORE
  525. X                    -> .LIBRARY
  526. X                    -> .NOINFER
  527. X                    -> .PRECIOUS
  528. X                    -> .PROLOG
  529. X                    -> .SETDIR=path
  530. X                    -> .SILENT
  531. X                    -> .SEQUENTIAL
  532. X                    -> .SYMBOL
  533. X                    -> .UPDATEALL
  534. X
  535. X          special-target -> .ERROR
  536. X                         -> .EXPORT
  537. X                         -> .GROUPEPILOG
  538. X                         -> .GROUPPROLOG
  539. X                         -> .IMPORT
  540. X                         -> .INCLUDE
  541. X                         -> .INCLUDEDIRS
  542. X                         -> .MAKEFILES
  543. X                         -> .REMOVE
  544. X                         -> .SOURCE
  545. X                         -> .SOURCE.suffix
  546. X                         -> .suffix1.suffix2
  547. X
  548. X
  549. X     Where, TAB represents a <tab> character, STRING represents
  550. X     an arbitrary sequence of characters, and LINE represents a
  551. X     possibly empty sequence of characters terminated by a non-
  552. X     escaped (not immediately preceded by a backslash '\') new-
  553. X     line character.  MACRO, PREREQUISITE, and TARGET each
  554. X     represent a string of characters not including space or tab
  555. X     which respectively form the name of a macro, prerequisite or
  556. X     target.  The name may itself be a macro expansion expres-
  557. X     sion.  A LINE can be continued over several physical lines
  558. X     by terminating it with a single backslash character.  Com-
  559. X     ments are initiated by the pound '#' character and extend to
  560. X     the end of line.  All comment text is discarded, a '#' may
  561. X     be placed into the makefile text by escaping it with '\'
  562. X     (ie. \# translates to # when it is parsed).  A group of con-
  563. X     tinued lines may be commented out by placing a single # at
  564. X     the start of the first line of the group.  A continued line
  565. X     may not span more than one makefile.
  566. X
  567. X
  568. X
  569. X
  570. XVersion 3.50                    UW                              7
  571. X
  572. X
  573. X
  574. X
  575. XDMAKE(p)               Unsupported Software               DMAKE(p)
  576. X
  577. X
  578. X
  579. X     white space is defined to be any combination of <space>,
  580. X     <tab>, and the sequence \<nl> when \<nl> is used to ter-
  581. X     minate a LINE.  When processing macro definition lines, any
  582. X     amount of white space is allowed on either side of the macro
  583. X     operator (=, :=, += or +:=), and white space is stripped
  584. X     from both before and after the macro value string.  The
  585. X     sequence \<nl> is treated as white space during recipe
  586. X     expansion and is deleted from the final recipe string.  You
  587. X     must escape the \<nl> with a \ in order to get a \<nl> at
  588. X     the end of a recipe line.  The \<nl> sequence is always
  589. X     deleted from macro values.
  590. X
  591. X     When processing target definition lines, the recipe for a
  592. X     target must, in general, follow the first definition of the
  593. X     target (See the RULES AND TARGETS section for an exception),
  594. X     and the recipe may not span across multiple makefiles.  Any
  595. X     targets and prerequisites found on a target definition line
  596. X     are taken to be white space separated tokens.  The rule
  597. X     operator (op in SYNTAX section) is also considered to be a
  598. X     token but does not require white space to precede or follow
  599. X     it.  Since the rule operator begins with a `:', traditional
  600. X     versions of make do not allow the `:' character to form a
  601. X     valid target name.  dmake allows `:' to be present in
  602. X     target/prerequisite names as long as the entire
  603. X     target/prerequisite name is quoted.  For example:
  604. X
  605. X          a:fred : test
  606. X
  607. X     would be parsed as TARGET = a, PREREQUISITES are fred, :,
  608. X     and test, which is not what was intended.  To fix this you
  609. X     must write:
  610. X
  611. X          "a:fred" : test
  612. X
  613. X     Which will be parsed as expected.  See the EXAMPLES section
  614. X     for how to apply this to a list of targets.
  615. X
  616. XATTRIBUTES
  617. X     dmake defines several target attributes.  Attributes may be
  618. X     assigned to a single target, a group of targets, or to all
  619. X     targets in the makefile.  Attributes are used to modify
  620. X     dmake actions during target update.  The recognized attri-
  621. X     butes are:
  622. X
  623. X
  624. X     .EPILOG     Insert shell epilog code when executing a group
  625. X                 recipe associated with any target having this
  626. X                 attribute set.
  627. X
  628. X     .IGNORE     Ignore an error when trying to make any target
  629. X                 with this attribute set.
  630. X
  631. X
  632. X
  633. X
  634. XVersion 3.50                    UW                              8
  635. X
  636. X
  637. X
  638. X
  639. XDMAKE(p)               Unsupported Software               DMAKE(p)
  640. X
  641. X
  642. X
  643. X     .LIBRARY    Target is a library.
  644. X
  645. X     .NOINFER    Any target with this attribute set will not be
  646. X                 subjected to transitive closure if it is
  647. X                 inferred as a prerequisite of a target whose
  648. X                 recipe and prerequisites are being inferred.
  649. X                 (i.e. the inference search will not use any
  650. X                 prerequisite with this attribute set, as a tar-
  651. X                 get)
  652. X
  653. X     .PRECIOUS   Do not remove this target under any cir-
  654. X                 cumstances.  Set by default for any targets
  655. X                 whose corresponding files exist in the file sys-
  656. X                 tem prior to the execution of dmake.
  657. X
  658. X     .PROLOG     Insert shell prolog code when executing a group
  659. X                 recipe associated with any target having this
  660. X                 attribute set.
  661. X
  662. X     .SEQUENTIAL Force a sequential make of the associated
  663. X                 target's prerequisites.
  664. X
  665. X     .SETDIR     Change current working directory to specified
  666. X                 directory when making associated target.  The
  667. X                 syntax of this attribute is different from the
  668. X                 others.  You must specify the directory at the
  669. X                 time the attribute is specified.  To do this
  670. X                 simply give .SETDIR=path as the attribute.  path
  671. X                 is expanded and the result is used as the value
  672. X                 of the directory to change to.  If path is sur-
  673. X                 rounded by single quotes then path is not
  674. X                 expanded, and is used literally as the directory
  675. X                 name.  If the path contains any `:' characters
  676. X                 then the entire attribute string must be quoted
  677. X                 using ".  If a target having this attribute set
  678. X                 also has the .IGNORE attribute set then if the
  679. X                 change to the specified directory fails it will
  680. X                 be ignored, and no error message will be issued.
  681. X
  682. X     .SILENT     Do not echo the recipe lines when making any
  683. X                 target with this attribute set, and do not issue
  684. X                 any warnings.
  685. X
  686. X     .SYMBOL     Target is a library member and is an entry point
  687. X                 into a module in the library.  This attribute is
  688. X                 used only when searching a library for a target.
  689. X                 Targets of the form lib((entry)) have this
  690. X                 attribute set automatically.
  691. X
  692. X     .UPDATEALL  Indicates that all the targets listed in this
  693. X                 rule are updated by the execution of the accom-
  694. X                 panying recipe.  A common example is the
  695. X
  696. X
  697. X
  698. XVersion 3.50                    UW                              9
  699. X
  700. X
  701. X
  702. X
  703. XDMAKE(p)               Unsupported Software               DMAKE(p)
  704. X
  705. X
  706. X
  707. X                 production of the y.tab.c and y.tab.h files by
  708. X                 yacc when it is run on a grammar.  Specifying
  709. X                 .UPDATEALL in such a rule prevents the running
  710. X                 of yacc twice, once for the y.tab.c file and
  711. X                 once for the y.tab.h file.
  712. X
  713. X
  714. X     All attributes are user setable and may be used in one of
  715. X     two forms (except .UPDATEALL, use of this attribute in a
  716. X     rule of the first form is illegal)
  717. X
  718. X          ATTRIBUTE_LIST : targets
  719. X
  720. X     assigns the attributes specified by ATTRIBUTE_LIST to each
  721. X     target in targets or
  722. X
  723. X          targets ATTRIBUTE_LIST : ...
  724. X
  725. X     assigns the attributes specified by ATTRIBUTE_LIST to each
  726. X     target in targets. In the first form if targets is empty
  727. X     (ie. a NULL list), then the list of attributes will apply to
  728. X     all targets in the makefile (this is equivalent to the com-
  729. X     mon Make construct of ".IGNORE :" but has been modified to
  730. X     the notion of an attribute instead of a special target).
  731. X     Not all of the attributes have global meaning.  In particu-
  732. X     lar, .LIBRARY, .SYMBOL, and .UPDATEALL have no assigned glo-
  733. X     bal meaning.
  734. X
  735. X     Any attribute may be used with any target, even with the
  736. X     special targets.  Some combinations are useless (e.g.
  737. X     .INCLUDE .PRECIOUS: ... ), while others are useful (e.g.
  738. X     .INCLUDE .IGNORE : "file.mk" will not complain if file.mk
  739. X     cannot be found using the include file search rules, see the
  740. X     section on SPECIAL TARGETS for a description of .INCLUDE).
  741. X     If a specified attribute will not be used with the special
  742. X     target a warning is issued and the attribute is ignored.
  743. X
  744. XMACROS
  745. X     dmake supports four types of macro assignment.  The first
  746. X     and most familiar is the usual assignment:
  747. X
  748. X          MACRO = LINE
  749. X
  750. X     which causes LINE to be assigned without expansion, as the
  751. X     value of MACRO.  The second form:
  752. X
  753. X          MACRO := LINE
  754. X
  755. X     is new and indicates that LINE should be expanded prior to
  756. X     being assigned as the value of MACRO.  Future expansions of
  757. X     MACRO do not have the value expanded since it was expanded
  758. X     when the macro was defined.  The third form of macro
  759. X
  760. X
  761. X
  762. XVersion 3.50                    UW                             10
  763. X
  764. X
  765. X
  766. X
  767. XDMAKE(p)               Unsupported Software               DMAKE(p)
  768. X
  769. X
  770. X
  771. X     assignment allows macro values to grow:
  772. X
  773. X          MACRO += LINE
  774. X
  775. X     adds the value of LINE to the previous value of MACRO
  776. X     separating the two by a single space (LINE is not expanded).
  777. X     The final form:
  778. X
  779. X          MACRO +:= LINE
  780. X
  781. X     is similar to +=, with the difference that the value of LINE
  782. X     is expanded before being added to the previous value of
  783. X     MACRO.
  784. X
  785. X     When dmake defines a non-environment macro it strips leading
  786. X     and trailing white space from the macro value.  Macros
  787. X     imported from the environment via either the .IMPORT special
  788. X     target (see the SPECIAL TARGETS section), or the -e, or -E
  789. X     flags are an exception to this rule.  Their values are
  790. X     always taken literally and white space is never stripped.
  791. X     In addition, macros defined using the .IMPORT special target
  792. X     do not have their values expanded when they are used within
  793. X     a makefile.  In contrast, environment macros that are
  794. X     imported due to the specification of the -e or -E flags are
  795. X     subject to expansion when used.
  796. X
  797. X     To specify a macro expansion enclose the name in () or {}
  798. X     and precede it with a dollar sign $.  Thus $(TEST)
  799. X     represents an expansion of the macro variable named TEST.
  800. X     If TEST is defined then $(TEST) is replaced by its expanded
  801. X     value.  If TEST is not defined then $(TEST) expands to the
  802. X     NULL string (this is equivalent to defining a macro as
  803. X     'TEST=' ).  A short form may be used for single character
  804. X     named macros.  In this case the parentheses are optional,
  805. X     and $(I) is equivalent to $I.  Macro expansion is recursive,
  806. X     hence if the value string contains an expression represent-
  807. X     ing a macro expansion, the expansion is performed.  Circular
  808. X     macro expansions are detected and cause an error to be
  809. X     issued.
  810. X
  811. X     When defining a macro the given macro name is first expanded
  812. X     before being used to define the macro.  Thus it is possible
  813. X     to define macros whose names depend on values of other mac-
  814. X     ros.  For example, suppose
  815. X
  816. X          CWD = $(PWD:b)
  817. X
  818. X     is defined, then the value of $(CWD) is the name of the
  819. X     current directory.  This can be used to define macros
  820. X     specific to this directory, for example:
  821. X
  822. X          _$(CWD).prt = list of files to print...
  823. X
  824. X
  825. X
  826. XVersion 3.50                    UW                             11
  827. X
  828. X
  829. X
  830. X
  831. XDMAKE(p)               Unsupported Software               DMAKE(p)
  832. X
  833. X
  834. X
  835. X     The actual name of the defined macro is a function of the
  836. X     current directory.  A construct such as this is useful when
  837. X     processing a hierarchy of directories using .SETDIR attri-
  838. X     buted targets and a collection of small distributed makefile
  839. X     stubs.
  840. X
  841. X     Macro variables may be defined within the makefile, on the
  842. X     command line, or imported from the environment.
  843. X
  844. X     dmake supports several non-standard macro expansions: The
  845. X     first is of the form:
  846. X
  847. X          $(macro_name:modifier_list:modifier_list:...)
  848. X
  849. X     where modifier_list is chosen from the set { D or d, F or f,
  850. X     B or b, S or s, T or t } and
  851. X
  852. X          d - directory portion of all path names
  853. X          f - file (including suffix) portion of path names
  854. X          b - file (not including suffix) portion of path names
  855. X          s - simple pattern substitution
  856. X          t - tokenization.
  857. X
  858. X     Thus if we have the example:
  859. X
  860. X          test = d1/d2/d3/a.out f.out d1/k.out
  861. X
  862. X     The following macro expansions produce the values on the
  863. X     right of '-->' after expansion.
  864. X
  865. X          $(test:d)            --> d1/d2/d3/ d1/
  866. X          $(test:b)            --> a f k
  867. X          $(test:f)            --> a.out f.out k.out
  868. X          ${test:db}           --> d1/d2/d3/a f d1/k
  869. X          ${test:s/out/in/:f}  --> a.in f.in k.in
  870. X          $(test:f:t"+")       --> a.out+f.out+k.out
  871. X
  872. X     If a token ends in a string composed from the value of the
  873. X     macro DIRBRKSTR (ie. ends in a directory separator string,
  874. X     e.g. '/' in UNIX) and you use the :d modifier then the
  875. X     expansion returns the directory name less the final direc-
  876. X     tory separator string.  Thus successive pairs of :d modif-
  877. X     iers each remove a level of directory in the token string.
  878. X
  879. X     The tokenization modifier takes all white space separated
  880. X     tokens from the macro value and separates them by the quoted
  881. X     separator string.  The separator string may contain the fol-
  882. X     lowing escape codes \a => <bel>, \b => <backspace>, \f =>
  883. X     <formfeed>, \n => <nl>, \r => <cr>, \t => <tab>, \v =>
  884. X     <vertical tab>, \" => ", and \xxx => <xxx> where xxx is the
  885. X     octal representation of a character.  Thus the expansion:
  886. X
  887. X
  888. X
  889. X
  890. XVersion 3.50                    UW                             12
  891. X
  892. X
  893. X
  894. X
  895. XDMAKE(p)               Unsupported Software               DMAKE(p)
  896. X
  897. X
  898. X
  899. X          $(test:f:t"+\n")
  900. X
  901. X     gives:
  902. X
  903. X          a.out+
  904. X          f.out+
  905. X          k.out
  906. X
  907. X     The second non-standard form of macro expansion allows for
  908. X     recursive macros.  It is possible to specify a $(macro_name)
  909. X     or ${macro_name} expansion where macro_name contains more $(
  910. X     ... ) or ${ ... } macro expansions itself.
  911. X
  912. X     For example $(CC$(_HOST)$(_COMPILER)) will first expand
  913. X     CC$(_HOST)$(_COMPILER) to get a result and use that result
  914. X     as the name of the macro to expand.  This is useful for
  915. X     writing a makefile for more than one target environment.  As
  916. X     an example consider the following hypothetical case. Suppose
  917. X     that _HOST and _COMPILER are imported from the environment
  918. X     and are set to represent the host machine type and the host
  919. X     compiler respectively.
  920. X
  921. X          CFLAGS_VAX_CC = -c -O    # _HOST == "_VAX", _COMPILER == "_CC"
  922. X          CFLAGS_PC_MSC = -c -ML   # _HOST == "_PC",  _COMPILER == "_MSC"
  923. X
  924. X          # redefine CFLAGS macro as:
  925. X
  926. X          CFLAGS := $(CFLAGS$(_HOST)$(_COMPILER))
  927. X
  928. X     This causes CFLAGS to take on a value that corresponds to
  929. X     the environment in which the make is being invoked.
  930. X
  931. X     The final non-standard macro expansion is of the form:
  932. X
  933. X          string1{token_list}string2
  934. X
  935. X     where string1, string2 and token_list are expanded.  After
  936. X     expansion, string1 is prepended to each token found in
  937. X     token_list and string2 is appended to each resulting token
  938. X     from the previous prepend.  string1 and string2 are not del-
  939. X     imited by white space whereas the tokens in token_list are.
  940. X     A null token in the token list is specified using "".  Thus
  941. X     using another example we have:
  942. X
  943. X          test/{f1 f2}.o            --> test/f1.o test/f2.o
  944. X          test/ {f1 f2}.o           --> test/ f1.o f2.o
  945. X          test/{f1 f2} .o           --> test/f1 test/f2 .o
  946. X          test/{ f1  "f2" "" }.o    --> test/f1.o test/f2.o
  947. X                                    test/.o
  948. X
  949. X          and
  950. X
  951. X
  952. X
  953. X
  954. XVersion 3.50                    UW                             13
  955. X
  956. X
  957. X
  958. X
  959. XDMAKE(p)               Unsupported Software               DMAKE(p)
  960. X
  961. X
  962. X
  963. X          test/{ d1 d2 }/{ f1 f2 }.o --> test/d1/f1.o
  964. X                                         test/d1/f2.o
  965. X                                         test/d2/f1.o
  966. X                                         test/d2/f2.o
  967. X
  968. X     See the SPECIAL MACROS section for a description of the spe-
  969. X     cial macros that dmake defines and understands.
  970. X
  971. XRULES AND TARGETS
  972. X     A makefile contains a series of entries that specify depen-
  973. X     dencies.  Such entries are called target/prerequisite or
  974. X     rule definitions.  Each rule definition is optionally fol-
  975. X     lowed by a set of lines that provide a recipe for updating
  976. X     any targets defined by the rule.  Whenever dmake attempts to
  977. X     bring a target up to date and an explicit recipe is provided
  978. X     with a rule defining the target, that recipe is used to
  979. X     update the target.  A rule definition begins with a line
  980. X     having the following syntax:
  981. X
  982. X          <targets> [<attributes>] <ruleop> [<prerequisites>] [;<recipe>]
  983. X
  984. X     targets is a non-empty list of targets.  If the target is a
  985. X     special target (see SPECIAL TARGETS section below) then it
  986. X     must appear alone on the rule line.  For example:
  987. X
  988. X          .IMPORT .ERROR : ...
  989. X
  990. X     is not allowed since both .IMPORT and .ERROR are special
  991. X     targets.  Special targets are not used in the construction
  992. X     of the dependency graph and will not be made.
  993. X
  994. X     attributes is a possibly empty list of attributes.  Any
  995. X     attribute defined in the ATTRIBUTES section above may be
  996. X     specified.  All attributes will be applied to the list of
  997. X     named targets in the rule definition.  No other targets will
  998. X     be affected.
  999. X
  1000. X
  1001. X     NOTE:   As stated earlier, if both the target list and
  1002. X             prerequisite list are empty but the attributes list
  1003. X             is not, then the specified attributes affect all
  1004. X             targets in the makefile.
  1005. X
  1006. X
  1007. X     ruleop is a separator which is used to identify the targets
  1008. X     from the prerequisites.  Optionally it also provides a
  1009. X     facility for modifying the way in which dmake handles the
  1010. X     making of the associated targets.  In its simplest form the
  1011. X     operator is a single ':', and need not be separated by white
  1012. X     space from its neighboring tokens.  It may additionally be
  1013. X     followed by any of the modifiers { !, ^, -, : }, where:
  1014. X
  1015. X
  1016. X
  1017. X
  1018. XVersion 3.50                    UW                             14
  1019. X
  1020. X
  1021. X
  1022. X
  1023. XDMAKE(p)               Unsupported Software               DMAKE(p)
  1024. X
  1025. X
  1026. X
  1027. X     !    says execute the recipe for the associated targets once
  1028. X          for each out of date prerequisite.  Ordinarily the
  1029. X          recipe is executed once for all out of date prere-
  1030. X          quisites at the same time.
  1031. X
  1032. X     ^    says to insert the specified prerequisites, if any,
  1033. X          before any other prerequisites already associated with
  1034. X          the specified targets.  In general, it is not useful to
  1035. X          specify ^ with an empty list of prerequisites.
  1036. X
  1037. X     -    says to clear the previous list of prerequisites before
  1038. X          adding the new prerequisites.  Thus,
  1039. X
  1040. X               .SUFFIXES :
  1041. X               .SUFFIXES : .a .b
  1042. X
  1043. X          can be replaced by
  1044. X
  1045. X               .SUFFIXES :- .a .b
  1046. X
  1047. X          however the old form still works as expected.  NOTE:
  1048. X          .SUFFIXES is ignored by dmake it is used here simply as
  1049. X          an example.
  1050. X
  1051. X     :    When the rule operator is not modified by a second ':'
  1052. X          only one set of rules may be specified for making a
  1053. X          target.  Multiple definitions may be used to add to the
  1054. X          list of prerequisites that a target depends on.  How-
  1055. X          ever, if a target is multiply defined only one defini-
  1056. X          tion may specify a recipe for making the target.
  1057. X
  1058. X          When a target's rule operator is modified by a second
  1059. X          ':' (:: for example) then this definition may not be
  1060. X          the only definition with a recipe for the target.
  1061. X          There may be other :: target definition lines that
  1062. X          specify a different set of prerequisites with a dif-
  1063. X          ferent recipe for updating the target. Any such target
  1064. X          is made if any of the definitions find it to be out of
  1065. X          date with respect to the related prerequisites and uses
  1066. X          the corresponding recipe to update the target.
  1067. X
  1068. X          In the following simple example, each rule has a `::'
  1069. X          ruleop.  In such an operator we call the first `:' the
  1070. X          operator, and the second `:' the modifier.
  1071. X
  1072. X          a.o :: a.c b.h
  1073. X             first recipe for making a.o
  1074. X
  1075. X          a.o :: a.y b.h
  1076. X             second recipe for making a.o
  1077. X
  1078. X          If a.o is found to be out of date with respect to a.c
  1079. X
  1080. X
  1081. X
  1082. XVersion 3.50                    UW                             15
  1083. X
  1084. X
  1085. X
  1086. X
  1087. XDMAKE(p)               Unsupported Software               DMAKE(p)
  1088. X
  1089. X
  1090. X
  1091. X          then the first recipe is used to make a.o.  If it is
  1092. X          found out of date with respect to a.y then the second
  1093. X          recipe is used.  If a.o is out of date with respect to
  1094. X          b.h then both recipes are invoked to make a.o.  In the
  1095. X          last case the order of invocation corresponds to the
  1096. X          order in which the rule definitions appear in the
  1097. X          makefile.
  1098. X
  1099. X     Targets defined using a single `:' operator with a recipe
  1100. X     may be redefined again with a new recipe by using a `:'
  1101. X     operator with a `:' modifier.  This is equivalent to a tar-
  1102. X     get having been initially defined with a rule using a `:'
  1103. X     modifier.  Once a target is defined using a `:' modifier it
  1104. X     may not be defined again with a recipe using only the `:'
  1105. X     operator with no `:' modifier.  In both cases the use of a
  1106. X     `:' modifier creates a new list of prerequisites and makes
  1107. SHAR_EOF
  1108. echo "End of part 12"
  1109. echo "File man/dmake.nc is continued in part 13"
  1110. echo "13" > s2_seq_.tmp
  1111. exit 0
  1112.  
  1113.