home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume20 / dmake / patch02c < prev    next >
Encoding:
Text File  |  1991-06-29  |  38.4 KB  |  947 lines

  1. Newsgroups: comp.sources.misc
  2. From: Dennis Vadura <dvadura@watdragon.waterloo.edu>
  3. Subject:  v20i078:  dmake - dmake version 3.7, Patch02c/12
  4. Message-ID: <1991Jun29.222527.4070@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 998f407846e91d1f769152ca49a826e1
  6. Date: Sat, 29 Jun 1991 22:25:27 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Dennis Vadura <dvadura@watdragon.waterloo.edu>
  10. Posting-number: Volume 20, Issue 78
  11. Archive-name: dmake/patch02c
  12. Patch-To: dmake: Volume 19, Issue 22-58
  13.  
  14. #!/bin/sh
  15. # this is dp2.02 (part 2 of a multipart archive)
  16. # do not concatenate these parts, unpack them in order with /bin/sh
  17. # file dm37p2 continued
  18. #
  19. if test ! -r _shar_seq_.tmp; then
  20.     echo 'Please unpack part 1 first!'
  21.     exit 1
  22. fi
  23. (read Scheck
  24.  if test "$Scheck" != 2; then
  25.     echo Please unpack part "$Scheck" next!
  26.     exit 1
  27.  else
  28.     exit 0
  29.  fi
  30. ) < _shar_seq_.tmp || exit 1
  31. if test ! -f _shar_wnt_.tmp; then
  32.     echo 'x - still skipping dm37p2'
  33. else
  34. echo 'x - continuing file dm37p2'
  35. sed 's/^X//' << 'SHAR_EOF' >> 'dm37p2' &&
  36. XX                 attribute string must be quoted using ".  If a
  37. XX                 target having this attribute set also has the
  38. XX                 .IGNORE attribute set then if the change to the
  39. XX                 specified directory fails it will be ignored,
  40. XX                 and no error message will be issued.
  41. XX
  42. XX     ..SSIILLEENNTT     Do not echo the recipe lines when making any
  43. XX                 target with this attribute set, and do not issue
  44. XX                 any warnings.
  45. XX
  46. XX     ..SSWWAAPP       Under MSDOS when making a target with this
  47. XX                 attribute set swap the ddmmaakkee executable to disk
  48. XX                 prior to executing the recipe line.  Also see
  49. XX                 the '%' recipe line flag defined in the RECIPES
  50. XX                 section.
  51. XX
  52. XX     ..SSYYMMBBOOLL     Target is a library member and is an entry point
  53. XX                 into a module in the library.  This attribute is
  54. XX                 used only when searching a library for a target.
  55. XX                 Targets of the form lib((entry)) have this
  56. XX                 attribute set automatically.
  57. XX
  58. XX     ..UUSSEESSHHEELLLL   Force each recipe line of a target to be exe-
  59. XX                 cuted using a shell.  Specifying this attribute
  60. XX                 is equivalent to specifying the '+' character at
  61. XX                 the start of each line of a non-group recipe.
  62. XX
  63. XX     ..UUPPDDAATTEEAALLLL  Indicates that all the targets listed in this
  64. XX                 rule are updated by the execution of the accom-
  65. XX                 panying recipe.  A common example is the produc-
  66. XX                 tion of the _y_._t_a_b_._c and _y_._t_a_b_._h files by yyaacccc
  67. XX                 when it is run on a grammar.  Specifying
  68. XX                 .UPDATEALL in such a rule prevents the running
  69. XX                 of yacc twice, once for the y.tab.c file and
  70. XX                 once for the y.tab.h file.
  71. XX
  72. XX
  73. XX     All attributes are user setable and except for .UPDATEALL,
  74. XX     .SETDIR and .MKSARGS may be used in one of two forms.  The
  75. XX     .MKSARGS attribute is restricted to use as a global attri-
  76. XX     bute, and the use of the .UPDATEALL and .SETDIR attributes
  77. XX     is restricted to rules of the second form only.
  78. XX
  79. XX          ATTRIBUTE_LIST : _t_a_r_g_e_t_s
  80. XX
  81. XX     assigns the attributes specified by ATTRIBUTE_LIST to each
  82. XX     target in _t_a_r_g_e_t_s or
  83. XX
  84. XX
  85. XX
  86. XVersion 3.70                    UW                             11
  87. XX
  88. XX
  89. XX
  90. XX
  91. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  92. XX
  93. XX
  94. XX
  95. XX          _t_a_r_g_e_t_s ATTRIBUTE_LIST : ...
  96. XX
  97. XX     assigns the attributes specified by ATTRIBUTE_LIST to each
  98. XX     target in _t_a_r_g_e_t_s_. In the first form if _t_a_r_g_e_t_s is empty
  99. XX     (ie. a NULL list), then the list of attributes will apply to
  100. XX     all targets in the makefile (this is equivalent to the com-
  101. XX     mon Make construct of _"_._I_G_N_O_R_E _:_" but has been modified to
  102. XX     the notion of an attribute instead of a special target).
  103. XX     Not all of the attributes have global meaning.  In particu-
  104. XX     lar, .LIBRARY, .SYMBOL, and .UPDATEALL have no assigned glo-
  105. XX     bal meaning.
  106. XX
  107. XX     Any attribute may be used with any target, even with the
  108. XX     special targets.  Some combinations are useless (e.g.
  109. XX     .INCLUDE .PRECIOUS: ... ), while others are useful (e.g.
  110. XX     .INCLUDE .IGNORE : "file.mk" will not complain if file.mk
  111. XX     cannot be found using the include file search rules, see the
  112. XX     section on SPECIAL TARGETS for a description of .INCLUDE).
  113. XX     If a specified attribute will not be used with the special
  114. XX     target a warning is issued and the attribute is ignored.
  115. XX
  116. XMMAACCRROOSS
  117. XX     ddmmaakkee supports six types of macro assignment.
  118. XX
  119. XX
  120. XX     MMAACCRROO == LLIINNEE    This is the most common and familiar form of
  121. XX                     macro assignment.  It assigns LINE literally
  122. XX                     as the value of MACRO.  Future expansions of
  123. XX                     MACRO recursively expand its value.
  124. XX
  125. XX     MMAACCRROO **== LLIINNEE   This form behaves exactly as the simple '='
  126. XX                     form with the exception that if MACRO
  127. XX                     already has a value then the assignment is
  128. XX                     not performed.
  129. XX
  130. XX     MMAACCRROO ::== LLIINNEE   This form differs from the simple '=' form
  131. XX                     in that it expands LINE prior to assigning
  132. XX                     it as the value of MACRO.  Future expansions
  133. XX                     of MACRO do not recursively expand its
  134. XX                     value.
  135. XX
  136. XX     MMAACCRROO **::== LLIINNEE  This form behaves exactly as the ':=' form
  137. XX                     with the exception that if MACRO already has
  138. XX                     a value then the assignment and expansion
  139. XX                     are not performed.
  140. XX
  141. XX     MMAACCRROO ++== LLIINNEE   This form of macro assignment allows macro
  142. XX                     values to grow.  It takes the literal value
  143. XX                     of LINE and appends it to the previous value
  144. XX                     of MACRO separating the two by a single
  145. XX                     space.  Future expansions of MACRO recur-
  146. XX                     sively expand its value.
  147. XX
  148. XX
  149. XX
  150. XVersion 3.70                    UW                             12
  151. XX
  152. XX
  153. XX
  154. XX
  155. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  156. XX
  157. XX
  158. XX
  159. XX     MMAACCRROO ++::== LLIINNEE  This form is similar to the '+=' form except
  160. XX                     that the value of LINE is expanded prior to
  161. XX                     being added to the value of MACRO.
  162. XX
  163. XX     Macro expressions specified on the command line allow the
  164. XX     macro value to be redefined within the makefile only if the
  165. XX     macro is defined using the '+=' and '+:=' operators.  Other
  166. XX     operators will define a macro that cannot be further modi-
  167. XX     fied.
  168. XX
  169. XX     When ddmmaakkee defines a non-environment macro it strips leading
  170. XX     and trailing white space from the macro value.  Macros
  171. XX     imported from the environment via either the .IMPORT special
  172. XX     target (see the SPECIAL TARGETS section), or the --ee, or --EE
  173. XX     flags are an exception to this rule.  Their values are
  174. XX     always taken literally and white space is never stripped.
  175. XX     In addition, named macros defined using the .IMPORT special
  176. XX     target do not have their values expanded when they are used
  177. XX     within a makefile.  In contrast, environment macros that are
  178. XX     imported due to the specification of the --ee or --EE flags are
  179. XX     subject to expansion when used.
  180. XX
  181. XX     To specify a macro expansion enclose the name in () or {}
  182. XX     and precede it with a dollar sign $.  Thus $(TEST)
  183. XX     represents an expansion of the macro variable named TEST.
  184. XX     If TEST is defined then $(TEST) is replaced by its expanded
  185. XX     value.  If TEST is not defined then $(TEST) expands to the
  186. XX     NULL string (this is equivalent to defining a macro as
  187. XX     'TEST=' ).  A short form may be used for single character
  188. XX     named macros.  In this case the parentheses are optional,
  189. XX     and $(I) is equivalent to $I.  Macro expansion is recursive,
  190. XX     hence, if the value string contains an expression represent-
  191. XX     ing a macro expansion, the expansion is performed.  Circular
  192. XX     macro expansions are detected and cause an error to be
  193. XX     issued.
  194. XX
  195. XX     When defining a macro the given macro name is first expanded
  196. XX     before being used to define the macro.  Thus it is possible
  197. XX     to define macros whose names depend on values of other mac-
  198. XX     ros.  For example, suppose CWD is defined as
  199. XX
  200. XX          CWD = $(PWD:b)
  201. XX
  202. XX     then the value of $(CWD) is the name of the current direc-
  203. XX     tory.  This can be used to define macros specific to this
  204. XX     directory, for example:
  205. XX
  206. XX          _$(CWD).prt = list of files to print...
  207. XX
  208. XX     The actual name of the defined macro is a function of the
  209. XX     current directory.  A construct such as this is useful when
  210. XX     processing a hierarchy of directories using .SETDIR
  211. XX
  212. XX
  213. XX
  214. XVersion 3.70                    UW                             13
  215. XX
  216. XX
  217. XX
  218. XX
  219. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  220. XX
  221. XX
  222. XX
  223. XX     attributed targets and a collection of small distributed
  224. XX     makefile stubs.
  225. XX
  226. XX     Macro variables may be defined within the makefile, on the
  227. XX     command line, or imported from the environment.
  228. XX
  229. XX     ddmmaakkee supports several non-standard macro expansions: The
  230. XX     first is of the form:
  231. XX
  232. XX          _$_(_m_a_c_r_o___n_a_m_e_:_m_o_d_i_f_i_e_r___l_i_s_t_:_m_o_d_i_f_i_e_r___l_i_s_t_:_._._._)
  233. XX
  234. XX     where _m_o_d_i_f_i_e_r___l_i_s_t is chosen from the set { D or d, F or f,
  235. XX     B or b, S or s, T or t } and
  236. XX
  237. XX          d - directory portion of all path names
  238. XX          f - file (including suffix) portion of path names
  239. XX          b - file (not including suffix) portion of path names
  240. XX          s - simple pattern substitution
  241. XX          t - tokenization.
  242. XX
  243. XX     Thus if we have the example:
  244. XX
  245. XX          test = d1/d2/d3/a.out f.out d1/k.out
  246. XX
  247. XX     The following macro expansions produce the values on the
  248. XX     right of '->' after expansion.
  249. XX
  250. XX          $(test:d)            -> d1/d2/d3/ d1/
  251. XX          $(test:b)            -> a f k
  252. XX          $(test:f)            -> a.out f.out k.out
  253. XX          ${test:db}           -> d1/d2/d3/a f d1/k
  254. XX          ${test:s/out/in/:f}  -> a.in f.in k.in
  255. XX          $(test:f:t"+")       -> a.out+f.out+k.out
  256. XX
  257. XX     If a token ends in a string composed from the value of the
  258. XX     macro DIRBRKSTR (ie. ends in a directory separator string,
  259. XX     e.g. '/' in UNIX) and you use the ::dd modifier then the
  260. XX     expansion returns the directory name less the final direc-
  261. XX     tory separator string.  Thus successive pairs of :d modif-
  262. XX     iers each remove a level of directory in the token string.
  263. XX
  264. XX     The tokenization modifier takes all white space separated
  265. XX     tokens from the macro value and separates them by the quoted
  266. XX     separator string.  The separator string may contain the fol-
  267. XX     lowing escape codes \a => <bel>, \b => <backspace>, \f =>
  268. XX     <formfeed>, \n => <nl>, \r => <cr>, \t => <tab>, \v =>
  269. XX     <vertical tab>, \" => ", and \xxx => <xxx> where xxx is the
  270. XX     octal representation of a character.  Thus the expansion:
  271. XX
  272. XX          $(test:f:t"+\n")
  273. XX     produces:
  274. XX          a.out+
  275. XX
  276. XX
  277. XX
  278. XVersion 3.70                    UW                             14
  279. XX
  280. XX
  281. XX
  282. XX
  283. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  284. XX
  285. XX
  286. XX
  287. XX          f.out+
  288. XX          k.out
  289. XX
  290. XX     The second non-standard form of macro expansion allows for
  291. XX     recursive macros.  It is possible to specify a $(_m_a_c_r_o___n_a_m_e)
  292. XX     or ${_m_a_c_r_o___n_a_m_e} expansion where _m_a_c_r_o___n_a_m_e contains more $(
  293. XX     ... ) or ${ ... } macro expansions itself.
  294. XX
  295. XX     For example $(CC$(_HOST)$(_COMPILER)) will first expand
  296. XX     CC$(_HOST)$(_COMPILER) to get a result and use that result
  297. XX     as the name of the macro to expand.  This is useful for
  298. XX     writing a makefile for more than one target environment.  As
  299. XX     an example consider the following hypothetical case. Suppose
  300. XX     that _HOST and _COMPILER are imported from the environment
  301. XX     and are set to represent the host machine type and the host
  302. XX     compiler respectively.
  303. XX
  304. XX          CFLAGS_VAX_CC = -c -O     # _HOST == "_VAX", _COMPILER == "_CC"
  305. XX          CFLAGS_PC_MSC = -c -ML # _HOST == "_PC",  _COMPILER == "_MSC"
  306. XX
  307. XX          # redefine CFLAGS macro as:
  308. XX
  309. XX          CFLAGS := $(CFLAGS$(_HOST)$(_COMPILER))
  310. XX
  311. XX     This causes CFLAGS to take on a value that corresponds to
  312. XX     the environment in which the make is being invoked.
  313. XX
  314. XX     The final non-standard macro expansion is of the form:
  315. XX
  316. XX          string1{token_list}string2
  317. XX
  318. XX     where string1, string2 and token_list are expanded.  After
  319. XX     expansion, string1 is prepended to each token found in
  320. XX     token_list and string2 is appended to each resulting token
  321. XX     from the previous prepend.  string1 and string2 are not del-
  322. XX     imited by white space whereas the tokens in token_list are.
  323. XX     A null token in the token list is specified using "".  Thus
  324. XX     using another example we have:
  325. XX
  326. XX          test/{f1 f2}.o     --> test/f1.o test/f2.o
  327. XX          test/ {f1 f2}.o    --> test/ f1.o f2.o
  328. XX          test/{f1 f2} .o    --> test/f1 test/f2 .o
  329. XX          test/{"f1"  ""}.o  --> test/f1.o test/.o
  330. XX
  331. XX          and
  332. XX
  333. XX          test/{d1 d2}/{f1 f2}.o --> test/d1/f1.o test/d1/f2.o
  334. XX                                     test/d2/f1.o test/d2/f2.o
  335. XX
  336. XX     This last expansion is activated only when the first charac-
  337. XX     ters of _t_o_k_e_n___l_i_s_t appear immediately after the opening '{'
  338. XX     with no intervening white space.  The reason for this
  339. XX
  340. XX
  341. XX
  342. XVersion 3.70                    UW                             15
  343. XX
  344. XX
  345. XX
  346. XX
  347. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  348. XX
  349. XX
  350. XX
  351. XX     restriction is the following incompatibility with Bourne
  352. XX     Shell recipes.  The line
  353. XX
  354. XX          { echo hello;}
  355. XX
  356. XX     is valid /bin/sh syntax; while
  357. XX
  358. XX          {echo hello;}
  359. XX
  360. XX     is not.  Hence the latter triggers the enhanced macro expan-
  361. XX     sion while the former causes it to be suppressed.  See the
  362. XX     SPECIAL MACROS section for a description of the special mac-
  363. XX     ros that ddmmaakkee defines and understands.
  364. XX
  365. XRRUULLEESS AANNDD TTAARRGGEETTSS
  366. XX     A makefile contains a series of entries that specify depen-
  367. XX     dencies.  Such entries are called _t_a_r_g_e_t_/_p_r_e_r_e_q_u_i_s_i_t_e or
  368. XX     _r_u_l_e definitions.  Each rule definition is optionally fol-
  369. XX     lowed by a set of lines that provide a recipe for updating
  370. XX     any targets defined by the rule.  Whenever ddmmaakkee attempts to
  371. XX     bring a target up to date and an explicit recipe is provided
  372. XX     with a rule defining the target, that recipe is used to
  373. XX     update the target.  A rule definition begins with a line
  374. XX     having the following syntax:
  375. XX
  376. XX          _<_t_a_r_g_e_t_s_> [_<_a_t_t_r_i_b_u_t_e_s_>] _<_r_u_l_e_o_p_> [_<_p_r_e_r_e_q_u_i_s_i_t_e_s_>] [;_<_r_e_c_i_p_e_>]
  377. XX
  378. XX     _t_a_r_g_e_t_s is a non-empty list of targets.  If the target is a
  379. XX     special target (see SPECIAL TARGETS section below) then it
  380. XX     must appear alone on the rule line.  For example:
  381. XX
  382. XX          .IMPORT .ERROR : ...
  383. XX
  384. XX     is not allowed since both .IMPORT and .ERROR are special
  385. XX     targets.  Special targets are not used in the construction
  386. XX     of the dependency graph and will not be made.
  387. XX
  388. XX     _a_t_t_r_i_b_u_t_e_s is a possibly empty list of attributes.  Any
  389. XX     attribute defined in the ATTRIBUTES section above may be
  390. XX     specified.  All attributes will be applied to the list of
  391. XX     named targets in the rule definition.  No other targets will
  392. XX     be affected.
  393. XX
  394. XX
  395. XX     NOTE:   As stated earlier, if both the target list and
  396. XX             prerequisite list are empty but the attributes list
  397. XX             is not, then the specified attributes affect all
  398. XX             targets in the makefile.
  399. XX
  400. XX
  401. XX     _r_u_l_e_o_p is a separator which is used to identify the targets
  402. XX     from the prerequisites.  Optionally it also provides a
  403. XX
  404. XX
  405. XX
  406. XVersion 3.70                    UW                             16
  407. XX
  408. XX
  409. XX
  410. XX
  411. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  412. XX
  413. XX
  414. XX
  415. XX     facility for modifying the way in which ddmmaakkee handles the
  416. XX     making of the associated targets.  In its simplest form the
  417. XX     operator is a single ':', and need not be separated by white
  418. XX     space from its neighboring tokens.  It may additionally be
  419. XX     followed by any of the modifiers { !, ^, -, : }, where:
  420. XX
  421. XX
  422. XX     !!    says execute the recipe for the associated targets once
  423. XX          for each out of date prerequisite.  Ordinarily the
  424. XX          recipe is executed once for all out of date prere-
  425. XX          quisites at the same time.
  426. XX
  427. XX     ^^    says to insert the specified prerequisites, if any,
  428. XX          before any other prerequisites already associated with
  429. XX          the specified targets.  In general, it is not useful to
  430. XX          specify ^ with an empty list of prerequisites.
  431. XX
  432. XX     --    says to clear the previous list of prerequisites before
  433. XX          adding the new prerequisites.  Thus,
  434. XX
  435. XX               .SUFFIXES :
  436. XX               .SUFFIXES : .a .b
  437. XX
  438. XX          can be replaced by
  439. XX
  440. XX               .SUFFIXES :- .a .b
  441. XX
  442. XX          however the old form still works as expected.  NOTE:
  443. XX          .SUFFIXES is ignored by ddmmaakkee it is used here simply as
  444. XX          an example.
  445. XX
  446. XX     ::    When the rule operator is not modified by a second ':'
  447. XX          only one set of rules may be specified for making a
  448. XX          target.  Multiple definitions may be used to add to the
  449. XX          list of prerequisites that a target depends on.  How-
  450. XX          ever, if a target is multiply defined only one defini-
  451. XX          tion may specify a recipe for making the target.
  452. XX
  453. XX          When a target's rule operator is modified by a second
  454. XX          ':' (:: for example) then this definition may not be
  455. XX          the only definition with a recipe for the target.
  456. XX          There may be other :: target definition lines that
  457. XX          specify a different set of prerequisites with a dif-
  458. XX          ferent recipe for updating the target. Any such target
  459. XX          is made if any of the definitions find it to be out of
  460. XX          date with respect to the related prerequisites and the
  461. XX          corresponding recipe is used to update the target.
  462. XX
  463. XX          In the following simple example, each rule has a `::'
  464. XX          _r_u_l_e_o_p.  In such an operator we call the first `:' the
  465. XX          operator, and the second `:' the modifier.
  466. XX
  467. XX
  468. XX
  469. XX
  470. XVersion 3.70                    UW                             17
  471. XX
  472. XX
  473. XX
  474. XX
  475. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  476. XX
  477. XX
  478. XX
  479. XX          a.o :: a.c b.h
  480. XX             first recipe for making a.o
  481. XX
  482. XX          a.o :: a.y b.h
  483. XX             second recipe for making a.o
  484. XX
  485. XX          If a.o is found to be out of date with respect to a.c
  486. XX          then the first recipe is used to make a.o.  If it is
  487. XX          found out of date with respect to a.y then the second
  488. XX          recipe is used.  If a.o is out of date with respect to
  489. XX          b.h then both recipes are invoked to make a.o.  In the
  490. XX          last case the order of invocation corresponds to the
  491. XX          order in which the rule definitions appear in the
  492. XX          makefile.
  493. XX
  494. XX     Targets defined using a single `:' operator with a recipe
  495. XX     may be redefined again with a new recipe by using a `:'
  496. XX     operator with a `:' modifier.  This is equivalent to a tar-
  497. XX     get having been initially defined with a rule using a `:'
  498. XX     modifier.  Once a target is defined using a `:' modifier it
  499. XX     may not be defined again with a recipe using only the `:'
  500. XX     operator with no `:' modifier.  In both cases the use of a
  501. XX     `:' modifier creates a new list of prerequisites and makes
  502. XX     it the current prerequisite list for the target.  The `:'
  503. XX     operator with no recipe always modifies the current list of
  504. XX     prerequisites.  Thus assuming each of the following defini-
  505. XX     tions has a recipe attached, then:
  506. XX
  507. XX          joe :  fred ...     (1)
  508. XX          joe :: more ...     (2)
  509. XX
  510. XX          and
  511. XX
  512. XX          joe :: fred ...     (3)
  513. XX          joe :: more ...     (4)
  514. XX
  515. XX     are legal and mean:  add the recipe associated with (2), or
  516. XX     (4) to the set of recipes for joe, placing them after exist-
  517. XX     ing recipes for making joe.  The constructs:
  518. XX
  519. XX          joe :: fred ...     (5)
  520. XX          joe : more ... (6)
  521. XX
  522. XX          and
  523. XX
  524. XX          joe : fred ... (7)
  525. XX          joe : more ... (8)
  526. XX
  527. XX     are errors since we have two sets of perfectly good recipes
  528. XX     for making the target.
  529. XX
  530. XX
  531. XX
  532. XX
  533. XX
  534. XVersion 3.70                    UW                             18
  535. XX
  536. XX
  537. XX
  538. XX
  539. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  540. XX
  541. XX
  542. XX
  543. XX     _p_r_e_r_e_q_u_i_s_i_t_e_s is a possibly empty list of targets that must
  544. XX     be brought up to date before making the current target.
  545. XX
  546. XX     _r_e_c_i_p_e is a short form and allows the user to specify short
  547. XX     rule definitions on a single line.  It is taken to be the
  548. XX     first recipe line in a larger recipe if additional lines
  549. XX     follow the rule definition.  If the semi-colon is present
  550. XX     but the recipe line is empty (ie. null string) then it is
  551. XX     taken to be an empty rule.  Any target so defined causes the
  552. XX     _D_o_n_'_t _k_n_o_w _h_o_w _t_o _m_a_k_e _._._. error message to be suppressed
  553. XX     when ddmmaakkee tries to make the target and fails.  This silence
  554. XX     is maintained for rules that are terminated by a semicolon
  555. XX     and have no following recipe lines, for targets listed on
  556. XX     the command line, for the first target found in the
  557. XX     makefile, and for any target having no recipe but containing
  558. XX     a list of prerequisites (see the COMPATIBILITY section for
  559. XX     an exception to this rule if the AUGMAKE (--AA) flag was
  560. XX     specified.
  561. XX
  562. XRREECCIIPPEESS
  563. XX     The traditional format used by most versions of Make defines
  564. XX     the recipe lines as arbitrary strings that may contain macro
  565. XX     expansions.  They follow a rule definition line and may be
  566. XX     spaced apart by comment or blank lines.  The list of recipe
  567. XX     lines defining the recipe is terminated by a new target
  568. XX     definition, a macro definition, or end-of-file.  Each recipe
  569. XX     line MMUUSSTT begin with a <<TTAABB>> character which may optionally
  570. XX     be followed with one or all of the characters _'_@_%_+_-_'.  The
  571. XX     _'_-_' indicates that non-zero exit values (ie. errors) are to
  572. XX     be ignored when this recipe line is executed, the _'_+_' indi-
  573. XX     cates that the current recipe line is to be executed using
  574. XX     the shell, the _'_%_' indicates that ddmmaakkee should swap itself
  575. XX     out to secondary storage (MSDOS only) before running the
  576. XX     recipe and the _'_@_' indicates that the recipe line should NOT
  577. XX     be echoed to the terminal prior to being executed.  Each
  578. XX     switch is off by default (ie. by default, errors are signi-
  579. XX     ficant, commands are echoed, no swapping is done and a shell
  580. XX     is used only if the recipe line contains a character found
  581. XX     in the value of the SHELLMETAS macro).  Global settings
  582. XX     activated via command line options or special attribute or
  583. XX     target names may also affect these settings.  An example
  584. XX     recipe:
  585. XX
  586. XX          target :
  587. XX               first recipe line
  588. XX               second recipe line, executed independently of the first.
  589. XX               @a recipe line that is not echoed
  590. XX               -and one that has errors ignored
  591. XX               %and one that causes dmake to swap out
  592. XX               +and one that is executed using a shell.
  593. XX
  594. XX
  595. XX
  596. XX
  597. XX
  598. XVersion 3.70                    UW                             19
  599. XX
  600. XX
  601. XX
  602. XX
  603. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  604. XX
  605. XX
  606. XX
  607. XX     The second and new format of the recipe block begins the
  608. XX     block with the character '[' (the open group character) in
  609. XX     the last non-white space position of a line, and terminates
  610. XX     the block with the character ']' (the close group character)
  611. XX     in the first non-white space position of a line.  In this
  612. XX     form each recipe line need not have a leading TAB.  This is
  613. XX     called a recipe group.  Groups so defined are fed intact as
  614. XX     a single unit to a shell for execution whenever the
  615. XX     corresponding target needs to be updated.  If the open group
  616. XX     character '[' is preceded by one or all of -, @ or % then
  617. XX     they apply to the entire group in the same way that they
  618. XX     apply to single recipe lines.  You may also specify '+' but
  619. XX     it is redundant as a shell is already being used to run the
  620. XX     recipe.  See the MAKING TARGETS section for a description of
  621. XX     how ddmmaakkee invokes recipes.  Here is an example of a group
  622. XX     recipe:
  623. XX
  624. XX          target :
  625. XX          [
  626. XX               first recipe line
  627. XX               second recipe line
  628. XX               all of these recipe lines are fed to a
  629. XX               single copy of a shell for execution.
  630. XX          ]
  631. XX
  632. XX
  633. XTTEEXXTT DDIIVVEERRSSIIOONNSS
  634. XX     ddmmaakkee supports the notion of text diversions.  If a recipe
  635. XX     line contains the macro expression
  636. XX
  637. XX          $(mktmp[,[_f_i_l_e][,_t_e_x_t]] _d_a_t_a)
  638. XX
  639. XX     then all text contained in the _d_a_t_a expression is expanded
  640. XX     and is written to a temporary file.  The return value of the
  641. XX     macro is the name of the temporary file.
  642. XX
  643. XX     _d_a_t_a can be any text and must be separated from the 'mktmp'
  644. XX     portion of the macro name by white-space.  The only restric-
  645. XX     tion on the data text is that it must contain a balanced
  646. XX     number of parentheses of the same kind as are used to ini-
  647. XX     tiate the $(mktmp ...) expression.  For example:
  648. XX
  649. XX          $(mktmp $(XXX))
  650. XX
  651. XX     is legal and works as expected, but:
  652. XX
  653. XX          $(mktmp text (to dump to file)
  654. XX
  655. XX     is not legal.  You can achieve what you wish by either
  656. XX     defining a macro that expands to '(' or by using {} in the
  657. XX     macro expression; like this:
  658. XX
  659. XX
  660. XX
  661. XX
  662. XVersion 3.70                    UW                             20
  663. XX
  664. XX
  665. XX
  666. XX
  667. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  668. XX
  669. XX
  670. XX
  671. XX          ${mktmp text (to dump to file}
  672. XX
  673. XX     Since the temporary file is opened when the macro containing
  674. XX     the text diversion expression is expanded, diversions may
  675. XX     now be nested and any diversions that are created as part of
  676. XX     ':=' macro expansions persist for the duration of the ddmmaakkee
  677. XX     run.  The diversion text may contain the same escape codes
  678. XX     as those described in the MACROS section.  Thus if the _d_a_t_a
  679. XX     text is to contain new lines they must be inserted using the
  680. XX     \n escape sequence.  For example the expression:
  681. XX
  682. XX          all:
  683. XX               cat $(mktmp this is a\n\
  684. XX               test of the text diversion\n)
  685. XX
  686. XX     is replaced by:
  687. XX
  688. XX          cat /tmp/mk12294AA
  689. XX
  690. XX     where the temporary file contains two lines both of which
  691. XX     are terminated by a new-line.  If the _d_a_t_a text spans multi-
  692. XX     ple lines in the makefile then each line must be continued
  693. XX     via the use of a \.  A second more illustrative example gen-
  694. XX     erates a response file to an MSDOS link command:
  695. XX
  696. XX          OBJ = fred.obj mary.obj joe.obj
  697. XX          all : $(OBJ)
  698. XX               link @$(mktmp $(^:t"+\n")\n)
  699. XX
  700. XX     The result of making `all' in the second example is the com-
  701. XX     mand:
  702. XX
  703. XX          link @/tmp/mk02394AA
  704. XX
  705. XX     where the temporary file contains:
  706. XX
  707. XX          fred.obj+
  708. XX          mary.obj+
  709. XX          joe.obj
  710. XX
  711. XX     The last line of the file is terminated by a new-line which
  712. XX     is inserted due to the \n found at the end of the _d_a_t_a
  713. XX     string.
  714. XX
  715. XX     If the optional _f_i_l_e specifier is present then its expanded
  716. XX     value is the name of the temporary file to create.  Whenever
  717. XX     a $(mktmp ...) macro is expanded the macro $(TMPFILE) is set
  718. XX     to a new temporary file name.  Thus the construct:
  719. XX
  720. XX          $(mktmp,$(TMPFILE) data)
  721. XX
  722. XX     is completely equivalent to not specifying the $(TMPFILE)
  723. XX
  724. XX
  725. XX
  726. XVersion 3.70                    UW                             21
  727. XX
  728. XX
  729. XX
  730. XX
  731. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  732. XX
  733. XX
  734. XX
  735. XX     optional argument.  Another example that would be useful for
  736. XX     MSDOS users with a Turbo-C compiler
  737. XX
  738. XX          $(mktmp,turboc.cfg $(CFLAGS))
  739. XX
  740. XX     will place the contents of CFLAGS into a local _t_u_r_b_o_c_._c_f_g
  741. XX     file.  The second optional argument, _t_e_x_t, if present alters
  742. XX     the name of the value returned by the $(mktmp ...) macro.
  743. XX
  744. XX     Under MS-DOS text diversions may be a problem.  Many DOS
  745. XX     tools require that path names which contain directories use
  746. XX     the \ character to delimit the directories.  Some users how-
  747. XX     ever wish to use the '/' to delimit pathnames and use
  748. XX     environments that allow them to do so.  The macro USESHELL
  749. XX     is set to "yes" if the current recipe is forced to use a
  750. XX     shell via the .USESHELL or '+' directives, otherwise its
  751. XX     value is "no".  The ddmmaakkee startup files define the macro
  752. XX     DIVFILE whose value is either the value of TMPFILE or the
  753. XX     value of TMPFILE edited to replace any '/' characters to the
  754. XX     appropriate value based on the current shell and whether it
  755. XX     will be used to execute the recipe.
  756. XX
  757. XX     Previous versions of ddmmaakkee defined text diversions using <+,
  758. XX     +> strings, where <+ started a text diversion and +> ter-
  759. XX     minated one.  ddmmaakkee is backward compatible with this con-
  760. XX     struct if the <+ and +> appear literally on the same recipe
  761. XX     line or in the same macro value string.  In such instances
  762. XX     the expression:
  763. XX
  764. XX          <+data+>
  765. XX
  766. XX     is mapped to:
  767. XX
  768. XX          $(mktmp data)
  769. XX
  770. XX     which is fully output compatible with the earlier construct.
  771. XX     <+, +> constructs whose text spans multiple lines must be
  772. XX     converted by hand to use $(mktmp ...).
  773. XX
  774. XX     If the environment variable TMPDIR is defined then the tem-
  775. XX     porary file is placed into the directory specified by that
  776. XX     variable.  A makefile can modify the location of temporary
  777. XX     files by defining a macro named TMPDIR and exporting it
  778. XX     using the .EXPORT special target.
  779. XX
  780. XSSPPEECCIIAALL TTAARRGGEETTSS
  781. XX     This section describes the special targets that are recog-
  782. XX     nized by ddmmaakkee.  Some are affected by attributes and others
  783. XX     are not.
  784. XX
  785. XX     ..EERRRROORR        If defined then the recipe associated with
  786. XX                   this target is executed whenever an error
  787. XX
  788. XX
  789. XX
  790. XVersion 3.70                    UW                             22
  791. XX
  792. XX
  793. XX
  794. XX
  795. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  796. XX
  797. XX
  798. XX
  799. XX                   condition is detected by ddmmaakkee.  All attri-
  800. XX                   butes that can be used with any other target
  801. XX                   may be used with this target.  Any prere-
  802. XX                   quisites of this target will be brought up to
  803. XX                   date during its processing.  NOTE:  errors
  804. XX                   will be ignored while making this target, in
  805. XX                   extreme cases this may cause some problems.
  806. XX
  807. XX     ..EEXXPPOORRTT       All prerequisites associated with this target
  808. XX                   are assumed to correspond to macro names and
  809. XX                   they and their values are exported to the
  810. XX                   environment as environment strings at the
  811. XX                   point in the makefile at which this target
  812. XX                   appears.  Any attributes specified with this
  813. XX                   target are ignored.  Only macros which have
  814. XX                   been assigned a value in the makefile prior to
  815. XX                   the export directive are exported, macros as
  816. XX                   yet undefined are not exported.
  817. XX
  818. XX     ..IIMMPPOORRTT       Prerequisite names specified for this target
  819. XX                   are searched for in the environment and
  820. XX                   defined as macros with their value taken from
  821. XX                   the environment.  If the special name ..EEVVEERRYY----
  822. XX                   TTHHIINNGG is used as a prerequisite name then all
  823. XX                   environment variables defined in the environ-
  824. XX                   ment are imported.  The functionality of the
  825. XX                   --ee flag can be forced by placing the construct
  826. XX                   _._I_M_P_O_R_T _: _._E_V_E_R_Y_T_H_I_N_G at the start of a
  827. XX                   makefile.  Similarly, by placing the construct
  828. XX                   at the end, one can emulate the effect of the
  829. XX                   --EE command line flag.  If a prerequisite name
  830. XX                   cannot be found in the environment an error
  831. XX                   message is issued.  .IMPORT accepts the
  832. XX                   .IGNORE attribute.  When given, it causes
  833. XX                   ddmmaakkee to ignore the above error.  See the MAC-
  834. XX                   ROS section for a description of the process-
  835. XX                   ing of imported macro values.
  836. XX
  837. XX     ..IINNCCLLUUDDEE      Parse another makefile just as if it had been
  838. XX                   located at the point of the .INCLUDE in the
  839. XX                   current makefile.  The list of prerequisites
  840. XX                   gives the list of makefiles to try to read.
  841. XX                   If the list contains multiple makefiles then
  842. XX                   they are read in order from left to right.
  843. XX                   The following search rules are used when try-
  844. XX                   ing to locate the file.  If the filename is
  845. XX                   surrounded by " or just by itself then it is
  846. XX                   searched for in the current directory.  If it
  847. XX                   is not found it is then searched for in each
  848. XX                   of the directories specified for the .INCLU-
  849. XX                   DEDIRS special target.  If the file name is
  850. XX                   surrounded by < and >, (ie.
  851. XX
  852. XX
  853. XX
  854. XVersion 3.70                    UW                             23
  855. XX
  856. XX
  857. XX
  858. XX
  859. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  860. XX
  861. XX
  862. XX
  863. XX                   <my_spiffy_new_makefile>) then it is searched
  864. XX                   for only in the directories given by the
  865. XX                   .INCLUDEDIRS special target.  In both cases if
  866. XX                   the file name is a fully qualified name start-
  867. XX                   ing at the root of the file system then it is
  868. XX                   only searched for once, and the .INCLUDEDIRS
  869. XX                   list is ignored.  .INCLUDE accepts the .IGNORE
  870. XX                   and .SETDIR attributes.  If .IGNORE attribute
  871. XX                   is given and the file cannot be found then
  872. XX                   ddmmaakkee continues processing, otherwise an error
  873. XX                   message is generated.  The .SETDIR attribute
  874. XX                   causes ddmmaakkee to change directories to the
  875. XX                   specified directory prior to attempting the
  876. XX                   include operation.
  877. XX
  878. XX     ..IINNCCLLUUDDEEDDIIRRSS  The list of prerequisites specified for this
  879. XX                   target defines the set of directories to
  880. XX                   search when trying to include a makefile.
  881. XX
  882. XX     ..KKEEEEPP__SSTTAATTEE   This special target is a synonym for the macro
  883. XX                   definition
  884. XX
  885. XX                        .KEEP_STATE := _state.mk
  886. XX
  887. XX                   It's effect is to turn on STATE keeping and to
  888. XX                   define ___s_t_a_t_e_._m_k as the state file.
  889. XX
  890. XX     ..MMAAKKEEFFIILLEESS    The list of prerequisites is the set of files
  891. XX                   to try to read as the default makefile.  By
  892. XX                   default this target is defined as:
  893. XX
  894. XX                        .MAKEFILES : makefile.mk Makefile
  895. XX                   makefile
  896. XX
  897. XX
  898. XX     ..SSOOUURRCCEE       The prerequisite list of this target defines a
  899. XX                   set of directories to check when trying to
  900. XX                   locate a target file name.  See the section on
  901. XX                   BINDING of targets for more information.
  902. XX
  903. XX     ..SSOOUURRCCEE..ssuuffff  The same as .SOURCE, except that the
  904. XX                   .SOURCE.suff list is searched first when try-
  905. XX                   ing to locate a file matching the a target
  906. XX                   whose name ends in the suffix .suff.
  907. XX
  908. XX     ..RREEMMOOVVEE       The recipe of this target is used whenever
  909. XX                   ddmmaakkee needs to remove intermediate targets
  910. XX                   that were made but do not need to be kept
  911. XX                   around.  Such targets result from the applica-
  912. XX                   tion of transitive closure on the dependency
  913. XX                   graph.
  914. XX
  915. XX
  916. XX
  917. XX
  918. XVersion 3.70                    UW                             24
  919. XX
  920. XX
  921. XX
  922. XX
  923. XDMAKE(p)             Unsupported Free Software            DMAKE(p)
  924. XX
  925. XX
  926. XX
  927. XX     In addition to the special targets above, several other
  928. XX     forms of targets are recognized and are considered special,
  929. XX     their exact form and use is defined in the sections that
  930. XX     follow.
  931. XX
  932. XSSPPEECCIIAALL MMAACCRROOSS
  933. SHAR_EOF
  934. true || echo 'restore of dm37p2 failed'
  935. fi
  936. echo 'End of  part 2'
  937. echo 'File dm37p2 is continued in part 3'
  938. echo 3 > _shar_seq_.tmp
  939. exit 0
  940.  
  941. exit 0 # Just in case...
  942. -- 
  943. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  944. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  945. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  946. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  947.