home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume27 / dmake / part30 < prev    next >
Encoding:
Text File  |  1992-01-29  |  39.9 KB  |  1,078 lines

  1. Newsgroups: comp.sources.misc
  2. From: dvadura@plg.waterloo.edu (Dennis Vadura)
  3. Subject:  v27i131:  dmake - dmake Version 3.8, Part30/41
  4. Message-ID: <1992Jan29.164559.951@sparky.imd.sterling.com>
  5. X-Md4-Signature: b29dded873933f77ca72ac5a410d2e72
  6. Date: Wed, 29 Jan 1992 16:45:59 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: dvadura@plg.waterloo.edu (Dennis Vadura)
  10. Posting-number: Volume 27, Issue 131
  11. Archive-name: dmake/part30
  12. Environment: Atari-ST, Coherent, Mac, MSDOS, OS/2, UNIX
  13. Supersedes: dmake: Volume 19, Issue 22-58
  14.  
  15. ---- Cut Here and feed the following to sh ----
  16. # this is dmake.shar.30 (part 30 of a multipart archive)
  17. # do not concatenate these parts, unpack them in order with /bin/sh
  18. # file dmake/readme/apple.mac continued
  19. #
  20. if test ! -r _shar_seq_.tmp; then
  21.     echo 'Please unpack part 1 first!'
  22.     exit 1
  23. fi
  24. (read Scheck
  25.  if test "$Scheck" != 30; then
  26.     echo Please unpack part "$Scheck" next!
  27.     exit 1
  28.  else
  29.     exit 0
  30.  fi
  31. ) < _shar_seq_.tmp || exit 1
  32. if test -f _shar_wnt_.tmp; then
  33. sed 's/^X//' << 'SHAR_EOF' >> 'dmake/readme/apple.mac' &&
  34. X
  35. I added some code so that the Macintosh version of dmake can
  36. use UNIX-style directories to specify include paths and target
  37. and dependency file names.  I.e., if you specify a file "/dir/file",
  38. dmake will look at the file "dir:file".  However, Mac dmake does not
  39. do any translation from files specified by UNIX-style directories
  40. in the recipe line that gets executed.  If you need to translate,
  41. you can use substitution commands.  (For example,
  42. ":$(RELATIVEUNIXFILE:s,/,:,)".)  This code was added so one could
  43. execute dmake's makefile, and also so one would have an easier time
  44. porting other UNIX makefiles.  I would suggest you stick with
  45. Macintosh-style directories for all other makefiles.
  46. X
  47. I was getting memory trashing errors when I was reading in
  48. environmental variables >4K with the -e option.  I had trouble
  49. tracking down exactly what was causing the problem, so decided it
  50. was easier to just clip the length before sending it to the dmake
  51. parser.  I arbitrarily picked 1K as the maximum length, figuring
  52. it was highly unlikely anyone really needed a variable longer than
  53. that from within a makefile.  (This error may be related to the
  54. value you set for MAXLINELENGTH, so to be safe, you should keep
  55. it >1K.)
  56. X
  57. In order to run dmake, you must set (and export) the environmental
  58. variable "OS" to "mac".
  59. X
  60. Finally, dmake looks for the file startup.mk in
  61. "{MPW}tools:{DMSTARTUPDIR}".  "DMSTARTUPDIR" can be defined if you
  62. want to override the default tools directory location.
  63. X
  64. Micah Doyle
  65. micah@leland.Stanford.EDU
  66. SHAR_EOF
  67. chmod 0640 dmake/readme/apple.mac ||
  68. echo 'restore of dmake/readme/apple.mac failed'
  69. Wc_c="`wc -c < 'dmake/readme/apple.mac'`"
  70. test 1957 -eq "$Wc_c" ||
  71.     echo 'dmake/readme/apple.mac: original size 1957, current size' "$Wc_c"
  72. rm -f _shar_wnt_.tmp
  73. fi
  74. # ============= dmake/readme/atari.tos ==============
  75. if test -f 'dmake/readme/atari.tos' -a X"$1" != X"-c"; then
  76.     echo 'x - skipping dmake/readme/atari.tos (File already exists)'
  77.     rm -f _shar_wnt_.tmp
  78. else
  79. > _shar_wnt_.tmp
  80. sed 's/^X//' << 'SHAR_EOF' > 'dmake/readme/atari.tos' &&
  81. This file describes the Atari-tos distribution of dmake.
  82. X
  83. The code to compile on an Atari-ST using GCC was supplied by Edgar Roeder
  84. (roeder@cs.uni-sb.de).  I do not have an ST on which to verify the
  85. distribution sources but I have no reason to believe them to not work.
  86. If there are any problems please let Edgar or myself know.
  87. X
  88. I know of no bugs or limitation to the the Atari-ST implementation.  Note that
  89. it is similar to the DOS version but it does not swap itself out.  This does
  90. not appear to be as much of a problem on the Atari as it is on MSDOS boxes :-).
  91. See the readme/msdos file for further information.
  92. X
  93. -dennis
  94. SHAR_EOF
  95. chmod 0640 dmake/readme/atari.tos ||
  96. echo 'restore of dmake/readme/atari.tos failed'
  97. Wc_c="`wc -c < 'dmake/readme/atari.tos'`"
  98. test 626 -eq "$Wc_c" ||
  99.     echo 'dmake/readme/atari.tos: original size 626, current size' "$Wc_c"
  100. rm -f _shar_wnt_.tmp
  101. fi
  102. # ============= dmake/readme/cover ==============
  103. if test -f 'dmake/readme/cover' -a X"$1" != X"-c"; then
  104.     echo 'x - skipping dmake/readme/cover (File already exists)'
  105.     rm -f _shar_wnt_.tmp
  106. else
  107. > _shar_wnt_.tmp
  108. sed 's/^X//' << 'SHAR_EOF' > 'dmake/readme/cover' &&
  109. This is the DMAKE Version 3.8 distribution.  DMAKE is a Make like tool that
  110. has been written by me and has been used by individuals at the University of
  111. Waterloo.  This release replaces the previous version 3.7 release which is no
  112. longer supported.  Please read the file 'readme/release' which accompanies
  113. this distribution and describes details of this release (This note is found
  114. in readme/cover).
  115. X
  116. dmake is available for anonymous ftp from watmsg.uwaterloo.ca address is
  117. 129.97.141.9.  It is in the pub/dmake directory, set your mode to binary,
  118. and copy either:
  119. X
  120. X    dmake38.tar.Z        - compressed tar archive
  121. X    dmake38.zoo        - zoo archive
  122. X    dmake38-msdos-exe.zoo    - MSDOS executable zoo archive
  123. X
  124. X    dmake38.shar01        - xx part shar archive, get all parts
  125. X    ...
  126. X    dmake38.sharxx
  127. X
  128. X    dmake38.patchY          - Patch Y for dmake 3.8
  129. X
  130. Note that all archives are created on a UNIX system.  This means that the
  131. distributions heading for DOS-land need to have the <lf> turned into a
  132. <cr><lf>.  There exist a number of filters for doing this (sed comes to mind),
  133. and is easily run over each file using a UNIX shell script.  Thus I don't
  134. provide two different versions of the archives.
  135. X
  136. dmake is different from other versions of make in that it supports significant
  137. enhancements (See the man page).  A short summary of the more important
  138. ones follows:
  139. X
  140. X    . support for portable makefiles
  141. X    . runs on many platforms (DOS, generic unix [sysv and bsd4.3],
  142. X      apollo, OS/2, Atari, and many others)
  143. X    . significantly enhanced macro facilities
  144. X    . transitive closure on inference graph
  145. X    . sophisticated inference algorithm
  146. X    . support for traversing the file sytem both during making of targets
  147. X      and during inference
  148. X    . %-meta rules for specifying rules to be used for inferring
  149. X      prerequisites
  150. X    . highly configurable
  151. X    . support for libraries
  152. X    . parallel making of targets on architectures that support it
  153. X    . attributed targets
  154. X    . text diversions
  155. X    . group recipes
  156. X    . swapping itself to DISK under MSDOS
  157. X    . supports MKS extended argument passing convention
  158. X
  159. All code found in this distribution is original and written by me except where
  160. noted in the source and the following:
  161. X
  162. - dbug/dbug package from Fred Fish  (dmake DEBUG=1, to make a debugging version
  163. X  of dmake)
  164. X
  165. - malloc.c package in dbug/malloc from the NET, see the directory for
  166. X  attribution.
  167. X
  168. -dennis
  169. SHAR_EOF
  170. chmod 0640 dmake/readme/cover ||
  171. echo 'restore of dmake/readme/cover failed'
  172. Wc_c="`wc -c < 'dmake/readme/cover'`"
  173. test 2332 -eq "$Wc_c" ||
  174.     echo 'dmake/readme/cover: original size 2332, current size' "$Wc_c"
  175. rm -f _shar_wnt_.tmp
  176. fi
  177. # ============= dmake/readme/msdos ==============
  178. if test -f 'dmake/readme/msdos' -a X"$1" != X"-c"; then
  179.     echo 'x - skipping dmake/readme/msdos (File already exists)'
  180.     rm -f _shar_wnt_.tmp
  181. else
  182. > _shar_wnt_.tmp
  183. sed 's/^X//' << 'SHAR_EOF' > 'dmake/readme/msdos' &&
  184. Notes on the MSDOS implementation of dmake.
  185. X
  186. Bootstrapping the binary:
  187. -------------------------
  188. X   A make.bat file is provided to bootstrap the binary.  The file contains
  189. X   several targets for bootstrapping.  Invoking the batch file with no
  190. X   arguments lists the possibilities shown below.
  191. X
  192. X      INDEX:  You must specify one of:
  193. X     tcc      - Turbo C 2.0 compile.
  194. X     tccswp   - Turbo C 2.0 compile of swapping dmake.
  195. X     bcc      - Borland C++ 2.0 compile.
  196. X     bccswp   - Borland C++ 2.0 compile of swapping dmake.
  197. X     msc40    - Microsoft C 4.0 compile.
  198. X     msc50    - Microsoft C 5.0 compile.
  199. X     msc51    - Microsoft C 5.1 compile.
  200. X     msc60    - Microsoft C 6.0 compile.
  201. X     msc40swp - Microsoft C 4.0, MASM 5.1 compile of swapping dmake.
  202. X     msc50swp - Microsoft C 5.0, MASM 5.1 compile of swapping dmake.
  203. X     msc51swp - Microsoft C 5.1, MASM 5.1 compile of swapping dmake.
  204. X     msc60swp - Microsoft C 6.0, MASM 5.1 compile of swapping dmake.
  205. X     ztc      - Zortech C++ 2.1 compile.
  206. X     ztcswp   - Zortech C++ 2.1 compile of swapping dmake.
  207. X
  208. X   Based on the compiler you have installed and whether or not you
  209. X   want the swapping version of dmake, you should select the appropriate
  210. X   target and issue 'make.bat target'.
  211. X
  212. X   The batch file runs a second batch script that comes with the distribution
  213. X   which compiles the sources using the appropriate compiler and flags.  The
  214. X   MSC Versions of the batch files should not require any further user
  215. X   intervention during the compile.  The Turbo-C version, as a final step,
  216. X   invokes tlink with two response files.  The second of these response files,
  217. X   named in msdos/tccdos/mk*.bat, contains absolute path names to Turbo-C
  218. X   libraries.  You may need to edit these before getting a successful binary
  219. X   linked.
  220. X
  221. X   By default the batch files make an executable that will run on an 8088
  222. X   cpu and up.  You can change that by making the initial version and then
  223. X   editing the config.mk files found in either msdos/tccdos or msdos/mscdos
  224. X   (depending on the compiler you use), and selecting a diferrent cpu type by
  225. X   supplying the appropriate compiler flags.  You then need to remake dmake
  226. X   again but this time use dmake itself, see below.
  227. X
  228. X   Note that the file msdos/exec.uue is a uuencoded version of a BCC++
  229. X   compiled exec.obj (from exec.asm).  If you do not have an assembler
  230. X   either microsoft MASM or Borland TASM (or some other), you can uudecode
  231. X   this file and put it into the appropriate objects directory.
  232. X
  233. X
  234. Using dmake to Make itself:
  235. ---------------------------
  236. X   If you use dmake to make itself you must first set a number of makefile
  237. X   control variables, either through the environment or on the command line.
  238. X
  239. X   The following variables must be set:
  240. X
  241. X    OS           - defines operating system (must be set)
  242. X    OSRELEASE      - particular version of it.
  243. X    OSENVIRNOMENT  - more customization
  244. X
  245. X   These three variables should be defined in your environment.  Valid values
  246. X   for them are listed in the readme/options file.  For example, if you
  247. X   are using MSDOS, with Turbo-C then the valid settings are:
  248. X
  249. X    set OS=msdos
  250. X    set OSRELEASE=tccdos
  251. X    set OSENVIRONMENT=
  252. X
  253. X   dmake searches for an initial startup file, you should set the environment
  254. X   variable MAKESTARTUP to contain the full path to the startup file, eg:
  255. X
  256. X    set MAKESTARTUP=d:\usr\lib\startup.mk
  257. X
  258. X   The dmake makefile has several variables that can be user specified and
  259. X   default to reasonable values if not set.
  260. X
  261. X    MODEL   - defines the model to compile, valid values are
  262. X          {s,c,m, or l}, defaults to 'l' (ie. large) model
  263. X          if unspecified.
  264. X
  265. X    MSC_VER - defines the version of Microsoft C in use, should be set to
  266. X          one of 4.0, 5.0, 5.1 or 6.0; defaults to 6.0.
  267. X
  268. X    SWAP    - If set to 'y', compile the dmake swapping version of
  269. X          spawnvpe.  This has the effect of turning on swapping of the
  270. X          executable to disk if the MSDOS version is made.
  271. X
  272. X    DEBUG   - If set to '1' then make the debugging version of dmake, this
  273. X          will also set MODEL to 'l'.
  274. X
  275. X   To set the above variables you must specify them on the dmake command line
  276. X   or insert them into the makefile.mk definition.
  277. X
  278. X
  279. Memory Requirements and Swapping:
  280. ---------------------------------
  281. X   The swapping code currently only swaps to DISK, I have left hooks
  282. X   in to accomodate XMS and EMS, I have some code that performs the
  283. X   necessary XMS/EMS accesses but have not incorporated it in yet.
  284. X   It appears that a ramdisk seems to work just fine.  If anyone
  285. X   wishes to fill in the hooks please do and I'll be happy to include
  286. X   them in future distributions.
  287. X
  288. X
  289. ^C and stopping a make:
  290. -----------------------
  291. X   Thanks to the efforts of Len Reed, appears to now work.  I have been unable
  292. X   to hang my machine if it's swapped out and I hit ^C a couple thousand times.
  293. X
  294. X
  295. Other notes:
  296. ------------
  297. X   dmake does not care if you are running command.com or some other command
  298. X   interpretter, you must however specify the proper values of the environment
  299. X   variables SHELL, SHELLFLAGS, GROUPSHELL, and GROUPFLAGS in order for things
  300. X   to work correctly.  Read the man page FIRST, if you still have trouble
  301. X   then send email.
  302. X
  303. X   Group recipes under DOS that use command.com as the command interpretter
  304. X   require you to set the GROUPSUFFIX macro.
  305. X
  306. X   As shipped the startup.mk files for the DOS version try to figure out what
  307. X   command interpretter you are using and set things up appropriately.
  308. X   Two command interpretters are supported in the shipped startup.mk file,
  309. X   command.com, and the MKS Korn shell.
  310. X
  311. X   dmake does not contain any builtin commands.  It gets all commands it
  312. X   executes from an external file system.  It is therefore most useful if it
  313. X   is used in conjunction with an environment similar to that provided by
  314. X   the MKS Tool Kit, or equivalent.
  315. X
  316. X   dmake now supports the MKS argument passing conventions.  The facility is
  317. X   enabled by setting .MKSARGS:=1.  It is set by default in the startup.mk file
  318. X   if an MKS Korn shell is detected as being the active command interpretter.
  319. SHAR_EOF
  320. chmod 0640 dmake/readme/msdos ||
  321. echo 'restore of dmake/readme/msdos failed'
  322. Wc_c="`wc -c < 'dmake/readme/msdos'`"
  323. test 5991 -eq "$Wc_c" ||
  324.     echo 'dmake/readme/msdos: original size 5991, current size' "$Wc_c"
  325. rm -f _shar_wnt_.tmp
  326. fi
  327. # ============= dmake/readme/os2 ==============
  328. if test -f 'dmake/readme/os2' -a X"$1" != X"-c"; then
  329.     echo 'x - skipping dmake/readme/os2 (File already exists)'
  330.     rm -f _shar_wnt_.tmp
  331. else
  332. > _shar_wnt_.tmp
  333. sed 's/^X//' << 'SHAR_EOF' > 'dmake/readme/os2' &&
  334. Notes on the OS/2 implementation of dmake:
  335. ==========================================
  336. X
  337. As shipped the DOS versions of dmake will run under OS/2 protected mode.
  338. However, support for a full OS/2 version is also provided.  The OS/2 version
  339. will run in parallel under OS/2.  The port was made possible by files supplied
  340. by:
  341. X
  342. X   Duncan Booth   -- (duncanb@ibmpcug.co.uk, Bix:jrichards)
  343. X   Kai Uwe Rommel -- (rommel@lan.informatik.tu-muenchen.dbp.de),
  344. X
  345. For which I am grateful.  I have taken the two ports and integrated them 
  346. into a single port using the structure supplied by Duncan Booth, and some
  347. files and OS2'ism supplied by Kai Rommel.
  348. X
  349. If there are any problems with the port then please let myself or one of the
  350. two people above know.  I will then attempt to fix the problem.  I do not
  351. have access to an OS/2 box to verify any problems myself.
  352. X
  353. X
  354. Bootstrapping the binary:
  355. -------------------------
  356. X   A make.cmd file is provided to bootstrap the binary.  The file contains
  357. X   several targets for bootstrapping.  Invoking the batch file with no
  358. X   arguments lists the possibilities shown below.
  359. X
  360. X      INDEX:  You must specify one of:
  361. X     msc40    - Microsoft C 4.0 compile.
  362. X     msc50    - Microsoft C 5.0 compile.
  363. X     msc51    - Microsoft C 5.1 compile.
  364. X     msc60    - Microsoft C 6.0 compile.
  365. X     ibm      - IBM C2 compile.
  366. X
  367. X   Based on the compiler you have installed and whether or not you
  368. X   want the swapping version of dmake, you should select the appropriate
  369. X   target and issue 'make.cmd target'.
  370. X
  371. X   The command file runs a second command script that comes with the
  372. X   distribution which compiles the sources using the appropriate compiler and
  373. X   flags.  The MSC Versions of the batch files should not require any further
  374. X   user intervention during the compile.
  375. X
  376. X   By default the command files make an executable that will run on an 8088
  377. X   cpu and up.  You can change that by making the initial version and then
  378. X   editing the config.mk file found in os2/mscdos and selecting a diferrent
  379. X   cpu type by supplying the appropriate compiler flags.
  380. X   You then need to remake dmake again but this time use dmake itself,
  381. X   see below.
  382. X
  383. X
  384. Using dmake to Make itself:
  385. ---------------------------
  386. X   If you use dmake to make itself you must first set a number of makefile
  387. X   control variables, either through the environment or on the command line.
  388. X
  389. X   The following variables must be set:
  390. X
  391. X    OS           - defines operating system (must be set)
  392. X    OSRELEASE      - particular version of it.
  393. X    OSENVIRNOMENT  - more customization (not needed for OS/2)
  394. X
  395. X   These three variables should be defined in your environment.  Valid values
  396. X   for them are listed in the dmake makefile.mk file.  For example, if you
  397. X   are using OS/2, with Microsoft-C then the valid settings are:
  398. X
  399. X    set OS=os2
  400. X    set OSRELEASE=mscdos
  401. X
  402. X   dmake searches for an initial startup file, you should set the environment
  403. X   variable MAKESTARTUP to contain the full path to the startup file, eg:
  404. X
  405. X    set MAKESTARTUP=\init\dmake.ini
  406. X
  407. X   The dmake makefile has several variables that can be user specified and
  408. X   default to reasonable values if not set.
  409. X
  410. X    MODEL   - defines the model to compile, valid values are
  411. X          {s,c,m, or l}, defaults to 'l' (ie. large) model
  412. X          if unspecified.
  413. X
  414. X    MSC_VER - defines the version of Microsoft C in use, should be set to
  415. X          one of 4.0, 5.0, 5.1 or 6.0; defaults to 6.0.
  416. X
  417. X    DEBUG   - If set to '1' then make the debugging version of dmake, this
  418. X          will also set MODEL to 'l'.
  419. X
  420. X   To set the above variables you must specify them on the dmake command line
  421. X   or insert them into the makefile.mk script.
  422. X
  423. X
  424. X
  425. OS/2 Specifics
  426. --------------
  427. X
  428. X   There is a small number of OS/2 specific features that need to be
  429. X   stated.  
  430. X
  431. X   1. The environment variables TMP as well as TMPDIR are checked for the
  432. X      location of the directory where dmake should place any temporary files.
  433. X      TMPDIR is checked before TMP.
  434. X
  435. X   2. Appropriate limits are setup for MAXPROCESSES and buffer sizes etc.
  436. X      See output of 'dmake -V'.
  437. X
  438. X   3. By default dmake will look for the startup.mk file in the path:
  439. X          
  440. X      $(INIT)/dmake.ini
  441. X
  442. X      This is more in keeping with OS/2 philosophy.  You may still rename
  443. X      and put it anywhere else you like by defining the MAKESTARTUP
  444. X      environment variable.
  445. X
  446. X   4. The OS/2 directory contains files required by Kai Rommel's compiler
  447. X      shell.  However you do not need the compiler shell to build dmake.
  448. X
  449. X   5. Swapping the dmake binary to disk is not supported under OS/2.
  450. X
  451. X
  452. Other notes:
  453. ------------
  454. X   dmake does not care if you are running cmd.exe or some other command
  455. X   interpretter, you must however specify the proper values of the environment
  456. X   variables SHELL, SHELLFLAGS, GROUPSHELL, and GROUPFLAGS in order for things
  457. X   to work correctly.  Read the man page first.
  458. X
  459. X   Group recipes under OS/2 that use cmd.exe as the command interpretter
  460. X   require you to set the GROUPSUFFIX macro.
  461. X
  462. X   As shipped the startup.mk files try to figure out what
  463. X   command interpretter you are using and set things up appropriately.
  464. X   Two command interpretters are supported in the shipped startup.mk file,
  465. X   cmd.exe (via COMSPEC), and the MKS Korn shell.
  466. X
  467. X   dmake does not contain any builtin commands.  It gets all commands it
  468. X   executes from an external file system.  It is therefore most useful if it
  469. X   is used in conjunction with an environment similar to that provided by
  470. X   the MKS Tool kit, or equivalent.
  471. X
  472. X   dmake now supports the MKS argument passing conventions.  The facility is
  473. X   enabled by setting .MKSARGS:=1 and is set by default in the startup.mk file
  474. X   if an MKS Korn shell is detected as being the active command interpretter.
  475. SHAR_EOF
  476. chmod 0640 dmake/readme/os2 ||
  477. echo 'restore of dmake/readme/os2 failed'
  478. Wc_c="`wc -c < 'dmake/readme/os2'`"
  479. test 5665 -eq "$Wc_c" ||
  480.     echo 'dmake/readme/os2: original size 5665, current size' "$Wc_c"
  481. rm -f _shar_wnt_.tmp
  482. fi
  483. # ============= dmake/readme/release ==============
  484. if test -f 'dmake/readme/release' -a X"$1" != X"-c"; then
  485.     echo 'x - skipping dmake/readme/release (File already exists)'
  486.     rm -f _shar_wnt_.tmp
  487. else
  488. > _shar_wnt_.tmp
  489. sed 's/^X//' << 'SHAR_EOF' > 'dmake/readme/release' &&
  490. dmake Version 3.8
  491. =================
  492. X
  493. FULL RELEASE OF DMAKE, REPLACES VERSION 3.7
  494. X
  495. Nature:  This release is an attempt at addressing all of the little obscure
  496. -------  bugs and "features" that still remained in dmake and often caused
  497. X     spurious or incorrect behaviour.  As such there is no major new
  498. X     functionality but several small enhancements to make life a little
  499. X     more interesting.
  500. X
  501. X     This distribution advances dmake to Version 3.8, patch level 0.
  502. X
  503. X
  504. Availability:
  505. -------------
  506. X      dmake is available via anonymous ftp from watmsg.uwaterloo.ca
  507. X      (129.97.141.9) as:
  508. X
  509. X          pub/dmake/dmake38.tar.Z        - compressed tar archive
  510. X          pub/dmake/dmake38.zoo        - zoo archive
  511. X          pub/dmake/dmake38-msdos-exe.zoo    - MSDOS executable zoo archive
  512. X          pub/dmake/dmake38-msdos-exe.zip    - MSDOS executable zip archive
  513. X          pub/dmake/dmake38.shar01        - xx part shar archive
  514. X          ...                  (get all parts)
  515. X          pub/dmake/dmake38.sharxx
  516. X
  517. X      and comes in several archive formats.  Choose the one that best
  518. X      suits your needs.
  519. X
  520. Acknowledgements:
  521. -----------------
  522. X      Thanks to all who submitted code for new features, suggestions for
  523. X      improvements, and bug fixes.  I have tried to make sure no gotchas
  524. X      remain, if you encounter problems installing or running dmake please
  525. X      let me know.  As always, I am always happy to receive e-mail.
  526. X
  527. X
  528. DETAILS OF ENHANCEMENTS/TWEAKS:
  529. ===============================
  530. - Added the following functionality:
  531. X    #! command
  532. X  is scanned for and recognized if it is the first line of your makefile.
  533. X  The command string is expanded and executed.
  534. X  The command is restricted in that it cannot be a command requiring a shell
  535. X  for it's execution.  The values of the command line macros have been set
  536. X  and are available for execution purposes.  This is not as general as one
  537. X  would like but it is not bad for bootstrapping different non dmake
  538. X  makefiles.  If the command result code is zero, then dmake continues parsing
  539. X  its input and processes the makefile.  If the result is non-zero dmake
  540. X  exits.  (suggested by Paul Sander, paul@hal.com)
  541. - Allowed the inclusion of white space inside quoted prerequisites.
  542. X  i.e. you can now say:
  543. X
  544. X      foo : "some stuff"
  545. X
  546. X  and have "some stuff" treated as a single prerequisite.  The mod is
  547. X  necessary to allow for prerequisites that contain $(shell ... ) expansion
  548. X  scripts and other simillar function macros.
  549. X
  550. - Changed the following piece of code to be more in line with dmake
  551. X  philosophy.  That is, $(macname:str=sub) now expands 'sub' prior to
  552. X  performing the substitution, however if '-A' or '.AUGMAKE := yes' are
  553. X  specified then the expansion is suppressed.
  554. - Added _POSIX_NAME_MAX to the source, on any stat if the basename of a file
  555. X  is larger than the value of _POSIX_NAME_MAX then it returns 0.  You must
  556. X  define _POSIX_NAME_MAX in a lower level config if you want it to override
  557. X  the default in {unix,msdos,mac,os2,atari}/config.h.
  558. X
  559. - Disallowed export of macros whose names contain the characters "+=:*"
  560. X  as these are valid macro assignment operators and we don't want to cause
  561. X  trouble when we go to reparse the environment again.  Perhaps the fix
  562. X  could be a little bit less drastic, but for now it seems reasonable.
  563. X
  564. - Tweaked the output of -v to more accurately show which of a set of ::
  565. X  targets is getting made.  The info was there so I might as well use it.
  566. X
  567. - Added a seperate directory substructure for XENIX since I was having trouble
  568. X  linking properly in the generic SYSVR3 environment.  Looks as if you pretty
  569. X  much need 'make xenixpwd' since XENIX uses popen to call getcwd.
  570. X  If you use 'make xenix' and your implementation of xenix uses popen this
  571. X  causes dmake to get confused about child processes and occationally
  572. X  complain that it lost one.
  573. - Cleaned up OS/2 building scripts, and made sure that OS2 define is checked
  574. X  where needed.
  575. X
  576. DETAILS OF BUG FIXES:
  577. =====================
  578. - Fixed the handling of :: targets if they appear first in the makefile.
  579. X  This was incorrectly handled by the internal DAG construction code, ugly!.
  580. X
  581. - Fixed an output statement in dump.c so that macro values containing %
  582. X  signs are correctly printed (guess where that broke, blush).
  583. X
  584. - Fixed a bug in dealing with .SETDIR=a targets and multiprocessing.  Too
  585. X  obscure to describe but annoying if you stumble onto it.
  586. X
  587. - Fixed DIRSEPSTR macro to be user modifiable (as the manpage claims :-)
  588. X  so that people can change it in startup.mk depending on shell/OS
  589. X  (mostly effects DOS and/or OS/2 implementations).
  590. - Fixed a bug dealing with complex .IF/.ELIF/.ELSE/.END expressions.
  591. X  It now correctly selects only a single matching instance in a complex
  592. X  .IF/.ELIF/.ELSE/.END expr.
  593. SHAR_EOF
  594. chmod 0640 dmake/readme/release ||
  595. echo 'restore of dmake/readme/release failed'
  596. Wc_c="`wc -c < 'dmake/readme/release'`"
  597. test 4694 -eq "$Wc_c" ||
  598.     echo 'dmake/readme/release: original size 4694, current size' "$Wc_c"
  599. rm -f _shar_wnt_.tmp
  600. fi
  601. # ============= dmake/rulparse.c ==============
  602. if test -f 'dmake/rulparse.c' -a X"$1" != X"-c"; then
  603.     echo 'x - skipping dmake/rulparse.c (File already exists)'
  604.     rm -f _shar_wnt_.tmp
  605. else
  606. > _shar_wnt_.tmp
  607. sed 's/^X//' << 'SHAR_EOF' > 'dmake/rulparse.c' &&
  608. /* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/RCS/rulparse.c,v 1.1 1992/01/24 03:27:57 dvadura Exp $
  609. -- SYNOPSIS -- perform semantic analysis on input
  610. -- 
  611. -- DESCRIPTION
  612. --    This code performs semantic analysis on the input, and builds
  613. --    the complex internal datastructure that is used to represent
  614. --    the user makefile.
  615. -- 
  616. -- AUTHOR
  617. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  618. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  619. --
  620. -- COPYRIGHT
  621. --      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  622. -- 
  623. --      This program is free software; you can redistribute it and/or
  624. --      modify it under the terms of the GNU General Public License
  625. --      (version 1), as published by the Free Software Foundation, and
  626. --      found in the file 'LICENSE' included with this distribution.
  627. -- 
  628. --      This program is distributed in the hope that it will be useful,
  629. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  630. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  631. --      GNU General Public License for more details.
  632. -- 
  633. --      You should have received a copy of the GNU General Public License
  634. --      along with this program;  if not, write to the Free Software
  635. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  636. --
  637. -- LOG
  638. --     $Log: rulparse.c,v $
  639. X * Revision 1.1  1992/01/24  03:27:57  dvadura
  640. X * dmake Version 3.8, Initial revision
  641. X *
  642. */
  643. X
  644. #include "extern.h"
  645. X
  646. /* prototypes for local functions */
  647. static  void    _add_global_prereq ANSI((CELLPTR));
  648. static  int     _add_root ANSI((CELLPTR));
  649. static    void    _build_graph ANSI((int, CELLPTR, CELLPTR));
  650. static    char*    _build_meta ANSI((char*));
  651. static    int    _do_magic ANSI((int, char*, CELLPTR, CELLPTR, t_attr, char*));
  652. static    void    _do_special ANSI((int, int, t_attr,char*,CELLPTR,CELLPTR,int*));
  653. static    int    _do_targets ANSI((int, t_attr, char*, CELLPTR, CELLPTR));
  654. static    t_attr    _is_attribute ANSI((char*));
  655. static    int    _is_special ANSI((char*));
  656. static    char*    _is_magic ANSI((char*));
  657. static    int    _is_percent ANSI((char*));
  658. static  CELLPTR _make_multi ANSI((CELLPTR));
  659. static  CELLPTR _replace_cell ANSI((CELLPTR,CELLPTR,CELLPTR));
  660. static    void    _set_attributes ANSI((t_attr, char*, CELLPTR ));
  661. static    void    _stick_at_head ANSI((CELLPTR, CELLPTR));
  662. static    void    _set_global_attr ANSI((t_attr));
  663. X
  664. X
  665. /* static variables that must persist across invocation of Parse_rule_def */
  666. static CELLPTR    _sv_targets = NIL(CELL);
  667. static STRINGPTR  _sv_rules   = NIL(STRING);
  668. static STRINGPTR  _sv_crule   = NIL(STRING);
  669. static CELLPTR    _sv_edgel   = NIL(CELL);
  670. static LINKPTR    _sv_glb_prq = NIL(LINK);
  671. static int      _sp_target  = FALSE;
  672. static t_attr     _sv_attr;
  673. static int        _sv_flag;
  674. static int      _sv_op;
  675. static char      *_sv_setdir;
  676. static char      _sv_globprq_only = 0;
  677. X
  678. /* Define for global attribute mask */
  679. #define A_GLOB     (A_PRECIOUS | A_SILENT | A_IGNORE | A_EPILOG | A_SWAP |\
  680. X          A_SHELL | A_PROLOG | A_NOINFER | A_SEQ | A_MKSARGS )
  681. X
  682. X
  683. PUBLIC int
  684. Parse_rule_def( state )/*
  685. =========================
  686. X   Parse the rule definition contained in Buffer, and modify the state 
  687. X   if appropriate.  The function returns 0, if the definition is found to
  688. X   be an illegal rule definition, and it returns 1 if it is a rule definition.
  689. X   */
  690. int *state;
  691. {
  692. X   TKSTR     input;        /* input string struct for token search      */
  693. X   CELLPTR    targets;    /* list of targets if any          */
  694. X   CELLPTR    prereq;        /* list of prereq if any          */
  695. X   CELLPTR    prereqtail;    /* tail of prerequisite list          */
  696. X   CELLPTR    cp;        /* temporary cell pointer for list making */
  697. X   char     *result;    /* temporary storage for result            */
  698. X   char        *tok;        /* temporary pointer for tokens          */
  699. X   char         *set_dir;       /* value of setdir attribute              */
  700. X   char        *brk;        /* break char list for Get_token      */
  701. X   char         *firstrcp;      /* first recipe line, from ; in rule line */
  702. X   t_attr       attr;           /* sum of attribute flags for current tgts*/
  703. X   t_attr    at;        /* temp place to keep an attribute code      */
  704. X   int        op;        /* rule operator              */
  705. X   int        special;    /* indicate special targets in rule      */
  706. X   int        percent;    /* indicate percent rule target          */
  707. X   int        mixed_glob_prq; /* indicate mixed %-rule prereq possible  */
  708. X
  709. X   DB_ENTER( "Parse_rule_def" );
  710. X
  711. X   op          = 0;
  712. X   attr       = 0;
  713. X   special    = 0;
  714. X   percent    = 0;
  715. X   set_dir    = NIL( char );
  716. X   targets    = NIL(CELL);
  717. X   prereq     = NIL(CELL);
  718. X   prereqtail = NIL(CELL);
  719. X   mixed_glob_prq = 0;
  720. X
  721. X   /* Check to see if the line is of the form:
  722. X    *    targets : prerequisites; first recipe line
  723. X    * If so remember the first_recipe part of the line. */
  724. X
  725. X   firstrcp = strchr( Buffer, ';' );
  726. X   if( firstrcp != NIL( char ) ) {
  727. X      *firstrcp++ = 0;
  728. X      firstrcp = _strspn( firstrcp, " \t" );
  729. X   }
  730. X
  731. X   result = Expand( Buffer );
  732. X   for( brk=strchr(result,'\\'); brk != NIL(char); brk=strchr(brk,'\\') )
  733. X      if( brk[1] == '\n' )
  734. X     *brk = ' ';
  735. X      else
  736. X         brk++;
  737. X
  738. X   DB_PRINT( "par", ("Scanning: [%s]", result) );
  739. X
  740. X   SET_TOKEN( &input, result );
  741. X   brk = ":-^!";
  742. X   Def_targets = TRUE;
  743. X   
  744. X   /* Scan the input rule line collecting targets, the operator, and any
  745. X    * prerequisites.  Stop when we run out of targets and prerequisites. */
  746. X
  747. X   while( *(tok = Get_token( &input, brk, TRUE )) != '\0' )
  748. X      if( !op ) {
  749. X     /* we are scanning targets and attributes
  750. X      * check to see if token is an operator.  */
  751. X
  752. X     op = Rule_op( tok );
  753. X
  754. X     if( !op ) {
  755. X        /* define a new cell, or get old cell  */
  756. X        cp = Def_cell( tok );
  757. X        DB_PRINT( "par", ("tg_cell [%s]", tok) );
  758. X        
  759. X        if( at = _is_attribute( tok ) ) {
  760. X           /* Logically OR the attributes specified into one main
  761. X            * ATTRIBUTE mask. */
  762. X
  763. X           if( at == A_SETDIR )
  764. X              if( set_dir != NIL( char ) )
  765. X                 Warning( "Multiple .SETDIR attribute ignored" );
  766. X              else
  767. X                 set_dir = _strdup( tok );
  768. X
  769. X           attr |= at;
  770. X        }
  771. X        else {
  772. X           int tmp;
  773. X           
  774. X           tmp = _is_special( tok );
  775. X           if( _is_percent( tok ) ) percent++;
  776. X
  777. X           if( percent )
  778. X              if( targets != NIL(CELL) )
  779. X             Fatal( "Multiple targets are not allowed in %% rules" );
  780. X          else
  781. X             cp->ce_flag |= F_PERCENT;
  782. X
  783. X           if( special )
  784. X              Fatal( "Special target must appear alone", tok );
  785. X           else if( !(cp->ce_flag & F_MARK) ) {
  786. X          cp->ce_link  = targets;  /* targets are stacked in this list*/
  787. X          cp->ce_flag |= F_MARK | F_EXPLICIT;
  788. X          targets      = cp;
  789. X
  790. X          special = tmp;
  791. X           }
  792. X           else if( !(cp->ce_attr & A_LIBRARY) )
  793. X          Warning("Duplicate entry [%s] in target list",cp->CE_NAME);
  794. X        }
  795. X     }
  796. X     else {
  797. X        /* found an operator so empty out break list
  798. X         * and clear mark bits on target list, setting them all to F_USED */
  799. X
  800. X        brk  = "";
  801. X        for( cp=targets; cp != NIL(CELL); cp=cp->ce_link ) {
  802. X           cp->ce_flag ^= F_MARK;
  803. X           cp->ce_flag |= F_USED;
  804. X        }
  805. X
  806. X        Def_targets = FALSE;
  807. X     }
  808. X      }
  809. X      else {
  810. X         /* Scanning prerequisites so build the prerequisite list.  We use
  811. X          * F_MARK flag to make certain we have only a single copy of the
  812. X          * prerequisite in the list */
  813. X
  814. X     cp = Def_cell( tok );
  815. X
  816. X     if( _is_percent( tok ) ) {
  817. X        if( !percent && !attr )
  818. X           Fatal( "Syntax error in %% rule, missing %% target");
  819. X        mixed_glob_prq = 1;
  820. X     }
  821. X
  822. X     if( cp->ce_flag & F_USED ) {
  823. X        if( cp->ce_attr & A_COMPOSITE )
  824. X           continue;
  825. X        else
  826. X           Fatal( "Detected circular dependency in graph at [%s]",
  827. X              cp->CE_NAME );
  828. X     }
  829. X         else if( !(cp->ce_flag & F_MARK) ) {
  830. X        DB_PRINT( "par", ("pq_cell [%s]", tok) );
  831. X        cp->ce_flag |= F_MARK;
  832. X
  833. X        if( prereqtail == NIL(CELL) )    /* keep prereq's in order */
  834. X           prereq = cp;
  835. X        else
  836. X           prereqtail->ce_link = cp;
  837. X
  838. X        prereqtail = cp;
  839. X        cp->ce_link = NIL(CELL);
  840. X     }
  841. X     else if( !(cp->ce_attr & A_LIBRARY) )
  842. X        Warning("Duplicate entry [%s] in prerequisite list",cp->CE_NAME);
  843. X      }
  844. X      
  845. X   /* Check to see if we have a percent rule that has only global
  846. X    * prerequisites.  If so then set the flag so that later on, we don't issue
  847. X    * an error if such targets supply an empty set of rules. */
  848. X
  849. X   if( percent && !mixed_glob_prq && (prereq != NIL(CELL)) )
  850. X      _sv_globprq_only = 1;
  851. X
  852. X   /* It's ok to have targets with attributes, and no prerequisites, but it's
  853. X    * not ok to have no targets and no attributes, or no operator */
  854. X
  855. X   if( !op ) {
  856. X      CLEAR_TOKEN( &input );
  857. X      DB_PRINT( "par", ("Not a rule [%s]", Buffer) );
  858. X      DB_RETURN( 0 );
  859. X   }
  860. X
  861. X   if( !attr && targets == NIL(CELL) ) {
  862. X      Fatal( "Missing targets or attributes in rule" );
  863. X      if( set_dir != NIL( char )) FREE( set_dir );
  864. X      DB_RETURN( 0 );
  865. X   }
  866. X
  867. X   /* We have established we have a legal rules line, so we must process it.
  868. X    * In doing so we must handle any special targets.  Special targets must
  869. X    * appear alone possibly accompanied by attributes.
  870. X    * NOTE:  special != 0  ==> targets != NIL(CELL) */
  871. X    
  872. X   if( prereqtail != NIL(CELL) ) prereqtail->ce_link = NIL(CELL);
  873. X
  874. X   /* Clear out MARK bits used in duplicate checking.  I originally wanted
  875. X    * to do this as the lists get processed but that got too error prone
  876. X    * so I bit the bullit and added these two loops. */
  877. X
  878. X   for( cp=prereq;  cp != NIL(CELL); cp=cp->ce_link ) cp->ce_flag &= ~F_MARK;
  879. X   for( cp=targets; cp != NIL(CELL); cp=cp->ce_link ) cp->ce_flag &= ~F_USED;
  880. X
  881. X   /* Check to see if the previous rule line was bound if, not the call
  882. X    * Bind_rules_to_targets to go and bind the line */
  883. X
  884. X   if( _sv_rules != NIL(STRING) ) Bind_rules_to_targets( F_DEFAULT );
  885. X
  886. X   /* Add the first recipe line to the list */
  887. X   if( firstrcp != NIL( char ) )
  888. X      Add_recipe_to_list( firstrcp, TRUE, FALSE );
  889. X
  890. X   /* Save these prior to calling _do_targets, since _build_graph needs the
  891. X    * _sv_setdir value for matching edges. */
  892. X   _sv_op     = op;
  893. X   _sv_setdir = set_dir;
  894. X
  895. X   if( special )
  896. X      _do_special( special, op, attr, set_dir, targets, prereq, state );
  897. X   else
  898. X      *state = _do_targets( op, attr, set_dir, targets, prereq );
  899. X
  900. X   DB_RETURN( 1 );
  901. }
  902. X
  903. X
  904. PUBLIC int
  905. Rule_op( op )/*
  906. ================
  907. X   Check the passed in op string and map it to one of the rule operators */
  908. char *op;
  909. {
  910. X   int ret = 0;
  911. X
  912. X   DB_ENTER( "rule_op" );
  913. X   
  914. X   if( *op == TGT_DEP_SEP ) {
  915. X      ret = R_OP_CL;
  916. X      op++;
  917. X
  918. X      /* All rule operations begin with a :, but may include any one of the
  919. X       * four modifiers.  In order for the rule to be properly mapped we must
  920. X       * check for each of the modifiers in turn, building up our return bit
  921. X       * string. */
  922. X
  923. X      while( *op && ret )
  924. X         switch( *op ) {
  925. X        case ':': ret |= R_OP_DCL; op++; break;
  926. X        case '!': ret |= R_OP_BG;  op++; break;
  927. X        case '^': ret |= R_OP_UP;  op++; break;
  928. X        case '-': ret |= R_OP_MI;  op++; break;
  929. X
  930. X        default : ret  = 0;  /* an invalid modifier, chuck whole string */
  931. X         }
  932. X
  933. X      if( *op != '\0' ) ret = 0;
  934. X   }
  935. X
  936. X   DB_RETURN( ret );
  937. }
  938. X
  939. X
  940. PUBLIC void
  941. Add_recipe_to_list( rule, white_too, no_check )/*
  942. =================================================
  943. X        Take the provided string and add it to the list of recipe lines
  944. X    we are saving to be added to the list of targets we have built
  945. X    previously.  If white_too == TRUE add the rule EVEN IF it contains only
  946. X        whitespace. */
  947. char *rule;
  948. int  white_too;
  949. int  no_check;
  950. {
  951. X   DB_ENTER( "Add_recipe_to_list" );
  952. X
  953. X   if( rule != NIL( char ) && (*rule != '\0' || white_too) ) {
  954. X      DB_PRINT( "par", ("Adding recipe [%s]", rule) );
  955. X      _sv_crule = Def_recipe( rule, _sv_crule, white_too, no_check );
  956. X
  957. X      if( _sv_rules == NIL(STRING) )
  958. X         _sv_rules = _sv_crule;
  959. X   }
  960. X
  961. X   DB_VOID_RETURN;
  962. }
  963. X
  964. X
  965. PUBLIC void
  966. Bind_rules_to_targets( flag )/*
  967. ===============================
  968. X        Take the rules we have defined and bind them with proper attributes
  969. X        to the targets that were previously defined in the parse.  The
  970. X        attributes that get passed here are merged with those that are were
  971. X        previously defined.  (namely F_SINGLE) */
  972. int flag;
  973. {
  974. X   CELLPTR tg;             /* pointer to current target in list */
  975. X   LINKPTR lp;           /* pointer to link cell        */
  976. X   int     magic;          /* TRUE if target is .xxx.yyy form   */
  977. X   int     tflag;          /* TRUE if we assigned targets here  */
  978. X
  979. X   DB_ENTER( "Bind_rules_to_targets" );
  980. X
  981. X   /* This line is needed since Parse may call us twice when the last
  982. X    * GROUP rule appears at the end of file.  In this case the rules
  983. X    * have already been bound and we want to ignore them. */
  984. X
  985. X   if( _sv_targets == NIL(CELL) ) { DB_VOID_RETURN; }
  986. X
  987. X   tflag  = FALSE;
  988. X   flag  |= (_sv_flag & F_SINGLE);
  989. X
  990. X   for( tg = _sv_targets; tg != NIL(CELL); tg = tg->ce_link ) {
  991. X      DB_PRINT( "par", ("Binding to %s, %04x", tg->CE_NAME, tg->ce_flag) );
  992. X      magic = tg->ce_flag & F_PERCENT;
  993. X
  994. X      /* Check to see if we had a rule of the form '%.o : a.h b.h ; xxx'
  995. X       * In which case we must build a NULL prq node to hold the recipe */
  996. X      if( _sv_globprq_only && (_sv_rules != NIL(STRING)) )
  997. X     _build_graph( _sv_op, tg, NIL(CELL) );
  998. X
  999. X      /* NOTE:  For targets that are magic we ignore any previously defined
  1000. X       *        rules.  ie. We throw away the old definition and use the new. */
  1001. X      if( !(tg->ce_flag & F_MULTI) && !magic && (tg->CE_RECIPE != NIL(STRING))
  1002. X      && !_sp_target && (_sv_rules != NIL(STRING)) )
  1003. X         Fatal( "Multiply defined recipe for target %s", tg->CE_NAME );
  1004. X
  1005. X      if( (magic || _sp_target) && (_sv_rules == NIL(STRING)) &&
  1006. X      !(tg->ce_flag & F_SPECIAL) && !_sv_globprq_only )
  1007. X         Warning( "Empty recipe for special target %s", tg->CE_NAME );
  1008. X
  1009. X      if( magic ) {
  1010. X     CELLPTR ep;
  1011. X
  1012. X     for( ep=_sv_edgel; ep != NIL(CELL); ep=ep->ce_link ) {
  1013. X        _set_attributes( _sv_attr, _sv_setdir, ep );
  1014. X        ep->ce_flag |= (F_TARGET|flag);
  1015. X
  1016. X        if( _sv_rules != NIL(STRING) ) {
  1017. X           ep->ce_recipe  = _sv_rules;
  1018. X           ep->ce_indprq  = _sv_glb_prq;
  1019. X        }
  1020. X     }
  1021. X      }
  1022. X      else {
  1023. X     tg->ce_attr |= _sv_attr;
  1024. X     tg->ce_flag |= flag;
  1025. X
  1026. X     if( _sv_rules != NIL(STRING) ) {
  1027. X        tg->ce_recipe  = _sv_rules;
  1028. X        tg->ce_flag   |= F_RULES | F_TARGET;
  1029. X
  1030. X        /* Bind the current set of prerequisites as belonging to the
  1031. X         * original recipe given for the target */
  1032. X        for( lp=tg->ce_prq; lp != NIL(LINK); lp = lp->cl_next )
  1033. X          if( !(lp->cl_flag & F_USED) ) lp->cl_flag |= F_TARGET;
  1034. X         }
  1035. X     else for( lp=tg->ce_prq; lp != NIL(LINK); lp = lp->cl_next )
  1036. X        lp->cl_flag |= F_USED;
  1037. X      }
  1038. X
  1039. X      tflag |= _add_root(tg);
  1040. X   }
  1041. X
  1042. X   if( tflag ) Target = TRUE;
  1043. X   if( _sv_setdir ) FREE(_sv_setdir);
  1044. X   _sv_rules   = NIL(STRING);
  1045. X   _sv_crule   = NIL(STRING);
  1046. X   _sv_targets = NIL(CELL);
  1047. X   _sv_glb_prq = NIL(LINK);
  1048. X   _sv_edgel   = NIL(CELL);
  1049. X   _sp_target  = FALSE;
  1050. X   _sv_globprq_only = 0;
  1051. X
  1052. X   DB_VOID_RETURN;
  1053. }
  1054. X
  1055. X
  1056. X
  1057. PUBLIC int
  1058. Set_group_attributes( list )/*
  1059. ==============================
  1060. X    Scan list looking for the standard @ and - (as in recipe line defs)
  1061. X    and set the flags accordingly so that they apply when we bind the
  1062. X    rules to the appropriate targets. */
  1063. char *list;
  1064. SHAR_EOF
  1065. true || echo 'restore of dmake/rulparse.c failed'
  1066. fi
  1067. echo 'End of part 30, continue with part 31'
  1068. echo 31 > _shar_seq_.tmp
  1069. exit 0
  1070. exit 0 # Just in case...
  1071.