home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume20 / dmake / patch02b / dm37p2 < prev   
Encoding:
Text File  |  1991-06-29  |  35.4 KB  |  890 lines

  1. #!/bin/sh
  2. # dodiff:  Directory tree maintainer (v1.1)
  3. #
  4. # DMAKE 3.7 PATCH #2
  5. # ------------------
  6. # Priority:  Medium
  7. # Prerequisite:  dmake 3.7 patch level 1 full distribution.
  8. # Location:  You can obtain a copy of the patch from watmsg.uwaterloo.edu
  9. #        via anonymous ftp from the directory pub/dmake.  The file is
  10. #        dmake37-patch2.Z.  The patch is also submitted for posting
  11. #        to comp.sources.misc.
  12. # Application:  Change directory to the source directory containing the
  13. #           dmake sources and run the patch through /bin/sh.  It constructs
  14. #           any required subdirectories and applies the patch program as
  15. #           needed to apply patches to files.  If you obtain the patch
  16. #           files from a news group then you must first build the patch
  17. #           source by running all parts of the patch through unshar or
  18. #           /bin/sh.
  19. # Acknowledgment:  Thanks to everyone who wrote with suggestions or bug fixes.
  20. #           In most cases your fixes and/or suggestions were
  21. #           incorporated into the sources.  Your continued input makes
  22. #           dmake a better tool.
  23. # DETAILS OF FIXES:
  24. # -----------------
  25. # - Fixed a bug in function.c.  If you used a $(shell ...) macro in a line
  26. #   which got expanded from within the input buffer Buffer (eg. in a rule
  27. #   definition) nasty things could happen since _exec_shell re-used Buffer
  28. #   when it shouldn't have.
  29. # - Made sure that -v and -n flags do not take effect across a $(shell ...)
  30. #   macro expansion.  This ensures that $(shell ...) recipes are always
  31. #   executed when the macro is expanded and never contain noise from a -v
  32. #   flag.  Dunno how I missed this the first time around.
  33. # - Fixed a bug that set Current_target to NULL when making successive recipe
  34. #   lines individually.  This meant that temp files were being deleted late,
  35. #   possibly from the wrong places, and hence not deleted at all.
  36. # - Fixed several inference bugs.  Nothing too major:
  37. #     1. a recipe of the form
  38. #         %.foo:
  39. #         @[
  40. #            stuff ...
  41. #         ]
  42. #        didn't get the group recipe attribute attached to the %.foo node
  43. #        so when the inference algorithm was run it failed to attach the
  44. #        correct attribute to go along with the new recipe.
  45. #     2. Inference algorithm now marks for REMOVAL, ALL intermediate nodes
  46. #        (it did this before too -- but by luck), and marks ALL nodes as
  47. #        TARGETS, and all but the first node as being INFERRED.  I doubt
  48. #        that anyone will notice these changes.  I had to have a really
  49. #        screwy makefile to find the bug.
  50. # - Fixed $(shell ...) macro so that it can be nested to arbitrary depths.
  51. #   It uses a single temporary file for the purpose and keeps reusing it for
  52. #   each nested instance.  Works like a charm.
  53. # - Fixed bug in rulparse.c where an attribute flag variable was of type
  54. #   int and not t_attr as it should be.  This caused problems on 16-bit
  55. #   machines (reported by lots of people).
  56. # - Fixed a bug reported by paul@halserv2.hal.com, dmake.c line 373, would
  57. #   dereference a NULL pointer if the hash table didn't contain an entry.
  58. # - Fixed a bug reported by paul@halserv2.hal.com, rulparse.c line 949
  59. #   would dereference a NULL pointer if it tried to match a certain sequence
  60. #   of %-meta rules.
  61. # - Fixed a bug reported by paul@halserv2.hal.com, make.c, the SET_TOKEN
  62. #   call was getting called with a NULL pointer.
  63. # - Minor tweaks to the OS/2 scripts as reported by Frank Waley.  Should make
  64. #   MSC compiles work now.
  65. # - Changed sysvr4/stdarg.h to ensure that va_dcl is defined.
  66. # - Modified man page.  The diffs would have been bigger than the source so
  67. #   I just included new copies.
  68. # DETAILS OF ADDITIONS/CHANGES:
  69. # -----------------------------
  70. # - Added a sysvr3/pwd directory along with getcwd.c.  The reason for this
  71. #   addition is to hopefully eliminate once and for all the annoying
  72. #   "lost a child" bug.  If you see this bug appear then remake dmake with
  73. #     make sysvr3pwd
  74. #     or  make xenixpwd
  75. #   Both create a version of dmake that uses a local version of getcwd rather
  76. #   than the C-library version.  Thanks to Gwyn Dyer for providing the code
  77. #   to getcwd.c.  I used his version as it compiled on a xenix machine and
  78. #   seemed to be the more widely used one.  Thanks to all that sent me copies
  79. #   of it.  I hope this gets rid of the lost child issue once and for all.
  80. # - The MSDOS version now behaves identically to the UNIX versions when
  81. #   running recipes containing embedded cd calls.  I changed dmake to restore
  82. #   the directory it was in prior to invoking a child process.
  83. #   The following recipe will now behave identically under UNIX and DOS
  84. #       all:
  85. #         cd foo; make ...
  86. #         cd fee; make ...
  87. #   Previously to this change, the DOS version of DMAKE would have been in
  88. #   the foo directory after the first line of the recipe, and would not
  89. #   find fee.
  90. # - Added the -B flag.  This is in response to several requests at supporting
  91. #   spaces in front of recipe lines.  This does not come without a price.
  92. #   By default the flag is off and tabs are required to start recipe lines
  93. #   unless it is a group recipe.  If you turn the flag on, either through
  94. #   supplying -B on the command line or by putting ".NOTABS := y" in the
  95. #   makefile then when dmake scans non-group recipes they are terminated at
  96. #   the first line that is only white space or contains no leading white space
  97. #   and is either a macro definition or a rule definition.
  98. #   Consider the following makefile:
  99. #       all:
  100. #     <tab>  echo hi there
  101. #     <space>echo e:test
  102. #     <tab>  echo hello
  103. #   By default the recipe for all is simply: "echo hi there", and the remaining
  104. #   two lines are parsed as a new rule definition with the associated recipe
  105. #   being "echo hello".  If you supply -B, then the recipe for 'all' is all
  106. #   three lines above, since the second recipe line now begins with a space.
  107. #   
  108. #   If you change the makefile to contain:
  109. #       all:
  110. #     <tab>  echo hi there
  111. #     <space>echo e:test
  112. #     <tab>  echo hi there
  113. #   then the -B flag has no visible effect.  The makefile is parsed the
  114. #   same in both cases as the first recipe is terminated by the empty line.
  115. #   or a valid recipe rule.
  116. #   If you now change the makefile to contain:
  117. #       all:
  118. #     <tab>  echo hi there
  119. #     <tab>  echo e:test
  120. #     <tab>  echo hi there
  121. #   then by default all three lines form the recipe for 'all'.
  122. #   Specifying -B terminates the first recipe after the first line and begins
  123. #   a new rule definition with the line "echo e:test".
  124. #   In summary:
  125. #       By default:  (no -B) a recipe is terminated by a line containing some
  126. #            text that does not begin with a <tab>.
  127. #       Specify -B:  A recipe is terminated by a line that is only white space
  128. #            or by a line containg text that contains NO leading
  129. #            white space.
  130. #   You can use the .NOTABS macro to set/reset this behaviour at will from
  131. #   within a makefile.  See the man page.
  132. # - Added OSRELEASE=coherent targets and directories to support Coherent
  133. #   systems.  Patches provided by David Fenyes (dfenyes@thesis1.med.uth.tmc.edu).
  134. # - Added OSRELEASE=msdos OSENVIRONMENT=ztcdos targets and directories to
  135. #   support making of dmake using Zortech C++ 2.1.  Patches provided by
  136. #   David Engel (ods@utdallas.edu).
  137. #
  138. # Remove Obsolete files from distribution
  139.  
  140. # Now use a shar archive to add any new files to the distribution
  141. # This is a shell archive (produced by shar 3.49)
  142. # To extract the files from this archive, save it to a file, remove
  143. # everything above the "!/bin/sh" line above, and type "sh file_name".
  144. #
  145. # made 06/28/1991 13:27 UTC by dvadura@watdragon
  146. # Source directory /u2/dvadura/src/generic/dmake/src
  147. #
  148. # existing files will NOT be overwritten unless -c is specified
  149. #
  150. # This shar contains:
  151. # length  mode       name
  152. # ------ ---------- ------------------------------------------
  153. # 125864 -rw-r----- man/dmake.p
  154. #  98450 -r--r----- man/dmake.tf
  155. #   1976 -r--r----- msdos/ztcdos/config.h
  156. #   1990 -rw-r----- msdos/ztcdos/config.mk
  157. #    473 -r--r----- msdos/ztcdos/environ.c
  158. #      1 -rw-r----- msdos/ztcdos/lib.rsp
  159. #      1 -rw-r----- msdos/ztcdos/libswp.rsp
  160. #   3232 -rw-r----- msdos/ztcdos/mk.bat
  161. #   3235 -rw-r----- msdos/ztcdos/mkswp.bat
  162. #    614 -rw-r----- msdos/ztcdos/obj.rsp
  163. #    626 -rw-r----- msdos/ztcdos/objswp.rsp
  164. #   5417 -rw-r----- msdos/ztcdos/public.h
  165. #   3861 -rw-r----- msdos/ztcdos/startup.mk
  166. #   1738 -r--r----- msdos/ztcdos/tempnam.c
  167. #   1940 -r--r--r-- unix/coherent/config.h
  168. #    765 -rw-r--r-- unix/coherent/config.mk
  169. #    306 -r--r--r-- unix/coherent/getcwd.c
  170. #   2405 -rw-r--r-- unix/coherent/make.sh
  171. #   5318 -rw-r----- unix/coherent/public.h
  172. #   3221 -rw-r--r-- unix/coherent/startup.mk
  173. #    469 -r--r--r-- unix/coherent/stdarg.h
  174. #    346 -r--r--r-- unix/coherent/stdlib.h
  175. #    133 -r--r--r-- unix/coherent/time.h
  176. #   4312 -r--r--r-- unix/coherent/vfprintf.c
  177. #    559 -rw-r----- unix/sysvr3/pwd/config.mk
  178. #   5834 -r--r----- unix/sysvr3/pwd/getcwd.c
  179. #   2739 -rw-r----- unix/sysvr3/pwd/make.sh
  180. #   5318 -rw-r----- unix/sysvr3/pwd/public.h
  181. #   3221 -rw-r----- unix/sysvr3/pwd/startup.mk
  182. #
  183. # ============= man/dmake.p ==============
  184. if test ! -d 'man'; then
  185.     echo 'x - creating directory man'
  186.     mkdir 'man'
  187. fi
  188. if test -f 'man/dmake.p' -a X != X; then
  189.     echo 'x - skipping man/dmake.p (File already exists)'
  190. else
  191. echo 'x - extracting man/dmake.p (Text)'
  192. sed 's/^X//' << 'SHAR_EOF' > 'man/dmake.p' &&
  193. X
  194. X
  195. X
  196. X
  197. DMAKE(p)             Unsupported Free Software            DMAKE(p)
  198. X
  199. X
  200. X
  201. NNAAMMEE
  202. X     ddmmaakkee - maintain program groups, or interdependent files
  203. X
  204. SSYYNNOOPPSSIISS
  205. X     ddmmaakkee [-ABceEhiknpqrsStTuVx] [-v{dfimt}] [-P#] [-{f|C|K}
  206. X     file] [macro[*][+][:]=_v_a_l_u_e ...] [target ...]
  207. X
  208. DDEESSCCRRIIPPTTIIOONN
  209. X     ddmmaakkee executes commands found in an external file called a
  210. X     _m_a_k_e_f_i_l_e to update one or more target names.  Each target
  211. X     may depend on zero or more prerequisite targets.  If any of
  212. X     the target's prerequisites is newer than the target or if
  213. X     the target itself does not exist, then ddmmaakkee will attempt to
  214. X     make the target.
  215. X
  216. X     If no --ff command line option is present then ddmmaakkee searches
  217. X     for an existing _m_a_k_e_f_i_l_e from the list of prerequisites
  218. X     specified for the special target _._M_A_K_E_F_I_L_E_S (see the STARTUP
  219. X     section for more details).  If "-" is the name of the file
  220. X     specified to the --ff flag then ddmmaakkee uses standard input as
  221. X     the source of the makefile text.
  222. X
  223. X     Any macro definitions (arguments with embedded "=" signs)
  224. X     that appear on the command line are processed first and
  225. X     supersede definitions for macros of the same name found
  226. X     within the makefile.  In general it is impossible for defin-
  227. X     itions found inside the makefile to redefine a macro defined
  228. X     on the command line, see the MACROS section for an excep-
  229. X     tion.
  230. X
  231. X     If no _t_a_r_g_e_t names are specified on the command line, then
  232. X     ddmmaakkee uses the first non-special target found in the
  233. X     makefile as the default target.  See the SSPPEECCIIAALL TTAARRGGEETTSS
  234. X     section for the list of special targets and their function.
  235. X     ddmmaakkee is a re-implementation of the UNIX Make utility with
  236. X     significant enhancements.  Makefiles written for most previ-
  237. X     ous versions of _M_a_k_e will be handled correctly by ddmmaakkee..
  238. X     Known differences between ddmmaakkee and other versions of make
  239. X     are discussed in the CCOOMMPPAATTIIBBIILLIITTYY section found at the end
  240. X     of this document.
  241. X
  242. OOPPTTIIOONNSS
  243. X     --AA   Enable AUGMAKE special inference rule transformations
  244. X          (see the "PERCENT(%) RULES" section), these are set to
  245. X          off by default.
  246. X
  247. X     --BB   Enable the use of spaces instead of <tabs> to begin
  248. X          recipe lines.  This flag equivalent to the .NOTABS spe-
  249. X          cial macro and is further described below.
  250. X
  251. X     --cc   Use non-standard comment stripping.  If you specify --cc
  252. X          then ddmmaakkee will treat any ## character as a start of
  253. X
  254. X
  255. X
  256. Version 3.70                    UW                              1
  257. X
  258. X
  259. X
  260. X
  261. DMAKE(p)             Unsupported Free Software            DMAKE(p)
  262. X
  263. X
  264. X
  265. X          comment character wherever it may appear unless it is
  266. X          escaped by a \.
  267. X
  268. X     --CC [[++]]ffiillee
  269. X          This option writes to _f_i_l_e a copy of standard output
  270. X          and standard error from any child processes and from
  271. X          the ddmmaakkee process itself.  If you specify a ++ prior to
  272. X          the file name then the text is appended to the previous
  273. X          contents of _f_i_l_e.  This option is active in the MSDOS
  274. X          implementation only and is ignored by non-MSDOS ver-
  275. X          sions of ddmmaakkee..
  276. X
  277. X     --ee   Read the environment and define all strings of the form
  278. X          'EENNVV--VVAARR=_e_v_a_l_u_e' defined within as macros whose name is
  279. X          EENNVV--VVAARR, and whose value is '_e_v_a_l_u_e'.  The environment
  280. X          is processed prior to processing the user specified
  281. X          makefile thereby allowing definitions in the makefile
  282. X          to override definitions in the environment.
  283. X
  284. X     --EE   Same as -e, except that the environment is processed
  285. X          after the user specified makefile has been processed
  286. X          (thus definitions in the environment override defini-
  287. X          tions in the makefile).  The -e and -E options are
  288. X          mutually exclusive.  If both are given the latter takes
  289. X          effect.
  290. X
  291. X     --ff ffiillee
  292. X          Use ffiillee as the source for the makefile text.  Only one
  293. X          --ff option is allowed.
  294. X
  295. X     --hh   Print the command summary for ddmmaakkee.
  296. X
  297. X     --ii   Tells ddmmaakkee to ignore errors, and continue making other
  298. X          targets.  This is equivalent to the .IGNORE attribute
  299. X          or macro.
  300. X
  301. X     --KK ffiillee
  302. X          Turns on ..KKEEEEPP__SSTTAATTEE state tracking and tells ddmmaakkee to
  303. X          use _f_i_l_e as the state file.
  304. X
  305. X     --kk   Causes ddmmaakkee to ignore errors caused by command execu-
  306. X          tion and to make all targets not depending on targets
  307. X          that could not be made. Ordinarily ddmmaakkee stops after a
  308. X          command returns a non-zero status, specifying --kk causes
  309. X          ddmmaakkee to ignore the error and continue to make as much
  310. X          as possible.
  311. X
  312. X     --nn   Causes ddmmaakkee to print out what it would have executed,
  313. X          but does not actually execute the commands.  A special
  314. X          check is made for the string "$(MAKE)" inside a recipe
  315. X          line, if found, the line is expanded and invoked,
  316. X          thereby enabling recursive makes to give a full
  317. X
  318. X
  319. X
  320. Version 3.70                    UW                              2
  321. X
  322. X
  323. X
  324. X
  325. DMAKE(p)             Unsupported Free Software            DMAKE(p)
  326. X
  327. X
  328. X
  329. X          description of all that they will do.  The check for
  330. X          "$(MAKE)" is disabled inside group recipes.
  331. X
  332. X     --pp   Print out a version of the digested makefile in human
  333. X          readable form.  (useful for debugging, but cannot be
  334. X          re-read by ddmmaakkee)
  335. X
  336. X     --PP##  On systems that support multi-processing cause ddmmaakkee to
  337. X          use _# concurrent child processes to make targets.  See
  338. X          the "MULTI PROCESSING" section for more information.
  339. X
  340. X     --qq   Check and see if the target is up to date.  Exits with
  341. X          code 0 if up to date, 1 otherwise.
  342. X
  343. X     --rr   Tells ddmmaakkee not to read the initial startup makefile,
  344. X          see STARTUP section for more details.
  345. X
  346. X     --ss   Tells ddmmaakkee to do all its work silently and not echo
  347. X          the commands it is executing to stdout (also suppresses
  348. X          warnings).  This  is equivalent to the .SILENT attri-
  349. X          bute or macro.
  350. X
  351. X     --SS   Force sequential execution of recipes on architectures
  352. X          which support concurrent makes.  For backward compati-
  353. X          bility with old makefiles that have nasty side-effect
  354. X          prerequisite dependencies.
  355. X
  356. X     --tt   Causes ddmmaakkee to touch the targets and bring them up to
  357. X          date without executing any commands.
  358. X
  359. X     --TT   Tells ddmmaakkee to not perform transitive closure on the
  360. X          inference graph.
  361. X
  362. X     --uu   Force an unconditional update.  (ie. do everything that
  363. X          would be done if everything that a target depended on
  364. X          was out of date)
  365. X
  366. X     --vv[[ddffiimmtt]]
  367. X          Verbose flag, when making targets print to stdout what
  368. X          we are going to make and what we think its time stamp
  369. X          is.  The optional flags [[ddffiimmtt]] can be used to restrict
  370. X          the information that is displayed.  In the absence of
  371. X          any optional flags all are assumed to be given (ie. --vv
  372. X          is equivalent to --vvddffiimmtt).  The meanings of the
  373. X          optional flags are:
  374. X
  375. X          dd    Notify of change directory operations only.
  376. X
  377. X          ff    Notify of file I/O operations only.
  378. X
  379. X          ii    Notify of inference algorithm operation only.
  380. X
  381. X
  382. X
  383. X
  384. Version 3.70                    UW                              3
  385. X
  386. X
  387. X
  388. X
  389. DMAKE(p)             Unsupported Free Software            DMAKE(p)
  390. X
  391. X
  392. X
  393. X          mm    Notify of target update operations only.
  394. X
  395. X          tt    Keep any temporary files created; normally they
  396. X               are automatically deleted.
  397. X
  398. X     --VV   Print the version of ddmmaakkee, and values of builtin mac-
  399. X          ros.
  400. X
  401. X     --xx   Upon processing the user makefile export all non-
  402. X          internally defined macros to the user's environment.
  403. X          This option together with the -e option allows SYSV
  404. X          AUGMAKE recursive makes to function as expected.
  405. X
  406. IINNDDEEXX
  407. X     Here is a list of the sections that follow and a short
  408. X     description of each.  Perhaps you won't have to read the
  409. X     whole man page to find what you need.
  410. X
  411. X     SSTTAARRTTUUPP            Describes ddmmaakkee initialization.
  412. X
  413. X     SSYYNNTTAAXX             Describes the syntax of makefile expres-
  414. X                        sions.
  415. X
  416. X     AATTTTRRIIBBUUTTEESS         Describes the notion of attributes and
  417. X                        how they are used when making targets.
  418. X
  419. X     MMAACCRROOSS             Defining and expanding macros.
  420. X
  421. X     RRUULLEESS AANNDD TTAARRGGEETTSS  How to define targets and their prere-
  422. X                        quisites.
  423. X
  424. X     RREECCIIPPEESS            How to tell ddmmaakkee how to make a target.
  425. X
  426. X     TTEEXXTT DDIIVVEERRSSIIOONNSS    How to use text diversions in recipes and
  427. X                        macro expansions.
  428. X
  429. X     SSPPEECCIIAALL TTAARRGGEETTSS    Some targets are special.
  430. X
  431. X     SSPPEECCIIAALL MMAACCRROOSS     Macros used by ddmmaakkee to alter the pro-
  432. X                        cessing of the makefile, and those
  433. X                        defined by ddmmaakkee for the user.
  434. X
  435. X     CCOONNTTRROOLL MMAACCRROOSS     Itemized list of special control macros.
  436. X
  437. X     RRUUNN--TTIIMMEE MMAACCRROOSS    Discussion of special run-time macros
  438. X                        such as $@ and $<.
  439. X
  440. X     FFUUNNCCTTIIOONN MMAACCRROOSS    GNU style function macros, only $(mktmp
  441. X                        ...) for now.
  442. X
  443. X     DDYYNNAAMMIICC PPRREERREEQQUUIISSIITTEESS
  444. X                        Processing of prerequisites which contain
  445. X
  446. X
  447. X
  448. Version 3.70                    UW                              4
  449. X
  450. X
  451. X
  452. X
  453. DMAKE(p)             Unsupported Free Software            DMAKE(p)
  454. X
  455. X
  456. X
  457. X                        macro expansions in their name.
  458. X
  459. X     BBIINNDDIINNGG TTAARRGGEETTSS    The rules that ddmmaakkee uses to bind a tar-
  460. X                        get to an existing file in the file sys-
  461. X                        tem.
  462. X
  463. X     PPEERRCCEENNTT((%%)) RRUULLEESS   Specification of recipes to be used by
  464. X                        the inference algorithm.
  465. X
  466. X     MMAAKKIINNGG IINNFFEERREENNCCEESS  The rules that ddmmaakkee uses when inferring
  467. X                        how to make a target which has no expli-
  468. X                        cit recipe.  This and the previous sec-
  469. X                        tion are really a single section in the
  470. X                        text.
  471. X
  472. X     MMAAKKIINNGG TTAARRGGEETTSS     How ddmmaakkee makes targets other than
  473. X                        libraries.
  474. X
  475. X     MMAAKKIINNGG LLIIBBRRAARRIIEESS   How ddmmaakkee makes libraries.
  476. X
  477. X     KKEEEEPP SSTTAATTEE         A discussion of how .KEEP_STATE works.
  478. X
  479. X     MMUULLTTII PPRROOCCEESSSSIINNGG   Discussion of ddmmaakkee''ss parallel make
  480. X                        facilities for architectures that support
  481. X                        them.
  482. X
  483. X     CCOONNDDIITTIIOONNAALLSS       Conditional expressions which control the
  484. X                        processing of the makefile.
  485. X
  486. X     EEXXAAMMPPLLEESS           Some hopefully useful examples.
  487. X
  488. X     CCOOMMPPAATTIIBBIILLIITTYY      How ddmmaakkee compares with previous versions
  489. X                        of make.
  490. X
  491. X     LLIIMMIITTSS             Limitations of ddmmaakkee.
  492. X
  493. X     PPOORRTTAABBIILLIITTYY        Comments on writing portable makefiles.
  494. X
  495. X     FFIILLEESS              Files used by ddmmaakkee.
  496. X
  497. X     SSEEEE AALLSSOO           Other related programs, and man pages.
  498. X
  499. X     AAUUTTHHOORR             The guy responsible for this thing.
  500. X
  501. X     BBUUGGSS               Hope not.
  502. X
  503. SSTTAARRTTUUPP
  504. X     When ddmmaakkee begins execution it first processes the command
  505. X     line and then processes an initial startup-makefile.  This
  506. X     is followed by an attempt to locate and process a user sup-
  507. X     plied makefile.  The startup file defines the default values
  508. X     of all required control macros and the set of default rules
  509. X
  510. X
  511. X
  512. Version 3.70                    UW                              5
  513. X
  514. X
  515. X
  516. X
  517. DMAKE(p)             Unsupported Free Software            DMAKE(p)
  518. X
  519. X
  520. X
  521. X     for making targets and inferences.  When searching for the
  522. X     startup makefile, ddmmaakkee searches the following locations, in
  523. X     the order specified, until a startup file is located:
  524. X
  525. X          1.   The location given as the value of the macro MAK-
  526. X               ESTARTUP defined on the command line.
  527. X
  528. X          2.   The location given as the value of the environment
  529. X               variable MAKESTARTUP defined in the current
  530. X               environment.
  531. X
  532. X          3.   The location given as the value of the macro MAK-
  533. X               ESTARTUP defined internally within ddmmaakkee.
  534. X
  535. X     The above search is disabled by specifying the -r option on
  536. X     the command line.  An error is issued if a startup makefile
  537. X     cannot be found and the -r option was not specified.  A user
  538. X     may substitute a custom startup file by defining the MAKES-
  539. X     TARTUP environment variable or by redefining the MAKESTARTUP
  540. X     macro on the command line.  To determine where ddmmaakkee looks
  541. X     for the default startup file, check your environment or
  542. X     issue the command _"_d_m_a_k_e _-_V_".
  543. X
  544. X     A similar search is performed to locate a default user
  545. X     makefile when no --ff command line option is specified.  By
  546. X     default, the prerequisite list of the special target
  547. X     .MAKEFILES specifies the names of possible makefiles and the
  548. X     search order that ddmmaakkee should use to determine if one
  549. X     exists.  A typical definition for this target is:
  550. X
  551. X          .MAKEFILES : makefile.mk Makefile makefile
  552. X
  553. X     ddmmaakkee will first look for makefile.mk and then the others.
  554. X     If a prerequisite cannot be found ddmmaakkee will try to make it
  555. X     before going on to the next prerequisite.  For example,
  556. X     makefile.mk can be checked out of an RCS file if the proper
  557. X     rules for doing so are defined in the startup file.
  558. X
  559. SSYYNNTTAAXX
  560. X     This section is a summary of the syntax of makefile state-
  561. X     ments.  The description is given in a style similar to BNF,
  562. X     where { } enclose items that may appear zero or more times,
  563. X     and [ ] enclose items that are optional.  Alternative pro-
  564. X     ductions for a left hand side are indicated by '->', and
  565. X     newlines are significant.  All symbols in bboolldd type are text
  566. X     or names representing text supplied by the user.
  567. X
  568. X
  569. X
  570. X          Makefile -> { Statement }
  571. X
  572. X
  573. X
  574. X
  575. X
  576. Version 3.70                    UW                              6
  577. X
  578. X
  579. X
  580. X
  581. DMAKE(p)             Unsupported Free Software            DMAKE(p)
  582. X
  583. X
  584. X
  585. X          Statement -> Macro-Definition
  586. X                    -> Conditional
  587. X                    -> Rule-Definition
  588. X                    -> Attribute-Definition
  589. X
  590. X          Macro-Definition -> MMAACCRROO == LLIINNEE
  591. X                           -> MMAACCRROO **== LLIINNEE
  592. X                           -> MMAACCRROO ::== LLIINNEE
  593. X                           -> MMAACCRROO **::== LLIINNEE
  594. X                           -> MMAACCRROO ++== LLIINNEE
  595. X                           -> MMAACCRROO ++::== LLIINNEE
  596. X
  597. X          Conditional ->  ..IIFF expression
  598. X                             Makefile
  599. X                          [ ..EELLIIFF expression
  600. X                             Makefile ]
  601. X                          [ ..EELLSSEE
  602. X                             Makefile ]
  603. X                          ..EENNDD
  604. X
  605. X          expression -> LLIINNEE
  606. X                     -> SSTTRRIINNGG ==== LLIINNEE
  607. X                     -> SSTTRRIINNGG !!== LLIINNEE
  608. X
  609. X
  610. X          Rule-Definition ->  target-definition
  611. X                                 [ recipe ]
  612. X
  613. X          target-definition -> targets [attrs] op { PPRREERREEQQUUIISSIITTEE } [;; rcp-line]
  614. X
  615. X          targets -> target { targets }
  616. X                  -> ""target"" { targets }
  617. X
  618. X          target -> special-target
  619. X                 -> TTAARRGGEETT
  620. X
  621. X          attrs -> attribute { attrs }
  622. X                -> ""attribute"" { attrs }
  623. X
  624. X          op -> :: { modifier }
  625. X
  626. X          modifier -> ::
  627. X                   -> ^^
  628. X                   -> !!
  629. X                   -> --
  630. X
  631. X          recipe -> { TTAABB rcp-line }
  632. X                 -> [@@][%%][--] [[
  633. X                       { LLIINNEE }
  634. X                    ]]
  635. X
  636. X
  637. X
  638. X
  639. X
  640. Version 3.70                    UW                              7
  641. X
  642. X
  643. X
  644. X
  645. DMAKE(p)             Unsupported Free Software            DMAKE(p)
  646. X
  647. X
  648. X
  649. X          rcp-line -> [@@][%%][--][++] LLIINNEE
  650. X
  651. X
  652. X          Attribute-Definition -> attrs :: targets
  653. X
  654. X
  655. X          attribute -> ..EEPPIILLOOGG
  656. X                    -> ..IIGGNNOORREE
  657. X                    -> ..LLIIBBRRAARRYY
  658. X                    -> ..MMKKSSAARRGGSS
  659. X                    -> ..NNOOIINNFFEERR
  660. X                    -> ..NNOOSSTTAATTEE
  661. X                    -> ..PPHHOONNYY
  662. X                    -> ..PPRREECCIIOOUUSS
  663. X                    -> ..PPRROOLLOOGG
  664. X                    -> ..SSEETTDDIIRR==_p_a_t_h
  665. X                    -> ..SSIILLEENNTT
  666. X                    -> ..SSEEQQUUEENNTTIIAALL
  667. X                    -> ..SSWWAAPP
  668. X                    -> ..UUSSEESSHHEELLLL
  669. X                    -> ..SSYYMMBBOOLL
  670. X                    -> ..UUPPDDAATTEEAALLLL
  671. X
  672. X          special-target -> ..EERRRROORR
  673. X                         -> ..EEXXPPOORRTT
  674. X                         -> ..GGRROOUUPPEEPPIILLOOGG
  675. X                         -> ..GGRROOUUPPPPRROOLLOOGG
  676. X                         -> ..IIMMPPOORRTT
  677. X                         -> ..IINNCCLLUUDDEE
  678. X                         -> ..IINNCCLLUUDDEEDDIIRRSS
  679. X                         -> ..MMAAKKEEFFIILLEESS
  680. X                         -> ..RREEMMOOVVEE
  681. X                         -> ..SSOOUURRCCEE
  682. X                         -> ..SSOOUURRCCEE.._s_u_f_f_i_x
  683. X                         -> ._s_u_f_f_i_x_1._s_u_f_f_i_x_2
  684. X
  685. X
  686. X     Where, TTAABB represents a <tab> character, SSTTRRIINNGG represents
  687. X     an arbitrary sequence of characters, and LLIINNEE represents a
  688. X     possibly empty sequence of characters terminated by a non-
  689. X     escaped (not immediately preceded by a backslash '\') new-
  690. X     line character.  MMAACCRROO, PPRREERREEQQUUIISSIITTEE, and TTAARRGGEETT each
  691. X     represent a string of characters not including space or tab
  692. X     which respectively form the name of a macro, prerequisite or
  693. X     target.  The name may itself be a macro expansion expres-
  694. X     sion.  A LLIINNEE can be continued over several physical lines
  695. X     by terminating it with a single backslash character.  Com-
  696. X     ments are initiated by the pound ## character and extend to
  697. X     the end of line.  All comment text is discarded, a '#' may
  698. X     be placed into the makefile text by escaping it with '\'
  699. X     (ie. \# translates to # when it is parsed).  An exception to
  700. X     this occurs when a # is seen inside a recipe line that
  701. X
  702. X
  703. X
  704. Version 3.70                    UW                              8
  705. X
  706. X
  707. X
  708. X
  709. DMAKE(p)             Unsupported Free Software            DMAKE(p)
  710. X
  711. X
  712. X
  713. X     begins with a <tab> or is inside a group recipe.  If you
  714. X     specify the --cc command line switch then this behavior is
  715. X     disabled and ddmmaakkee will treat all # characters as start of
  716. X     comment indicators unless they are escaped by \.  A set of
  717. X     continued lines may be commented out by placing a single #
  718. X     at the start of the first line.  A continued line cannot
  719. X     span more than one makefile.
  720. X
  721. X     wwhhiittee ssppaaccee is defined to be any combination of <space>,
  722. X     <tab>, and the sequence \<nl> when \<nl> is used to ter-
  723. X     minate a LINE.  When processing mmaaccrroo definition lines, any
  724. X     amount of white space is allowed on either side of the macro
  725. X     operator (=, *=, :=, *:=, += or +:=), and white space is
  726. X     stripped from both before and after the macro value string.
  727. X     The sequence \<nl> is treated as white space during recipe
  728. X     expansion and is deleted from the final recipe string.  You
  729. X     must escape the \<nl> with another \ in order to get a \ at
  730. X     the end of a recipe line.  The \<nl> sequence is deleted
  731. X     from macro values when they are expanded.
  732. X
  733. X     When processing ttaarrggeett definition lines, the recipe for a
  734. X     target must, in general, follow the first definition of the
  735. X     target (See the RULES AND TARGETS section for an exception),
  736. X     and the recipe may not span across multiple makefiles.  Any
  737. X     targets and prerequisites found on a target definition line
  738. X     are taken to be white space separated tokens.  The rule
  739. X     operator (_o_p in SYNTAX section) is also considered to be a
  740. X     token but does not require white space to precede or follow
  741. X     it.  Since the rule operator begins with a `:', traditional
  742. X     versions of make do not allow the `:' character to form a
  743. X     valid target name.  ddmmaakkee allows `:' to be present in
  744. X     target/prerequisite names as long as the entire
  745. X     target/prerequisite name is quoted.  For example:
  746. X
  747. X          a:fred : test
  748. X
  749. X     would be parsed as TARGET = a, PREREQUISITES={fred, :,
  750. X     test}, which is not what was intended.  To fix this you must
  751. X     write:
  752. X
  753. X          "a:fred" : test
  754. X
  755. X     Which will be parsed as expected.  See the EXAMPLES section
  756. X     for how to apply "" quoting to a list of targets.
  757. X
  758. AATTTTRRIIBBUUTTEESS
  759. X     ddmmaakkee defines several target attributes.  Attributes may be
  760. X     assigned to a single target, a group of targets, or to all
  761. X     targets in the makefile.  Attributes are used to modify
  762. X     ddmmaakkee actions during target update.  The recognized attri-
  763. X     butes are:
  764. X
  765. X
  766. X
  767. X
  768. Version 3.70                    UW                              9
  769. X
  770. X
  771. X
  772. X
  773. DMAKE(p)             Unsupported Free Software            DMAKE(p)
  774. X
  775. X
  776. X
  777. X     ..EEPPIILLOOGG     Insert shell epilog code when executing a group
  778. X                 recipe associated with any target having this
  779. X                 attribute set.
  780. X
  781. X     ..IIGGNNOORREE     Ignore an error when trying to make any target
  782. X                 with this attribute set.
  783. X
  784. X     ..LLIIBBRRAARRYY    Target is a library.
  785. X
  786. X     ..MMKKSSAARRGGSS    If running in an MSDOS environment then use MKS
  787. X                 extended argument passing conventions to pass
  788. X                 arguments to commands.  Non-MSDOS environments
  789. X                 ignore this attribute.
  790. X
  791. X     ..NNOOIINNFFEERR    Any target with this attribute set will not be
  792. X                 subjected to transitive closure if it is
  793. X                 inferred as a prerequisite of a target whose
  794. X                 recipe and prerequisites are being inferred.
  795. X                 (i.e. the inference algorithm will not use any
  796. X                 prerequisite with this attribute set, as a tar-
  797. X                 get) If specified as '.NOINFER:' (ie. with no
  798. X                 prerequisites or targets) then the effect is
  799. X                 equivalent to specifying --TT on the command line.
  800. X
  801. X     ..NNOOSSTTAATTEE    Any target with this attribute set will not have
  802. X                 command line flag information stored in the
  803. X                 state file if .KEEP_STATE has been enabled.
  804. X
  805. X     ..PPHHOONNYY      Any target with this attribute set will have its
  806. X                 recipe executed each time the target is made
  807. X                 even if a file matching the target name can be
  808. X                 located.  Any targets that have a .PHONY attri-
  809. X                 buted target as a prerequisite will be made each
  810. X                 time the .PHONY attributed prerequisite is made.
  811. X
  812. X     ..PPRREECCIIOOUUSS   Do not remove associated target under any cir-
  813. X                 cumstances.  Set by default for any targets
  814. X                 whose corresponding files exist in the file sys-
  815. X                 tem prior to the execution of ddmmaakkee.
  816. X
  817. X     ..PPRROOLLOOGG     Insert shell prolog code when executing a group
  818. X                 recipe associated with any target having this
  819. X                 attribute set.
  820. X
  821. X     ..SSEEQQUUEENNTTIIAALL Force a sequential make of the associated
  822. X                 target's prerequisites.
  823. X
  824. X     ..SSEETTDDIIRR     Change current working directory to specified
  825. X                 directory when making the associated target.
  826. X                 You must specify the directory at the time the
  827. X                 attribute is specified.  To do this simply give
  828. X                 _._S_E_T_D_I_R_=_p_a_t_h as the attribute.  _p_a_t_h is expanded
  829. X
  830. X
  831. X
  832. Version 3.70                    UW                             10
  833. X
  834. X
  835. X
  836. X
  837. DMAKE(p)             Unsupported Free Software            DMAKE(p)
  838. X
  839. X
  840. X
  841. X                 and the result is used as the value of the
  842. X                 directory to change to.  If path is surrounded
  843. X                 by single quotes then path is not expanded, and
  844. X                 is used literally as the directory name.  If the
  845. X                 _p_a_t_h contains any `:' characters then the entire
  846.