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

  1. Newsgroups: comp.sources.misc
  2. subject: v14i017: dmake version 3.5 part 7/21
  3. From: dvadura@watdragon.waterloo.edu (Dennis Vadura)
  4. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5.  
  6. Posting-number: Volume 14, Issue 17
  7. Submitted-by: dvadura@watdragon.waterloo.edu (Dennis Vadura)
  8. Archive-name: dmake/part07
  9.  
  10. #!/bin/sh
  11. # this is part 7 of a multipart archive
  12. # do not concatenate these parts, unpack them in order with /bin/sh
  13. # file msdos/dirbrk.c continued
  14. #
  15. CurArch=7
  16. if test ! -r s2_seq_.tmp
  17. then echo "Please unpack part 1 first!"
  18.      exit 1; fi
  19. ( read Scheck
  20.   if test "$Scheck" != $CurArch
  21.   then echo "Please unpack part $Scheck next!"
  22.        exit 1;
  23.   else exit 0; fi
  24. ) < s2_seq_.tmp || exit 1
  25. echo "x - Continuing file msdos/dirbrk.c"
  26. sed 's/^X//' << 'SHAR_EOF' >> msdos/dirbrk.c
  27. X--      GNU General Public License for more details.
  28. X-- 
  29. X--      You should have received a copy of the GNU General Public License
  30. X--      along with this program;  if not, write to the Free Software
  31. X--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  32. X--
  33. X-- LOG
  34. X--     $Log:    dirbrk.c,v $
  35. X * Revision 1.1  90/07/19  14:10:42  dvadura
  36. X * Initial Revision of Version 3.5
  37. X * 
  38. X*/
  39. X
  40. X#include "extern.h"
  41. X#include <ctype.h>
  42. X
  43. X/* dos uses /, \, and : */
  44. Xchar*    DirBrkStr = "/\\:";
  45. X
  46. X/*
  47. X** Return TRUE if the name is the full specification of a path name to a file
  48. X** starting at the root of the file system, otherwise return FALSE
  49. X*/
  50. Xint
  51. XIf_root_path(name)
  52. Xchar *name;
  53. X{
  54. X   return( (strchr(DirBrkStr, *name) != NIL(char)) ||
  55. X           (isalpha(*name) && name[1] == ':') );
  56. X}
  57. SHAR_EOF
  58. echo "File msdos/dirbrk.c is complete"
  59. chmod 0440 msdos/dirbrk.c || echo "restore of msdos/dirbrk.c fails"
  60. echo "x - extracting msdos/config.mk (Text)"
  61. sed 's/^X//' << 'SHAR_EOF' > msdos/config.mk &&
  62. X# This is an OS specific configuration file
  63. X#    It assumes that OBJDIR, TARGET and DEBUG are previously defined.
  64. X#    It defines    CFLAGS, LDARGS, CPPFLAGS, STARTUPFILE, LDOBJS
  65. X#    It augments    SRC, OBJDIR, TARGET, CFLAGS, LDLIBS
  66. X#
  67. XSTARTUPFILE    = $(OS)/startup.mk
  68. XCPPFLAGS     = $(CFLAGS)
  69. XLDOBJS        = $(CSTARTUP) $(OBJECTS)
  70. XLDARGS        = @<+$(LDOBJS:s,/,\\,:t"+\n")\n+>,$(TARGET),NUL.MAP,@<+$(LDLIBS:s,/,\\,:t"+\n")\n+>$(LDFLAGS)
  71. X
  72. X# Debug flags
  73. XDB_CFLAGS    = -DDBUG -v
  74. XDB_LDFLAGS    = /v
  75. XDB_LDLIBS    =
  76. X
  77. X# NO Debug flags
  78. XNDB_CFLAGS    =
  79. XNDB_LDFLAGS    =
  80. XNDB_LDLIBS    =
  81. X
  82. X# Local configuration modifications for CFLAGS.
  83. XCFLAGS         += -I$(OS)
  84. X
  85. X# Common MSDOS source files.
  86. XSRC += ruletab.c dirbrk.c runargv.c arlib.c _chdir.c switchar.c rmprq.c
  87. X
  88. X# Set source dirs so that we can find files named in this
  89. X# config file.
  90. X.SOURCE.c : $(OS)
  91. X.SOURCE.h : $(OS)
  92. X
  93. X# See if we modify anything in the lower levels.
  94. X.IF $(OSRELEASE) != $(NULL)
  95. X   .INCLUDE .IGNORE : $(OS)$(DIRSEPSTR)$(OSRELEASE)$(DIRSEPSTR)config.mk
  96. X.END
  97. X
  98. X# Set the proper macros based on whether we are making the debugging version
  99. X# or not.
  100. X.IF $(DEBUG)
  101. X   CFLAGS    += $(DB_CFLAGS)
  102. X   LDFLAGS    += $(DB_LDFLAGS)
  103. X   LDLIBS    += $(DB_LDLIBS)
  104. X
  105. X   SILENT    := $(.SILENT)
  106. X   .SILENT    := yes
  107. X   TARGET    := db$(TARGET)
  108. X   OBJDIR    := $(OBJDIR).dbg
  109. X   .SILENT    := $(SILENT)
  110. X
  111. X   SRC        += dbug.c malloc.c
  112. X   HDR        += db.h 
  113. X.ELSE
  114. X   CFLAGS    += $(NDB_CFLAGS)
  115. X   LDFLAGS    += $(NDB_LDFLAGS)
  116. X   LDLIBS    += $(NDB_LDLIBS)
  117. X.END
  118. SHAR_EOF
  119. chmod 0640 msdos/config.mk || echo "restore of msdos/config.mk fails"
  120. echo "x - extracting msdos/arlib.c (Text)"
  121. sed 's/^X//' << 'SHAR_EOF' > msdos/arlib.c &&
  122. X/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/RCS/arlib.c,v 1.1 90/07/19 14:10:42 dvadura Exp $
  123. X-- SYNOPSIS -- Library access code.
  124. X-- 
  125. X-- DESCRIPTION
  126. X--    This implementation uses the library timestamp inplace of the
  127. X--    library member timestamp.
  128. X--
  129. X-- AUTHOR
  130. X--      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  131. X--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  132. X--
  133. X-- COPYRIGHT
  134. X--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  135. X-- 
  136. X--      This program is free software; you can redistribute it and/or
  137. X--      modify it under the terms of the GNU General Public License
  138. X--      (version 1), as published by the Free Software Foundation, and
  139. X--      found in the file 'LICENSE' included with this distribution.
  140. X-- 
  141. X--      This program is distributed in the hope that it will be useful,
  142. X--      but WITHOUT ANY WARRANTY; without even the implied warrant of
  143. X--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  144. X--      GNU General Public License for more details.
  145. X-- 
  146. X--      You should have received a copy of the GNU General Public License
  147. X--      along with this program;  if not, write to the Free Software
  148. X--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  149. X--
  150. X-- LOG
  151. X--     $Log:    arlib.c,v $
  152. X * Revision 1.1  90/07/19  14:10:42  dvadura
  153. X * Initial Revision of Version 3.5
  154. X * 
  155. X*/
  156. X
  157. X#include "extern.h"
  158. X#include "macros.h"
  159. X#include "vextern.h"
  160. X
  161. Xtime_t
  162. Xseek_arch(name, lib)
  163. Xchar*    name;
  164. Xchar*    lib;
  165. X{
  166. X   static    int    warned = FALSE;
  167. X
  168. X   if (!warned && !(Glob_attr&A_SILENT))
  169. X       warned = TRUE,
  170. X       Warning("Can't extract library member timestamp;\n\
  171. X       using library timestamp instead.");
  172. X   return (Do_stat(lib, NULL, NULL));
  173. X}
  174. X
  175. Xint
  176. Xtouch_arch(name, lib)
  177. Xchar*    name;
  178. Xchar*    lib;
  179. X{
  180. X   static    int    warned = FALSE;
  181. X
  182. X   if (!warned && !(Glob_attr&A_SILENT))
  183. X       warned = TRUE,
  184. X       Warning("Can't update library member timestamp;\n\
  185. X       touching library instead.");
  186. X   return (Do_touch(lib, NULL, NULL));
  187. X}
  188. X
  189. SHAR_EOF
  190. chmod 0440 msdos/arlib.c || echo "restore of msdos/arlib.c fails"
  191. echo "x - extracting msdos/_chdir.c (Text)"
  192. sed 's/^X//' << 'SHAR_EOF' > msdos/_chdir.c &&
  193. X/* RCS      -- $Header: /u2/dvadura/src/generic/dmake/src/msdos/RCS/_chdir.c,v 1.1 90/07/19 14:10:40 dvadura Exp $
  194. X-- SYNOPSIS -- Change directory.
  195. X-- 
  196. X-- DESCRIPTION
  197. X--    Under DOS change the current drive as well as the current directory.
  198. X--
  199. X-- AUTHOR
  200. X--      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  201. X--      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  202. X--
  203. X-- COPYRIGHT
  204. X--      Copyright (c) 1990 by Dennis Vadura.  All rights reserved.
  205. X-- 
  206. X--      This program is free software; you can redistribute it and/or
  207. X--      modify it under the terms of the GNU General Public License
  208. X--      (version 1), as published by the Free Software Foundation, and
  209. X--      found in the file 'LICENSE' included with this distribution.
  210. X-- 
  211. X--      This program is distributed in the hope that it will be useful,
  212. X--      but WITHOUT ANY WARRANTY; without even the implied warrant of
  213. X--      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  214. X--      GNU General Public License for more details.
  215. X-- 
  216. X--      You should have received a copy of the GNU General Public License
  217. X--      along with this program;  if not, write to the Free Software
  218. X--      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  219. X--
  220. X-- LOG
  221. X--     $Log:    _chdir.c,v $
  222. X * Revision 1.1  90/07/19  14:10:40  dvadura
  223. X * Initial Revision of Version 3.5
  224. X * 
  225. X*/
  226. X
  227. X#include <dos.h>
  228. X#include "sysintf.h"
  229. X#include "vextern.h"
  230. X
  231. X#undef   chdir         /* sysintf.h defines it to _chdir for DOS */
  232. X
  233. Xint
  234. X_chdir(path)
  235. Xchar *path;
  236. X{
  237. X   int   res;
  238. X
  239. X   res = chdir(path);
  240. X   if (res != -1 && path[1] == ':' && *path != *Pwd) {
  241. X      union REGS  reg;
  242. X
  243. X      /* we must change the logged drive, since the chdir worked. */
  244. X      reg.h.ah = 0x0E;
  245. X      reg.h.dl = (*path & ~0x20) - 'A';
  246. X      intdos(®, ®);
  247. X   }
  248. X   return (res);
  249. X}
  250. X
  251. SHAR_EOF
  252. chmod 0440 msdos/_chdir.c || echo "restore of msdos/_chdir.c fails"
  253. echo mkdir - man
  254. mkdir man
  255. echo "x - extracting man/dmake.tf (Text)"
  256. sed 's/^X//' << 'SHAR_EOF' > man/dmake.tf &&
  257. X.\" Copyright (c) 1990 Dennis Vadura, All rights reserved.
  258. X.\"
  259. X.ds TB "0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.2i +0.5i +0.5i +2.0i
  260. X.de Ip
  261. X.fi
  262. X.nr Ip \w\\$1 
  263. X.IP "\\$1" \\n(Ipu
  264. X\\$2
  265. X.nf
  266. X..
  267. X.de Is
  268. X.nr )I \w\\$1u
  269. X..
  270. X.de Ii
  271. X.in \\n()Ru
  272. X.nr )E 1
  273. X.ns
  274. X.ne 1.1v
  275. X.it 1 }N
  276. X.di ]B
  277. X\&\\$1
  278. X..
  279. X.TH DMAKE p  "UW" "Version 3.50" "Unsupported Software"
  280. X.SH NAME
  281. X\fBdmake\fR \- maintain program groups, or interdependent files
  282. X.SH SYNOPSIS
  283. X.B dmake
  284. X[-AeEhiknpqersStTuvVx] [-P#] [macro[+][:]=\fIvalue\fP] [-f file] [target ...]
  285. X.SH DESCRIPTION
  286. X.PP
  287. X.B dmake
  288. Xexecutes commands found in an external file called a
  289. X.I makefile
  290. Xto update one or more target names.
  291. XEach target may depend on zero or more prerequisite targets.
  292. XIf any of the target's prerequisites is newer than the target or if the target
  293. Xitself does not exist, then
  294. X.B dmake
  295. Xwill attempt to make the target.
  296. X.PP
  297. XIf no
  298. X.B \-f
  299. Xcommand line option is present then
  300. X.B dmake
  301. Xsearches for an existing
  302. X.I makefile
  303. Xfrom the list of prerequisites specified for the special target \fI.MAKEFILES\fR
  304. X(see the STARTUP section for more details).
  305. XIf "-" is the name of the file specified to the
  306. X.B -f
  307. Xflag then \fBdmake\fR uses standard input as the source of the makefile text.
  308. X.PP
  309. XAny macro definitions (arguments with embedded
  310. X.Q "="
  311. Xsigns) that appear on the command line are processed first
  312. Xand supersede definitions for macros of the same name found
  313. Xwithin the makefile.  It is impossible for definitions found inside the
  314. Xmakefile to redefine any macro defined on the command line.
  315. X.PP
  316. XIf no
  317. X.I target
  318. Xnames are specified on the command line, then \fBdmake\fR uses the first
  319. Xnon-special target found in the makefile as the default target.
  320. XSee the
  321. X.B "SPECIAL TARGETS"
  322. Xsection for the list of special targets and their function.
  323. X\fBdmake\fR is a re-implementation of the UNIX Make utility with
  324. Xsignificant enhancements.  Makefiles written for most previous
  325. Xversions of
  326. X.I make
  327. Xwill be handled correctly by 
  328. X.B dmake.
  329. XKnown differences between \fBdmake\fR and other versions of make
  330. Xare discussed in the
  331. X.B COMPATIBILITY
  332. Xsection found at the end of this document.
  333. X.SH OPTIONS
  334. X.IP "\fB\-A\fR"
  335. XEnable AUGMAKE special inference rule transformations (see the
  336. X.Q "PERCENT(%) RULES"
  337. Xsection), these are set to off by default.
  338. X.IP "\fB\-e\fR"
  339. XRead the environment and define all strings of the
  340. Xform '\fBENV-VAR\fP=\fIevalue\fP'
  341. Xdefined within as macros whose name is \fBENV-VAR\fP,
  342. Xand whose value is '\fIevalue\fP'.
  343. XThe environment is processed prior to processing the user
  344. Xspecified makefile thereby allowing definitions in the makefile to override
  345. Xdefinitions in the environment.
  346. X.IP "\fB\-E\fR"
  347. XSame as -e, except that the environment is processed after the
  348. Xuser specified makefile has been processed
  349. X(thus definitions in the environment override definitions in the makefile).
  350. XThe -e and -E options are mutually exclusive.
  351. XIf both are given the latter one takes effect.
  352. X.IP "\fB\-f file\fR"
  353. XUse \fBfile\fR as the source for the makefile text.
  354. XOnly one \fB\-f\fR option is allowed.
  355. X.IP "\fB\-h\fR"
  356. XPrint the command summary for \fBdmake\fR.
  357. X.IP "\fB\-i\fR"
  358. XTells \fBdmake\fR to ignore errors, and continue making other targets.
  359. XThis is equivalent to the .IGNORE attribute or macro.
  360. X.IP "\fB\-k\fR"
  361. XCauses \fBdmake\fR to ignore errors caused by command execution and to make
  362. Xall targets not depending on targets that could not be made. 
  363. XOrdinarily \fBdmake\fR stops after a command returns a non-zero status,
  364. Xspecifying \fB\-k\fR causes \fBdmake\fR to ignore the error
  365. Xand continue to make as much as possible.
  366. X.IP "\fB\-n\fR"
  367. XCauses \fBdmake\fR to print out what it would have executed,
  368. Xbut does not actually execute the commands.  A special check is made for
  369. Xthe string "$(MAKE)" inside a recipe line, if found, the line is expanded
  370. Xand invoked, thereby enabling recursive makes to give a full
  371. Xdescription of all that they will do.
  372. XThe check for "$(MAKE)" is disabled inside group recipes.
  373. X.IP "\fB\-p\fR"
  374. XPrint out a version of the digested makefile in human readable form.
  375. X(useful for debugging, but cannot be re-read by \fBdmake\fP)
  376. X.IP "\fB\-P#\fR"
  377. XOn systems that support multi-processing cause \fBdmake\fP to use \fI#\fP
  378. Xconcurrent child processes to make targets.  See the
  379. X.Q "MULTI PROCESSING"
  380. Xsection for more information.
  381. X.IP "\fB\-q\fR"
  382. XCheck and see if the target is up to date.  Exits with code 0 if up to date,
  383. X1 otherwise.
  384. X.IP "\fB\-r\fR"
  385. XTells \fBdmake\fR not to read the initial startup makefile, see STARTUP
  386. Xsection for more details.
  387. X.IP "\fB\-s\fR"
  388. XTells \fBdmake\fR to do all its work silently and not echo the commands it is
  389. Xexecuting to stdout (also suppresses warnings).
  390. XThis  is equivalent to the .SILENT attribute or macro.
  391. X.IP "\fB\-S\fR"
  392. XForce sequential execution of recipes on architectures which support
  393. Xconcurrent makes.  For backward compatibility with old makefiles that have
  394. Xnasty side-effect prerequisite dependencies.
  395. X.IP "\fB\-t\fR"
  396. XCauses \fBdmake\fR to touch the targets and bring them up to date
  397. Xwithout executing any commands.
  398. X.IP "\fB\-T\fR"
  399. XTells \fBdmake\fP to not perform transitive closure on the inference graph.
  400. X.IP "\fB\-u\fR"
  401. XForce an unconditional update.  (ie. do everything that would
  402. Xbe done if everything that a target depended on was out of date)
  403. X.IP "\fB\-v\fR"
  404. XVerbose flag, when making targets print to stdout what we are going to make
  405. Xand what we think it's timestamp is.
  406. X.IP "\fB\-V\fR"
  407. XPrint the version of \fBdmake\fR, and values of builtin macros.
  408. X.IP "\fB\-x\fR"
  409. XUpon processing the user makefile export all non-internally defined macros
  410. Xto the user's environment.  This option together with the -e option
  411. Xallows SYSV AUGMAKE recursive makes to function as expected.
  412. X.SH INDEX
  413. XHere is a list of the sections that follow and a short description of each.
  414. XPerhaps you won't have to read the whole man page to find
  415. Xwhat you need.
  416. X.IP \fBSTARTUP\fP 1.9i
  417. XDescribes \fBdmake\fP initialization.
  418. X.IP \fBSYNTAX\fP 1.9i
  419. XDescribes the syntax of makefile expressions.
  420. X.IP \fBATTRIBUTES\fP 1.9i
  421. XDescribes the notion of attributes and how they are used when
  422. Xmaking targets.
  423. X.IP \fBMACROS\fP 1.9i
  424. XDefining and expanding macros.
  425. X.IP "\fBRULES AND TARGETS" 1.9i
  426. XHow to define targets and their prerequisites.
  427. X.IP \fBRECIPES\fP 1.9i
  428. XHow to tell \fBdmake\fP how to make a target.
  429. X.IP "\fBTEXT DIVERSIONS\fP" 1.9i
  430. XHow to use text diversions for long argument lists in recipes.
  431. X.IP "\fBSPECIAL TARGETS\fP" 1.9i
  432. XSome targets are special.
  433. X.IP "\fBSPECIAL MACROS\fP" 1.9i
  434. XMacros used by \fBdmake\fP to alter the processing of the makefile,
  435. Xand those defined by \fBdmake\fP for the user.
  436. X.IP "\fBDYNAMIC PREREQUISITES\fP" 1.9i
  437. XProcessing of prerequisites which contain macro expansions in their name.
  438. X.IP "\fBBINDING TARGETS\fP" 1.9i
  439. XThe rules that \fBdmake\fP uses to bind
  440. Xa target to an existing file in the file system.
  441. X.IP "\fBPERCENT(%) RULES\fP" 1.9i
  442. XSpecification of recipes to be used by the inference algorithm.
  443. X.IP "\fBMAKING INFERENCES\fP" 1.9i
  444. XThe rules that \fBdmake\fP uses when inferring how to make a target which
  445. Xhad no explicit recipe.  This and the previous section are really a single
  446. Xsection in the text below.
  447. X.IP "\fBMAKING TARGETS\fP" 1.9i
  448. XHow \fBdmake\fP makes targets other than libraries.
  449. X.IP "\fBMAKING LIBRARIES\fP" 1.9i
  450. XHow \fBdmake\fP makes libraries.
  451. X.IP "\fBMULTI PROCESSING\fP" 1.9i
  452. XDiscussion of \fBdmake's\fP parallel make facilities for architectures that
  453. Xsupport them.
  454. X.IP "\fBCONDITIONALS\fP" 1.9i
  455. XConditional expressions which control the processing of the makefile.
  456. X.IP "\fBEXAMPLES\fP" 1.9i
  457. XSome hopefully useful examples.
  458. X.IP "\fBCOMPATIBILITY\fP" 1.9i
  459. XHow \fBdmake\fP compares with previous versions of make.
  460. X.IP "\fBLIMITS\fP" 1.9i
  461. XLimitations of \fBdmake\fP.
  462. X.IP \fBPORTABILITY\fP 1.9i
  463. XComments on writing portable makefiles.
  464. X.IP \fBFILES\fP 1.9i
  465. XFiles used by \fBdmake\fP.
  466. X.IP "\fBSEE ALSO\fP" 1.9i
  467. XOther related programs, and man pages.
  468. X.IP "\fBAUTHOR\fP" 1.9i
  469. XThe guy responsible for this thing.
  470. X.IP \fBBUGS\fP 1.9i
  471. XHope not.
  472. X.SH STARTUP
  473. XWhen
  474. X.B dmake
  475. Xbegins execution it first processes the command line and then it processes
  476. Xan initial startup-makefile.
  477. XThis is followed by an attempt to locate and process a user supplied makefile.
  478. XThe startup file defines the default values of all required control macros
  479. Xand the set of default rules for making inferences.
  480. XWhen searching for the startup makefile,
  481. X.B dmake
  482. Xsearches the following locations, in order, until a startup file is located:
  483. X.LP
  484. X.RS
  485. X.IP 1.
  486. XThe location given as the value of the macro MAKESTARTUP defined on the
  487. Xcommand line.
  488. X.IP 2.
  489. XThe location given as the value of the environment variable MAKESTARTUP
  490. Xdefined in the current environment.
  491. X.IP 3.
  492. XThe location given as the value of the macro MAKESTARTUP defined internally
  493. Xwithin \fBdmake\fP.
  494. X.RE
  495. X.LP
  496. XThe above search is disabled by specifying the -r option on the command line.
  497. XAn error is issued if a startup makefile cannot be found and the -r
  498. Xoption was not specified.
  499. XA user may substitute a custom startup file by defining
  500. Xthe MAKESTARTUP environment variable or by redefining the
  501. XMAKESTARTUP macro on the command line.
  502. XTo find out where
  503. X.B dmake
  504. Xlooks for the default startup file, check your environment or issue the command
  505. X\fI"dmake -V"\fP to determine the builtin value of MAKESTARTUP.
  506. X.PP
  507. XA similar search is performed to locate a default user makefile when no
  508. X\fB-f\fP command line option is specified.
  509. XThe special target .MAKEFILES is internally defined by default.
  510. XThis target's prerequisite list specifies the names of files and the order that
  511. X\fBdmake\fP will use to search for them when attempting to locate the default
  512. Xmakefile.
  513. XA typical definition for this target is:
  514. X.RS
  515. X.sp
  516. X\&.MAKEFILES : makefile.mk Makefile makefile
  517. X.sp
  518. X.RE
  519. X\fBdmake\fP will first look for makefile.mk and then the others.
  520. XIf a prerequisite
  521. Xcannot be found \fBdmake\fP will try to make it before going on to the next
  522. Xprerequisite.  For example, makefile.mk can be checked out of an RCS file
  523. Xif the proper rules for doing so are defined in the startup file.
  524. X.SH SYNTAX
  525. XThis section is a summary of the syntax of makefile statements.
  526. XThe description is given in a style similar to BNF, where { } enclose
  527. Xitems that may appear zero or more times, and [ ] enclose items that
  528. Xare optional.  Alternative productions for a left hand side are indicated
  529. Xby '->', and newlines are significant.  All symbols in \fBbold\fP type
  530. Xare text or names representing text supplied by the user.
  531. X.sp 2
  532. X.RS
  533. X.Ip "Makefile" "\(-> { Statement }"
  534. X.Ip "Statement" "\(-> Macro-Definition"
  535. X\(-> Conditional
  536. X\(-> Rule-Definition
  537. X\(-> Attribute-Definition
  538. X.Ip "Macro-Definition" "\(-> \fBMACRO = LINE\fP"
  539. X\(-> \fBMACRO := LINE\fP
  540. X\(-> \fBMACRO += LINE\fP
  541. X\(-> \fBMACRO +:= LINE\fP
  542. X.Ip "Conditional \(-> " "\fB\&.IF\fR expression"
  543. X   Makefile
  544. X[ \fB.ELSE\fR
  545. X   Makefile ]
  546. X\fB\&.END\fR
  547. X.Ip expression    "\(-> \fBLINE\fR"
  548. X\(-> \fBSTRING == LINE\fR
  549. X\(-> \fBSTRING != LINE\fR
  550. X.sp
  551. X.Ip "Rule-Definition \(-> " "target-definition"
  552. X   [ recipe ]
  553. X.PP
  554. Xtarget-definition \(-> targets [attrs] op { \fBPREREQUISITE\fP } [\fB;\fR rcp-line]
  555. X.Ip "targets" "\(-> target { targets }"
  556. X\(-> \fB"\fRtarget\fB"\fR { targets }
  557. X.Ip "target" "\(-> special-target"
  558. X\(-> \fBTARGET\fR
  559. X.Ip "attrs" "\(-> attribute { attrs }"
  560. X\(-> \fB"\fRattribute\fB"\fR { attrs }
  561. X.Ip "op" "\(-> \fB:\fR { modifier }"
  562. X.Ip "modifier" "\(-> \fB:\fR"
  563. X\(-> \fB^\fR
  564. X\(-> \fB!\fR
  565. X\(-> \fB-\fR
  566. X.Ip "recipe" "\(-> { \fBTAB\fR rcp-line }"
  567. X\(-> [\fB@\fR][\fB-\fR] \fB[
  568. X.Is "recipe \(-> "
  569. X.Ii " "
  570. X   \fR{ \fBLINE\fR }
  571. X.Ii " "
  572. X\fB]\fR
  573. X.Ip "rcp-line" "\(-> [\fB@\fR][\fB-\fR] \fBLINE\fR"
  574. X.sp
  575. X.Ip Attribute-Definition "\(-> attrs \fB:\fR targets"
  576. X.sp
  577. X.Ip "attribute"     "\(-> \fB.EPILOG\fR"
  578. X\(-> \fB.IGNORE\fR
  579. X\(-> \fB.LIBRARY\fR
  580. X\(-> \fB.NOINFER\fR
  581. X\(-> \fB.PRECIOUS\fR
  582. X\(-> \fB.PROLOG\fR
  583. X\(-> \fB.SETDIR=\fIpath\fP\fR
  584. X\(-> \fB.SILENT\fR
  585. X\(-> \fB.SEQUENTIAL\fR
  586. X\(-> \fB.SYMBOL\fR
  587. X\(-> \fB.UPDATEALL\fR
  588. X.Ip "special-target" "\(-> \fB.ERROR\fR"
  589. X\(-> \fB.EXPORT\fR
  590. X\(-> \fB.GROUPEPILOG\fR
  591. X\(-> \fB.GROUPPROLOG\fR
  592. X\(-> \fB.IMPORT\fR
  593. X\(-> \fB.INCLUDE\fR
  594. X\(-> \fB.INCLUDEDIRS\fR
  595. X\(-> \fB.MAKEFILES\fR
  596. X\(-> \fB.REMOVE\fR
  597. X\(-> \fB.SOURCE\fR
  598. X\(-> \fB.SOURCE.\fIsuffix\fR
  599. X\(-> .\fIsuffix1\fR.\fIsuffix2\fR
  600. X.fi
  601. X.RE
  602. X.sp 1
  603. X.PP
  604. XWhere, \fBTAB\fP represents a <tab> character, \fBSTRING\fP represents an
  605. Xarbitrary sequence of characters, and
  606. X\fBLINE\fP represents a
  607. Xpossibly empty sequence of characters terminated by a non-escaped 
  608. X(not immediately preceded by a backslash '\\') new-line character.
  609. X\fBMACRO\fP, \fBPREREQUISITE\fP,
  610. Xand \fBTARGET\fP each represent a string of characters not
  611. Xincluding space or tab which respectively form the name of a macro,
  612. Xprerequisite or target.
  613. XThe name may itself be a macro expansion expression.
  614. XA \fBLINE\fP can be continued over several physical lines by terminating it with
  615. Xa single backslash character.  Comments are initiated by the
  616. Xpound '\fB#\fR' character and extend to the end of line.
  617. XAll comment text is discarded, a '#' may be placed into the makefile text
  618. Xby escaping it with '\\' (ie. \\# translates to # when
  619. Xit is parsed).
  620. XA group of continued lines may be commented out by placing a single # at the
  621. Xstart of the first line of the group.
  622. XA continued line may not span more than one makefile.
  623. X.PP
  624. X\fBwhite space\fP is defined to be any combination of
  625. X<space>, <tab>, and the sequence \\<nl>
  626. Xwhen \\<nl> is used to terminate a LINE.
  627. XWhen processing \fBmacro\fP definition lines,
  628. Xany amount of white space is allowed on either side of the macro operator
  629. X(=, :=, += or +:=), and
  630. Xwhite space is stripped from both before and after the macro
  631. Xvalue string.
  632. XThe sequence \\<nl> is treated as
  633. Xwhite space during recipe expansion
  634. Xand is deleted from the final recipe string.
  635. XYou must escape the \\<nl> with a \\ in order to get a \\<nl> at the end
  636. Xof a recipe line.
  637. XThe \\<nl> sequence is always deleted from macro values.
  638. X.PP
  639. XWhen processing \fBtarget\fP definition lines,
  640. Xthe recipe for a target must, in general, follow the first definition
  641. Xof the target (See the RULES AND TARGETS section for an exception), and
  642. Xthe recipe may not span across multiple makefiles.
  643. XAny targets and prerequisites found on a target definition line are taken
  644. Xto be white space separated tokens.
  645. XThe rule operator (\fIop\fP in SYNTAX section) is also considered
  646. Xto be a token but does not require
  647. Xwhite space to precede or follow it.  Since the rule operator begins with a `:',
  648. Xtraditional versions of make do not allow the `:' character to
  649. Xform a valid target name.  \fBdmake\fP allows `:' to be present in
  650. Xtarget/prerequisite names as long as the entire target/prerequisite name is
  651. Xquoted.  For example:
  652. X.sp
  653. X\ta:fred : test
  654. X.sp
  655. Xwould be parsed as TARGET = a, PREREQUISITES are fred, :, and test, which
  656. Xis not what was intended.  To fix this you must write:
  657. X.sp
  658. X\t"a:fred" : test
  659. X.sp
  660. XWhich will be parsed as expected.
  661. XSee the EXAMPLES section for how to apply this to a list of targets.
  662. X.SH ATTRIBUTES
  663. X.B dmake
  664. Xdefines several target attributes.  Attributes may be
  665. Xassigned to a single target, a group of targets, or to all targets in the
  666. Xmakefile.  Attributes are used to modify
  667. X\fBdmake\fP actions during target update.
  668. XThe recognized attributes are:
  669. X.sp
  670. X.IP \fB.EPILOG\fP 1.2i
  671. XInsert shell epilog code when executing a group recipe associated with
  672. Xany target having this attribute set.
  673. X.IP \fB.IGNORE\fP 1.2i
  674. XIgnore an error when trying to make any target with this attribute set.
  675. X.IP \fB.LIBRARY\fP 1.2i
  676. XTarget is a library.
  677. X.IP \fB.NOINFER\fP 1.2i
  678. XAny target with this attribute set will not be subjected
  679. Xto transitive closure if it is inferred as a prerequisite 
  680. Xof a target whose recipe and prerequisites are being inferred.
  681. X(i.e. the inference search will not use any prerequisite with this attribute 
  682. Xset, as a target)
  683. X.IP \fB.PRECIOUS\fP 1.2i
  684. XDo not remove this target under any circumstances.
  685. XSet by default for any targets whose corresponding files exist in the file
  686. Xsystem prior to the execution of \fBdmake\fP.
  687. X.IP \fB.PROLOG\fP 1.2i
  688. XInsert shell prolog code when executing a group recipe associated with
  689. Xany target having this attribute set.
  690. X.IP \fB.SEQUENTIAL\fP 1.2i
  691. XForce a sequential make of the associated target's prerequisites.
  692. X.IP \fB.SETDIR\fP 1.2i
  693. XChange current working directory to specified directory when making associated
  694. Xtarget.  The syntax of this attribute is different from the others.  You must
  695. Xspecify the directory at the time the attribute is specified.  To do this
  696. Xsimply give \fI.SETDIR=path\fP as the attribute.  \fIpath\fP is expanded and
  697. Xthe result is used as the value of the directory to change to.
  698. XIf path is surrounded by single quotes then path is not expanded, and is used
  699. Xliterally as the directory name.
  700. XIf the \fIpath\fP contains any `:' characters then the entire attribute string
  701. Xmust be quoted using ".
  702. XIf a target having this attribute set also has the .IGNORE
  703. Xattribute set then if the change to the specified directory fails it will be
  704. Xignored, and no error message will be issued.
  705. X.IP \fB.SILENT\fP 1.2i
  706. XDo not echo the recipe lines when making any target with this attribute set,
  707. Xand do not issue any warnings.
  708. X.IP \fB.SYMBOL\fP 1.2i
  709. XTarget is a library member and is an entry point into a module in the
  710. Xlibrary.  This attribute is used only when searching a library for a target.
  711. XTargets of the form lib((entry)) have this attribute set automatically.
  712. X.IP \fB.UPDATEALL\fP 1.2i
  713. XIndicates that all the targets listed in this rule are updated by the
  714. Xexecution of the accompanying recipe.
  715. XA common example is the production of the
  716. X.I y.tab.c
  717. Xand
  718. X.I y.tab.h
  719. Xfiles by
  720. X.B yacc
  721. Xwhen it is run on a grammar.  Specifying .UPDATEALL in such a rule
  722. Xprevents the running of yacc twice, once for the y.tab.c file and once
  723. Xfor the y.tab.h file.
  724. X.sp
  725. X.PP
  726. XAll attributes are user setable and may be used in one of
  727. Xtwo forms (except .UPDATEALL, use of this attribute in a rule of the first form
  728. Xis illegal)
  729. X.sp
  730. X\tATTRIBUTE_LIST : \fItargets\fP
  731. X.sp
  732. Xassigns the attributes specified by ATTRIBUTE_LIST to each target in
  733. X.I targets
  734. Xor
  735. X.sp
  736. X\t\fItargets\fP ATTRIBUTE_LIST : ...
  737. X.sp
  738. Xassigns the attributes specified by ATTRIBUTE_LIST to each target in
  739. X.I targets.
  740. XIn the first form if
  741. X.I targets
  742. Xis empty (ie. a NULL list), then the
  743. Xlist of attributes will apply to all targets in the makefile
  744. X(this is equivalent to the common Make construct of \fI".IGNORE :"\fP
  745. Xbut has been modified to the notion of an attribute instead of
  746. Xa special target).
  747. XNot all of the attributes have global meaning.
  748. XIn particular, .LIBRARY, .SYMBOL, and .UPDATEALL
  749. Xhave no assigned global meaning.
  750. X.PP
  751. XAny attribute may be used with any target, even with the special targets.
  752. XSome combinations are useless (e.g. .INCLUDE .PRECIOUS: ... ),
  753. Xwhile others are useful (e.g. .INCLUDE .IGNORE : "file.mk" will not complain
  754. Xif file.mk cannot be found using the include file search rules,
  755. Xsee the section on SPECIAL TARGETS for a description of .INCLUDE).
  756. XIf a specified attribute will not be used with the special target a warning
  757. Xis issued and the attribute is ignored.
  758. X.SH MACROS
  759. X.B dmake
  760. Xsupports four types of macro assignment.
  761. XThe first and most familiar is the usual assignment:
  762. X.sp
  763. X\tMACRO = LINE
  764. X.sp
  765. Xwhich causes LINE to be assigned without expansion, as the value of MACRO.
  766. XThe second form:
  767. X.sp
  768. X\tMACRO := LINE
  769. X.sp
  770. Xis new and indicates that LINE should be expanded prior to being assigned as
  771. Xthe value of MACRO.  Future expansions of MACRO do not have the value expanded
  772. Xsince it was expanded when the macro was defined.
  773. XThe third form of macro assignment allows macro values to grow:
  774. X.sp
  775. X\tMACRO += LINE
  776. X.sp
  777. Xadds the value of LINE to the previous value of MACRO separating the two by a
  778. Xsingle space (LINE is not expanded).  The final form:
  779. X.sp
  780. X\tMACRO +:= LINE
  781. X.sp
  782. Xis similar to \fB+=\fP,
  783. Xwith the difference that the value of LINE is expanded before being added to
  784. Xthe previous value of MACRO.
  785. X.PP
  786. XWhen \fBdmake\fP defines a non-environment macro it strips leading and
  787. Xtrailing white space from the macro value.
  788. XMacros imported from the environment via either the .IMPORT special
  789. Xtarget (see the SPECIAL TARGETS section), or the \fB-e\fP, or \fB-E\fP flags
  790. Xare an exception to this rule.  Their values are
  791. Xalways taken literally and white space is never stripped.
  792. XIn addition, macros defined using the .IMPORT special target do
  793. Xnot have their values expanded when they are used within a makefile.
  794. XIn contrast, environment macros that are imported
  795. Xdue to the specification of the \fB-e\fP or \fB-E\fP flags
  796. Xare subject to expansion when used.
  797. X.PP
  798. XTo specify a macro expansion
  799. Xenclose the name in () or {} and precede it with a dollar sign $.
  800. XThus $(TEST) represents an expansion of the macro variable named TEST.
  801. XIf TEST is
  802. Xdefined then $(TEST) is replaced by its expanded value.  If TEST is not
  803. Xdefined then $(TEST) expands to the NULL string (this is equivalent to
  804. Xdefining a macro as 'TEST=' ).  A short form may be used for single character
  805. Xnamed macros.  In this case the parentheses are optional, and $(I) is
  806. Xequivalent to $I.
  807. XMacro expansion is recursive, hence if the value string contains an expression
  808. Xrepresenting a macro expansion, the expansion is performed.  Circular macro
  809. Xexpansions are detected and cause an error to be issued.
  810. X.PP
  811. XWhen defining a macro the given macro name is first expanded before being used
  812. Xto define the macro.  Thus it is possible to define macros whose names
  813. Xdepend on values of other macros.  For example, suppose
  814. X.sp
  815. X\tCWD = $(PWD:b)
  816. X.sp
  817. Xis defined, then the value of $(CWD) is the name of the current directory.
  818. XThis can be used to define macros specific to this directory, for
  819. Xexample:
  820. X.sp
  821. X\t_$(CWD).prt = list of files to print...
  822. X.sp
  823. XThe actual name of the defined macro is a function of the current directory.
  824. XA construct such as this is useful when processing a hierarchy of directories
  825. Xusing .SETDIR attributed targets and a collection of small distributed
  826. Xmakefile stubs.
  827. X.PP
  828. XMacro variables may be defined within the makefile, on the command
  829. Xline, or imported from the environment.
  830. X.PP
  831. X.B \fBdmake\fR
  832. Xsupports several non-standard macro expansions:
  833. XThe first is of the form:
  834. X.RS
  835. X.IP \fI$(macro_name:modifier_list:modifier_list:...)\fR
  836. X.RE
  837. X.LP
  838. Xwhere
  839. X.I modifier_list
  840. Xis chosen from the set { D or d, F or f, B or b, S or s, T or t } and
  841. X.RS
  842. X.sp
  843. X.Is "d "
  844. X.Ii "d "
  845. X\- directory portion of all path names
  846. X.Ii "f"
  847. X\- file (including suffix) portion of path names
  848. X.Ii "b"
  849. X\- file (not including suffix) portion of path names
  850. X.Ii "s"
  851. X\- simple pattern substitution
  852. X.Ii "t"
  853. X\- tokenization.
  854. X.sp
  855. X.RE
  856. XThus if we have the example:
  857. X.LP
  858. X\ttest = d1/d2/d3/a.out f.out d1/k.out
  859. X.LP
  860. XThe following macro expansions produce the values on the right of '-->' after
  861. Xexpansion.
  862. X.RS
  863. X.sp
  864. X.Is "$(test:s/out/in/:f)  "
  865. X.Ii "$(test:d)"
  866. X--> d1/d2/d3/ d1/
  867. X.Ii "$(test:b)"
  868. X--> a f k
  869. X.Ii "$(test:f)"
  870. X--> a.out f.out k.out
  871. X.Ii "${test:db}"
  872. X--> d1/d2/d3/a f d1/k
  873. X.Ii "${test:s/out/in/:f}"
  874. X--> a.in f.in k.in
  875. X.Ii $(test:f:t"+")
  876. X--> a.out+f.out+k.out
  877. X.RE
  878. X.PP
  879. XIf a token ends in a string composed from the value of the macro DIRBRKSTR
  880. X(ie. ends in a directory separator string, e.g. '/' in UNIX) and you use the
  881. X\fB:d\fP modifier then the expansion returns the directory name less the
  882. Xfinal directory separator string.  Thus successive pairs of :d modifiers
  883. Xeach remove a level of directory in the token string.
  884. X.PP
  885. XThe tokenization modifier takes all white space separated tokens from the
  886. Xmacro value and separates them by the quoted separator string.  The separator
  887. Xstring may contain the following escape codes \\a => <bel>,
  888. X\&\\b => <backspace>, \\f => <formfeed>, \\n => <nl>, \\r => <cr>,
  889. X\&\\t => <tab>, \\v => <vertical tab>, \\" => ", and \\xxx => <xxx> where
  890. Xxxx is the octal representation of a character.  Thus the
  891. Xexpansion:
  892. X.LP
  893. X.RS
  894. X.nf
  895. X$(test:f:t"+\\n")
  896. X.RE
  897. X.sp
  898. Xgives:
  899. X.sp
  900. X.RS
  901. Xa.out+
  902. Xf.out+
  903. Xk.out
  904. X.fi
  905. X.RE
  906. X.PP
  907. XThe second non-standard form of macro expansion allows for recursive macros.
  908. XIt is possible to specify a $(\fImacro_name\fR) or ${\fImacro_name\fR} expansion
  909. Xwhere \fImacro_name\fR contains more $( ... ) or ${ ... } macro expansions
  910. Xitself.
  911. X.PP
  912. XFor example $(CC$(_HOST)$(_COMPILER)) will first expand CC$(_HOST)$(_COMPILER)
  913. Xto get a result and use that result as the name of the macro to expand.
  914. XThis is useful for writing a makefile for more than one target
  915. Xenvironment.  As an example consider the following hypothetical case. 
  916. XSuppose that _HOST and _COMPILER are imported from the environment
  917. Xand are set to represent the host machine type and the host compiler
  918. Xrespectively.
  919. X.RS
  920. X.sp
  921. X.nf
  922. XCFLAGS_VAX_CC = -c -O    # _HOST == "_VAX", _COMPILER == "_CC"
  923. XCFLAGS_PC_MSC = -c -ML    # _HOST == "_PC",  _COMPILER == "_MSC"
  924. X.sp
  925. X# redefine CFLAGS macro as:
  926. X.sp
  927. XCFLAGS := $(CFLAGS$(_HOST)$(_COMPILER))
  928. X.fi
  929. X.sp
  930. X.RE
  931. XThis causes CFLAGS to take on a value that corresponds to the
  932. Xenvironment in which the make is being invoked.
  933. X.PP
  934. XThe final non-standard macro expansion is of the form:
  935. X.RS
  936. X.sp
  937. Xstring1{token_list}string2
  938. X.RE
  939. X.LP
  940. Xwhere string1, string2 and token_list are expanded.  After expansion,
  941. Xstring1 is prepended to each token found in token_list and
  942. Xstring2 is appended to each resulting token from the previous prepend.
  943. Xstring1 and string2 are not delimited by white space
  944. Xwhereas the tokens in token_list are.  A null token in the token list 
  945. Xis specified using "".
  946. XThus using another example we have:
  947. X.RS
  948. X.sp
  949. X.Is "test/{ f1  ""f2"" """" }.o    "
  950. X.Ii "test/{f1 f2}.o"
  951. X--> test/f1.o test/f2.o
  952. X.Ii "test/ {f1 f2}.o"
  953. X--> test/ f1.o f2.o
  954. X.Ii "test/{f1 f2} .o"
  955. X--> test/f1 test/f2 .o
  956. X.Ii "test/{ f1  ""f2"" """" }.o"
  957. X--> test/f1.o test/f2.o test/.o
  958. X.sp
  959. X.Ii and
  960. X.sp
  961. X.Is "test/{ d1 d2 }/{ f1 f2 }.o --> "
  962. X.Ii "test/{ d1 d2 }/{ f1 f2 }.o --> "
  963. Xtest/d1/f1.o test/d1/f2.o
  964. Xtest/d2/f1.o test/d2/f2.o
  965. X.sp
  966. X.RE
  967. XSee the SPECIAL MACROS section for a description of the special macros that
  968. X\fBdmake\fP defines and understands.
  969. X.SH "RULES AND TARGETS"
  970. XA makefile contains a series of entries that specify dependencies.
  971. XSuch entries are called \fItarget/prerequisite\fP or \fIrule\fP definitions.
  972. XEach rule definition
  973. Xis optionally followed by a set of lines that provide a recipe for updating
  974. Xany targets defined by the rule.
  975. XWhenever
  976. X.B dmake
  977. Xattempts to bring a target up to date and an explicit recipe is provided with
  978. Xa rule defining the target, that recipe is used to update the
  979. Xtarget.  A rule definition begins with a line having the following syntax:
  980. X.sp
  981. X.RS
  982. X.nf
  983. X\fI<targets>\fP [\fI<attributes>\fP] \fI<ruleop>\fP [\fI<prerequisites>\fP] [;\fI<recipe>\fP]
  984. X.fi
  985. X.RE
  986. X.sp
  987. X.I targets
  988. Xis a non-empty list of targets.  If the target is a
  989. Xspecial target (see SPECIAL TARGETS section below) then it must appear alone
  990. Xon the rule line.  For example:
  991. X.sp
  992. X.RS
  993. X\&.IMPORT .ERROR : ...
  994. X.RE
  995. X.sp
  996. Xis not allowed since both .IMPORT and .ERROR are special targets.
  997. XSpecial targets are not used in the construction of the dependency graph and
  998. Xwill not be made.
  999. X.PP
  1000. X.I attributes
  1001. Xis a possibly empty list of attributes.  Any attribute defined in the
  1002. XATTRIBUTES section above may be specified.  All attributes will be applied to
  1003. Xthe list of named targets in the rule definition.  No other targets will
  1004. Xbe affected.
  1005. X.sp
  1006. X.IP NOTE: 0.75i
  1007. XAs stated earlier,
  1008. Xif both the target list and prerequisite list are empty but the attributes
  1009. Xlist is not, then the specified attributes affect all targets in the makefile.
  1010. X.sp
  1011. X.PP
  1012. X.I ruleop
  1013. Xis a separator which is used to identify the targets from the prerequisites.
  1014. XOptionally it also provides a facility for modifying the way in which
  1015. X.B dmake
  1016. Xhandles the making of the associated targets.
  1017. XIn its simplest form the operator is a single ':', and need not be separated
  1018. Xby white space from its neighboring tokens.  It may additionally be followed
  1019. Xby any of the modifiers { !, ^, -, : }, where:
  1020. X.sp
  1021. X.IP \fB!\fP
  1022. Xsays execute the recipe for the associated targets once for each out of date
  1023. Xprerequisite.  Ordinarily the recipe is executed
  1024. Xonce for all out of date prerequisites at the same time.
  1025. X.IP \fB^\fP
  1026. Xsays to insert the specified prerequisites, if any, before any
  1027. Xother prerequisites already associated with the specified targets.
  1028. XIn general, it is not useful to specify ^ with an empty
  1029. Xlist of prerequisites.
  1030. X.IP \fB-\fP
  1031. Xsays to clear the previous list of prerequisites before adding
  1032. Xthe new prerequisites.  Thus,
  1033. X.sp
  1034. X\t.SUFFIXES :
  1035. X.br
  1036. X\t.SUFFIXES : .a .b
  1037. X.sp
  1038. Xcan be replaced by
  1039. X.sp
  1040. X\t.SUFFIXES :- .a .b
  1041. X.sp
  1042. Xhowever the old form still works as expected.  NOTE:  .SUFFIXES is ignored by
  1043. X.B dmake
  1044. Xit is used here simply as an example.
  1045. X.IP \fB:\fP
  1046. XWhen the rule operator is not modified by a second ':'
  1047. Xonly one set of rules may be specified for making a target.
  1048. XMultiple definitions may be used to add to the
  1049. Xlist of prerequisites that a target depends on.
  1050. XHowever, if a target is multiply defined
  1051. Xonly one definition may specify a recipe
  1052. Xfor making the target.
  1053. X.sp
  1054. XWhen a target's rule operator is modified by a second ':'
  1055. X(:: for example) then this definition may not be the only
  1056. Xdefinition with a recipe for the target.  There may be other :: target
  1057. Xdefinition lines that specify a different set of prerequisites with a
  1058. Xdifferent recipe for updating the target.  
  1059. XAny such target is made if any of the definitions
  1060. Xfind it to be out of date
  1061. Xwith respect to the related prerequisites
  1062. Xand uses the corresponding recipe to update the
  1063. Xtarget.
  1064. X.sp 
  1065. XIn the following simple example, each rule has a `::' \fIruleop\fP.  In such an
  1066. Xoperator we call the first `:' the operator, and the second `:' the modifier.
  1067. X.sp
  1068. X.nf
  1069. Xa.o :: a.c b.h
  1070. X   first recipe for making a.o
  1071. X
  1072. Xa.o :: a.y b.h
  1073. X   second recipe for making a.o
  1074. X.fi
  1075. X.sp
  1076. XIf a.o is found to be out of date with respect to a.c then the first recipe
  1077. Xis used to make a.o.  If it is found out of date with respect to a.y then
  1078. Xthe second recipe is used.  If a.o is out of date with respect to
  1079. Xb.h then both recipes are invoked to make a.o.
  1080. XIn the last case the order of invocation corresponds to the order in which the
  1081. Xrule definitions appear in the makefile.
  1082. X.PP
  1083. XTargets defined using a single `:' operator
  1084. Xwith a recipe may be redefined again with a new recipe by using a
  1085. X`:' operator with a `:' modifier.
  1086. XThis is equivalent to a target having been
  1087. Xinitially defined with a rule using a `:' modifier.
  1088. XOnce a target is defined using a `:'
  1089. Xmodifier it may not be defined again with a recipe using only the `:' operator
  1090. Xwith no `:' modifier.  In both cases the use of a `:' modifier creates a new
  1091. Xlist of prerequisites and makes it the current prerequisite list for the target.
  1092. XThe `:' operator with no recipe always modifies the current list
  1093. Xof prerequisites.
  1094. XThus assuming each of the following definitions has a recipe attached, then:
  1095. X.RS
  1096. X.sp
  1097. X.nf
  1098. Xjoe :  fred ...    (1)
  1099. Xjoe :: more ...    (2)
  1100. X.sp
  1101. Xand
  1102. X.sp
  1103. Xjoe :: fred ...    (3)
  1104. Xjoe :: more ...    (4)
  1105. X.sp
  1106. X.fi
  1107. X.RE
  1108. Xare legal and mean:  add the recipe associated with (2), or (4) to the set
  1109. Xof recipes for joe, placing them after existing recipes for
  1110. Xmaking joe.
  1111. XThe construct:
  1112. X.RS
  1113. X.sp
  1114. X.nf
  1115. Xjoe :: fred ...    (5)
  1116. Xjoe : more ...    (6)
  1117. X.sp
  1118. SHAR_EOF
  1119. echo "End of part 7"
  1120. echo "File man/dmake.tf is continued in part 8"
  1121. echo "8" > s2_seq_.tmp
  1122. exit 0
  1123.  
  1124.