home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume15
/
dmake-3.6
/
part14
< prev
next >
Wrap
Text File
|
1990-10-14
|
40KB
|
927 lines
Newsgroups: comp.sources.misc
X-UNIX-From: dvadura@watdragon.waterloo.edu
subject: v15i066: dmake version 3.6 (part 14/25)
from: Dennis Vadura <dvadura@watdragon.waterloo.edu>
Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
Posting-number: Volume 15, Issue 66
Submitted-by: Dennis Vadura <dvadura@watdragon.waterloo.edu>
Archive-name: dmake-3.6/part14
#!/bin/sh
# this is part 14 of a multipart archive
# do not concatenate these parts, unpack them in order with /bin/sh
# file man/dmake.p continued
#
CurArch=14
if test ! -r s2_seq_.tmp
then echo "Please unpack part 1 first!"
exit 1; fi
( read Scheck
if test "$Scheck" != $CurArch
then echo "Please unpack part $Scheck next!"
exit 1;
else exit 0; fi
) < s2_seq_.tmp || exit 1
echo "x - Continuing file man/dmake.p"
sed 's/^X//' << 'SHAR_EOF' >> man/dmake.p
X b.h then both recipes are invoked to make a.o. In the
X last case the order of invocation corresponds to the
X order in which the rule definitions appear in the
X makefile.
X
X Targets defined using a single `:' operator with a recipe
X may be redefined again with a new recipe by using a `:'
X operator with a `:' modifier. This is equivalent to a tar-
X get having been initially defined with a rule using a `:'
X modifier. Once a target is defined using a `:' modifier it
X
X
X
XVersion 3.50 UW 16
X
X
X
X
XDMAKE(p) Unsupported Software DMAKE(p)
X
X
X
X may not be defined again with a recipe using only the `:'
X operator with no `:' modifier. In both cases the use of a
X `:' modifier creates a new list of prerequisites and makes
X it the current prerequisite list for the target. The `:'
X operator with no recipe always modifies the current list of
X prerequisites. Thus assuming each of the following defini-
X tions has a recipe attached, then:
X
X joe : fred ... (1)
X joe :: more ... (2)
X
X and
X
X joe :: fred ... (3)
X joe :: more ... (4)
X
X are legal and mean: add the recipe associated with (2), or
X (4) to the set of recipes for joe, placing them after exist-
X ing recipes for making joe. The constructs:
X
X joe :: fred ... (5)
X joe : more ... (6)
X
X and
X
X joe : fred ... (7)
X joe : more ... (8)
X
X are errors since we have two sets of perfectly good recipes
X for making the target.
X
X _p_r_e_r_e_q_u_i_s_i_t_e_s is a possibly empty list of targets that must
X be brought up to date before making the current target.
X
X _r_e_c_i_p_e is a short form and allows the user to specify short
X rule definitions on a single line. It is taken to be the
X first recipe line in a larger recipe if additional lines
X follow the rule definition. If the semi-colon is present
X but the recipe line is empty (ie. null string) then it is
X taken to be an empty rule. Any target so defined causes the
X _D_o_n_'_t _k_n_o_w _h_o_w _t_o _m_a_k_e _._._. error message to be suppressed
X when ddmmaakkee tries to make the target and fails. This silence
X is maintained for rules that are terminated by a semicolon
X and have no following recipe lines, for targets listed on
X the command line, and for the first target found in the
X makefile.
X
XRREECCIIPPEESS
X The traditional format used by most versions of Make defines
X the recipe lines as arbitrary strings that may contain macro
X expansions. They follow a rule definition line and may be
X spaced apart by comment or blank lines. The list of recipe
X
X
X
XVersion 3.50 UW 17
X
X
X
X
XDMAKE(p) Unsupported Software DMAKE(p)
X
X
X
X lines defining the recipe is terminated by a new target
X definition, a macro definition, or end-of-file. Each recipe
X line MMUUSSTT begin with a <<TTAABB>> character which may optionally
X be followed with one or all of the characters _'_@_%_+_-_'. The
X _'_-_' indicates that non-zero exit values (ie. errors) are to
X be ignored when this recipe line is executed, the _'_+_' indi-
X cates that the current recipe line is to be executed using
X the shell, the _'_%_' indicates that ddmmaakkee should swap itself
X out to secondary storage (MSDOS only) before running the
X recipe and the _'_@_' indicates that the recipe line should NOT
X be echoed to the terminal prior to being executed. Each
X switch is off by default (ie. by default, errors are signi-
X ficant, commands are echoed, no swapping is done and a shell
X is used only if the recipe line contains a character found
X in the value of the SHELLMETAS macro). Global settings
X activated via command line options or special attribute or
X target names may also affect these settings. An example
X recipe:
X
X target :
X first recipe line
X second recipe line, executed independently of the first.
X @a recipe line that is not echoed
X -and one that has errors ignored
X %and one that causes dmake to swap out
X +and one that is executed using a shell.
X
X The second and new format of the recipe block begins the
X block with the character '[' (the open group character) in
X the last non-white space position of a line, and terminates
X the block with the character ']' (the close group character)
X in the first non-white space position of a line. In this
X form each recipe line need not have a leading TAB. This is
X called a recipe group. Groups so defined are fed intact as
X a single unit to a shell for execution whenever the
X corresponding target needs to be updated. If the open group
X character '[' is preceded by one or all of -, @ or % then
X they apply to the entire group in the same way that they
X apply to single recipe lines. You may also specify '+' but
X it is redundant as a shell is already being used to run the
X recipe. See the MAKING TARGETS section for a description of
X how ddmmaakkee invokes recipes. Here is an example of a group
X recipe:
X
X target :
X [
X first recipe line
X second recipe line
X all of these recipe lines are fed to a
X single copy of a shell for execution.
X ]
X
X
X
X
XVersion 3.50 UW 18
X
X
X
X
XDMAKE(p) Unsupported Software DMAKE(p)
X
X
X
XTTEEXXTT DDIIVVEERRSSIIOONNSS
X ddmmaakkee supports the notion of text diversions. If a recipe
X line contains the macro expression
X
X $(mktmp[,_n_a_m_e___m_o_d_i_f_i_e_r] _d_a_t_a)
X
X then all text contained in the _d_a_t_a expression is expanded
X and is written to a new temporary file. The name of that
X file is then returned as the value of the macro expansion
X and is substituted for the text of the macro expression if
X no _n_a_m_e___m_o_d_i_f_i_e_r is present.
X
X _d_a_t_a can be any text and must be separated from the 'mktmp'
X portion of the macro name by white-space. The only restric-
X tion on the data text is that it must contain an balanced
X number of parentheses of the same kind as are used to ini-
X tiate the $(mktmp ...) expression. For example:
X
X $(mktmp $(XXX))
X
X is legal and works as expected, but:
X
X $(mktmp text (to dump to file)
X
X is not legal. You can achieve what you wish by either
X defining a macro that expands to '(' or by using {} in the
X macro expression; like this:
X
X ${mktmp text (to dump to file}
X
X which works as expected. Since the temporary file is opened
X when the macro containg the text diversion expression is
X expanded, diversions may now be nested and any diversions
X that are created as part of ':=' macro expansions persist
X for the duration of the ddmmaakkee run. The diversion text may
X contain the same escape codes as those described in the MAC-
X ROS section. Thus if the _d_a_t_a text is to contain new lines
X they must be inserted using the \n escape sequence. For
X example the expression:
X
X all:
X cat $(mktmp this is a\n\
X test of the text diversion\n)
X
X is replaced by:
X
X cat /tmp/mk12294AA
X
X where the temporary file contains two lines both of which
X are terminated by a new-line. If the _d_a_t_a text spans multi-
X ple lines in the makefile then each line must be continued
X via the use of a \. A second more illustrative example
X
X
X
XVersion 3.50 UW 19
X
X
X
X
XDMAKE(p) Unsupported Software DMAKE(p)
X
X
X
X generates a response file to an MSDOS link command:
X
X OBJ = fred.obj mary.obj joe.obj
X all : $(OBJ)
X link @$(mktmp $(^:t"+\n")\n)
X
X The result of making `all' in the second example is the com-
X mand:
X
X link @/tmp/mk02394AA
X
X where the temporary file contains:
X
X fred.obj+
X mary.obj+
X joe.obj
X
X The last line of the file is terminated by a new-line which
X is inserted due to the \n found at the end of the _d_a_t_a
X string.
X
X If the optional _n_a_m_e___m_o_d_i_f_i_e_r is supplied in the diversion
X expression then the returned value of the expression is the
X expanded value of _n_a_m_e___m_o_d_i_f_i_e_r. Together with the special
X macros TMPFILE and USESHELL this can be used to alter the
X name of the temporary file returned as the result of the
X $(mktmp ...) expansion.
X
X Under MS-DOS text diversions may be a problem. Many DOS
X tools require that path names which contain directories use
X the \ character to delimit the directories. Some users how-
X ever wish to use the '/' to delimit pathnames on their sys-
X tem and use environments that allow them to do so. These
X environments usually accept the \ delimited path names as
X well. In order to allow the user the most flexibility ddmmaakkee
X defines three macros that can be used when text diversion
X file names are being placed into the recipe text to be exe-
X cuted. The macro TMPFILE contains the name of the most
X recently opened temporary file, and the macro, USESHELL, is
X set to "yes" if the current recipe is forced to use a shell
X via the .USESHELL or '+' directives, otherwise its value is
X "no". In the absence of a _n_a_m_e___m_o_d_i_f_i_e_r in the diversion
X expression the result of expanding the diversion expression
X is the value of TMPFILE. The ddmmaakkee startup files define the
X macro DIVFILE whose value is either the value of TMPFILE or
X the value of TMPFILE editted to replace any '/' characters
X to the appropriate value based on the current shell and
X whether it will be used to execute the recipe.
X
X Previous versions of ddmmaakkee defined text diversions using <+,
X +> strings, where <+ started a text diversion and +> ter-
X minated one. ddmmaakkee is backward compatible with this
X
X
X
XVersion 3.50 UW 20
X
X
X
X
XDMAKE(p) Unsupported Software DMAKE(p)
X
X
X
X construct if the <+ and +> appear literally on the same
X recipe line or in the same macro value string. In such
X instances the expression:
X
X <+data text+>
X
X is mapped to:
X
X $(mktmp data text)
X
X which is fully output compatible with the earlier construct.
X <+, +> constructs whose text spans multiple lines must be
X converted by hand to use $(mktmp ...).
X
X If the environment variable TMPDIR is defined then the tem-
X porary file is placed into the directory specified by that
X variable. A makefile can modify the location of temporary
X files by defining a macro named TMPDIR and exporting it
X using the .EXPORT special target.
X
XSSPPEECCIIAALL TTAARRGGEETTSS
X This section describes the special targets that are recog-
X nized by ddmmaakkee. Some are affected by attributes and others
X are not.
X
X ..EERRRROORR If defined then the recipe associated with
X this target is executed whenever an error con-
X dition is detected by ddmmaakkee. All attributes
X that can be used with any other target may be
X used with this target. Any prerequisites of
X this target will be brought up to date during
X it's processing. NOTE: errors will be
X ignored while making this target, in extreme
X cases this may cause some problems.
X
X ..EEXXPPOORRTT All prerequisites associated with this target
X are assumed to correspond to macro names and
X they and their values are exported to the
X environment as environment strings at the
X point in the makefile at which this target
X appears. Any attributes specified with this
X target are ignored. Only macros which have
X been assigned a value in the makefile prior to
X the export directive are exported, macros as
X yet undefined are not exported.
X
X ..IIMMPPOORRTT Prerequisite names specified for this target
X are searched for in the environment and
X defined as macros with their value taken from
X the environment. If the name cannot be found
X in the environment an error message is issued.
X .IMPORT accepts the .IGNORE attribute. When
X
X
X
XVersion 3.50 UW 21
X
X
X
X
XDMAKE(p) Unsupported Software DMAKE(p)
X
X
X
X given, it causes ddmmaakkee to ignore the above
X error. See the MACROS section for a descrip-
X tion of the processing of imported macro
X values.
X
X ..IINNCCLLUUDDEE Parse another makefile just as if it had been
X located at the point of the .INCLUDE in the
X current makefile. The list of prerequisites
X gives the list of makefiles to try to read.
X If the list contains multiple makefiles then
X they are read in order from left to right.
X The following search rules are used when try-
X ing to locate the file. If the filename is
X surrounded by " or just by itself then it is
X searched for in the current directory. If it
X is not found it is then searched for in each
X of the directories specified for the .INCLU-
X DEDIRS special target. If the file name is
X surrounded by < and >, (ie.
X <my_spiffy_new_makefile>) then it is searched
X for only in the directories given by the
X .INCLUDEDIRS special target. In both cases if
X the file name is a fully qualified name start-
X ing at the root of the file system then it is
X only searched for once, and the .INCLUDEDIRS
X list is ignored. .INCLUDE accepts the .IGNORE
X and .SETDIR attributes. If .IGNORE attribute
X is given and the file cannot be found then
X ddmmaakkee continues processing, otherwise an error
X message is generated. The .SETDIR attribute
X causes ddmmaakkee to change directories to the
X specified directory prior to attempting the
X include operation.
X
X ..IINNCCLLUUDDEEDDIIRRSS The list of prerequisites specified for this
X target defines the set of directories to
X search when trying to include a makefile.
X
X ..MMAAKKEEFFIILLEESS The list of prerequisites is the set of files
X to try to read as the default makefile. By
X default this target is defined as:
X
X .MAKEFILES : makefile.mk Makefile
X makefile
X
X
X ..SSOOUURRCCEE The prerequisite list of this target defines a
X set of directories to check when trying to
X locate a target file name. See the section on
X BINDING of targets for more information.
X
X
X
X
X
XVersion 3.50 UW 22
X
X
X
X
XDMAKE(p) Unsupported Software DMAKE(p)
X
X
X
X ..SSOOUURRCCEE..ssuuffff The same as .SOURCE, except that the
X .SOURCE.suff list is searched first when try-
X ing to locate a file matching the a target
X whose name ends in the suffix .suff.
X
X ..RREEMMOOVVEE The recipe of this target is used whenever
X ddmmaakkee needs to remove intermediate targets
X that were made but do not need to be kept
X around. Such targets result from the applica-
X tion of transitive closure on the dependency
X graph.
X
X In addition to the special targets above, several other
X forms of targets are recognized and are considered special,
X their exact form and use is defined in the sections that
X follow.
X
XSSPPEECCIIAALL MMAACCRROOSS
X ddmmaakkee defines a number of special macros. They are divided
X into three classes: control macros, run-time macros, and
X function macros. The control macros are used by ddmmaakkee to
X configure it's actions, and are the preferred method of
X doing so. In the case when a control macro has the same
X function as a special target or attribute they share the
X same name as the special target or attribute. The run-time
X macros are defined when ddmmaakkee makes targets and may be used
X by the user inside recipes. The function macros provide
X higher level functions dealing with macro expansion and
X diversion file processing.
X
XCCOONNTTRROOLL MMAACCRROOSS
X To use the control macros simply assign them a value just
X like any other macro. The control macros are divided into
X three groups: string valued macros, character valued macros,
X and boolean valued macros.
X
X The following are all of the string valued macros. This
X list is divided into two groups. The first group gives the
X string valued macros that are defined internally and cannot
X be directly set by the user.
X
X DDIIRRBBRRKKSSTTRR Contains the string of chars used to terminate
X the name of a directory in a pathname. Under
X UNIX it's value is "/", under MSDOS it's value
X is "/\:".
X
X IINNCCDDEEPPTTHH This macro's value is a string of digits
X representing the current depth of makefile
X inclusion. In the first makefile level this
X value is zero.
X
X
X
X
X
XVersion 3.50 UW 23
X
X
X
X
XDMAKE(p) Unsupported Software DMAKE(p)
X
X
X
X MMFFLLAAGGSS Is the list of flags that were given on the
X command line including a leading switch char-
X acter. The -f flag is not included in this
X list.
X
X MMAAKKEECCMMDD Is the name with which ddmmaakkee was invoked.
X
X MMAAKKEEDDIIRR Is the full path to the initial directory in
X which ddmmaakkee was invoked.
X
X MMAAKKEEFFIILLEE Contains the string "-f _m_a_k_e_f_i_l_e" where,
X _m_a_k_e_f_i_l_e is the name of initial user makefile
X that was first read.
X
X MMAAKKEEFFLLAAGGSS Is the same as $(MFLAGS) but has no leading
X switch character. (ie. MFLAGS = -$(MAKEFLAGS))
X
X MMAAKKEEMMAACCRROOSS Contains the complete list of macro expres-
X sions that were specified on the command line.
X
X MMAAKKEETTAARRGGEETTSS Contains the name(s) of the target(s), if any,
X that were specified on the command line.
X
X MMAAXXPPRROOCCEESSSSLLIIMMIITT
X Is a numeric string representing the maximum
X number of processes that ddmmaakkee can use when
X making targets using parallel mode.
X
X NNUULLLL Is permanently defined to be the NULL string.
X This is useful when comparing a conditional
X expression to an NULL value.
X
X PPWWDD Is the full path to the current directory in
X which make is executing.
X
X TTMMPPFFIILLEE Is set to the name of the most recent tem-
X porary file opened by ddmmaakkee. Temporary files
X are used for text diversions and for group
X recipe processing.
X
X TTMMDD Stands for "To Make Dir", and is the path from
X the present directory (value of $(PWD)) to the
X directory that ddmmaakkee was started up in (value
X of $(MAKEDIR)). This macro is modified when
X .SETDIR attributes are processed.
X
X UUSSEESSHHEELLLL The value of this macro is set to "yes" if the
X current recipe is forced to use a shell for
X its execution via the .USESHELL or '+' direc-
X tives, its value is "no" otherwise.
X
X
X
X
X
XVersion 3.50 UW 24
X
X
X
X
XDMAKE(p) Unsupported Software DMAKE(p)
X
X
X
X The second group of string valued macros control ddmmaakkee
X behavior and may be set by the user.
X
X ..SSEETTDDIIRR If this macro is assigned a value then ddmmaakkee
X will change to the directory given by that
X value before making any targets. This macro
X is equivalent to the .SETDIR attribute.
X Thus the two lines:
X
X .SETDIR=fred/hello :
X
X .SETDIR := fred/hello
X
X are completely equivalent. The difference
X being that the first is processed as a rule
X definition and the other as a macro.
X
X AAUUGGMMAAKKEE If set to a non NULL value will enable the
X transformation of special meta targets to
X support special AUGMAKE inferences.
X
X DDIIRRSSEEPPSSTTRR Contains the string that is used to separate
X directory components when path names are
X constructed. It is defined with a default
X value at startup.
X
X DDIIVVFFIILLEE Is defined in the startup file and gives the
X name that should be used for the diversion
X file name when specified as the name modif-
X ier in $(mktmp ...) expansions, see the TEXT
X DIVERSION section for details.
X
X GGRROOUUPPFFLLAAGGSS This macro gives the set of flags to pass to
X the shell when invoking it to execute a
X group recipe. The value of the macro is the
X list of flags with a leading switch indica-
X tor. (ie. `-' under UNIX)
X
X GGRROOUUPPSSHHEELLLL This macro defines the full path to the exe-
X cutable image to be used as the shell when
X processing group recipes. This macro must
X be defined if group recipes are used. It is
X assigned a default value in the startup
X makefile. Under UNIX this value is /bin/sh.
X
X GGRROOUUPPSSUUFFFFIIXX If defined, this macro gives the string to
X use as a suffix when creating group recipe
X files to be handed to the command inter-
X preter. For example, if it is defined as
X .sh, then all temporary files created by
X ddmmaakkee will end in the suffix .sh. Under
X MSDOS if you are using command.com as your
X
X
X
XVersion 3.50 UW 25
X
X
X
X
XDMAKE(p) Unsupported Software DMAKE(p)
X
X
X
X GROUPSHELL, then this suffix must be set to
X .bat in order for group recipes to function
X correctly.
X
X MMAAKKEE Is defined in the startup file by default.
X The string $(MAKE) is recognized when using
X the -n option for single line recipes. Ini-
X tially this macro is defined to have the
X value "$(MAKECMD) $(MFLAGS)".
X
X MMAAKKEESSTTAARRTTUUPP This macro defines the full path to the ini-
X tial startup makefile. Use the --VV command
X line option to discover it's initial value.
X
X MMAAXXLLIINNEELLEENNGGTTHH This macro defines the maximum size of a
X single line of makefile input text. The
X size is specified as a number, the default
X value is defined internally and is shown via
X the --VV option. A buffer of this size plus 2
X is allocated for reading makefile text. The
X buffer is freed before any targets are made,
X thereby allowing files containing long input
X lines to be processed without consuming
X memory during the actual make.
X
X MMAAXXPPRROOCCEESSSS Specify the maximum number of child
X processes to use when making targets. The
X default value of this macro is "1" and it's
X value cannot exceed the value of the macro
X MAXPROCESSLIMIT. Setting the value of MAX-
X PROCESS on the command line or in the
X makefile is equivalent to supplying a
X corresponding value to the -P flag on the
X command line.
X
X PPRREEPP This macro defines the number of iterations
X to be expanded automatically when processing
X % rule definitions of the form:
X
X % : %.suff
X
X See the sections on PERCENT(%) RULES for
X details on how PREP is used.
X
X SSHHEELLLL This macro defines the full path to the exe-
X cutable image to be used as the shell when
X processing single line recipes. This macro
X must be defined if recipes requiring the
X shell for execution are to be used. It is
X assigned a default value in the startup
X makefile. Under UNIX this value is /bin/sh.
X
X
X
X
XVersion 3.50 UW 26
X
X
X
X
XDMAKE(p) Unsupported Software DMAKE(p)
X
X
X
X SSHHEELLLLFFLLAAGGSS This macro gives the set of flags to pass to
X the shell when invoking it to execute a sin-
X gle line recipe. The value of the macro is
X the list of flags with a leading switch
X indicator. (ie. `-' under UNIX)
X
X SSHHEELLLLMMEETTAASS Each time ddmmaakkee executes a single recipe
X line (not a group recipe) the line is
X searched for any occurrence of a character
X defined in the value of SHELLMETAS. If such
X a character is found the recipe line is
X defined to require a shell to ensure it's
X correct execution. In such instances a
X shell is used to invoke the recipe line. If
X no match is found the recipe line is exe-
X cuted without the use of a shell.
X
X
X There is only one character valued macro defined by ddmmaakkee:
X SSWWIITTCCHHAARR contains the switch character used to introduce
X options on command lines. On UNIX it's value is '-', on
X MSDOS it's value may be '/' or '-'. The macro is internally
X defined and is not user setable. The MSDOS version of ddmmaakkee
X attempts to first extract SWITCHAR from an environment vari-
X able of the same name. If that fails it then attempts to
X use the undocumented getswitchar interrupt call, and returns
X the result of that. Thus under MSDOS version 4.0 you must
X set the value of the environment macro SWITCHAR to '/' to
X obtain predictable behaviour.
X
X All boolean macros currently understood by ddmmaakkee correspond
X directly to the previously defined attributes. These macros
X provide a second way to apply global attributes, and
X represent the preferred method of doing so. They are used
X by assigning them a value. If the value is not a NULL
X string then the boolean condition is set to on. If the
X value is a NULL string then the condition is set to off.
X There are five conditions defined and they correspond
X directly to the attributes of the same name. Their meanings
X are defined in the ATTRIBUTES section above. The macros
X are: ..EEPPIILLOOGG, ..IIGGNNOORREE, ..MMKKSSAARRGGSS, ..PPRREECCIIOOUUSS, ..PPRROOLLOOGG,
X ..SSEEQQUUEENNTTIIAALL, ..SSIILLEENNTT, ..SSWWAAPP, and ..UUSSEESSHHEELLLL. Assigning any
X of these a non NULL value will globally set the correspond-
X ing attribute to on.
X
XRRUUNN__TTIIMMEE MMAACCRROOSS
X These macros are defined when ddmmaakkee is making targets, and
X may take on different values for each target. $$@@ is defined
X to be the full target name, $$?? is the list of all out of
X date prerequisites, $$&& is the list of all prerequisites, $$>>
X is the name of the library if the current target is a
X library member, and $$<< is the list of prerequisites
X
X
X
XVersion 3.50 UW 27
X
X
X
X
XDMAKE(p) Unsupported Software DMAKE(p)
X
X
X
X specified in the current rule. If the current target had a
X recipe inferred then $$<< is the name of the inferred prere-
X quisite even if the target had a list of prerequisites sup-
X plied using an explicit rule that did not provide a recipe.
X In such situations $$&& gives the full list of prerequisites.
X
X $$** is defined as $$((@@::ddbb)) when making targets with explicit
X recipes and is defined as the value of % when making targets
X whose recipe is the result of an inference. In the first
X case $$** is the target name with no suffix, and in the second
X case, is the value of the matched % pattern from the associ-
X ated %-rule. $$^^ expands to the set of out of date prere-
X quisites taken from the current value of $$<<. In addition to
X these, $$$$ expands to $, {{{{ expands to {, }}}} expands to },
X and the strings <<++ and ++>> are recognized as respectively
X starting and terminating a text diversion when they appear
X literally together in the same input line.
X
X The difference between $? and $^ can best be illustrated by
X an example, consider:
X
X fred.out : joe amy hello
X rules for making fred
X
X fred.out : my.c your.h his.h her.h # more prerequisites
X
X Assume joe, amy, and my.c are newer then fred.out. When
X ddmmaakkee executes the recipe for making fred.out the values of
X the following macros will be:
X
X $@ --> fred.out
X $* --> fred
X $? --> joe amy my.c # note the difference between $? and $^
X $^ --> joe amy
X $< --> joe amy hello
X $& --> joe amy hello my.c your.h his.h her.h
X
X
XFFUUNNCCTTIIOONN MMAACCRROOSS
X Only one function macro is defined at this time. The
X $(mktmp ...) construct can be used to create a temporary
X file containing data and returns the name of that file as
X it's result. See the TEXT DIVERSION section for details on
X its use. Temporary files created using this macro persist
X for the duration of the ddmmaakkee run if processed as part of a
X macro assignment operation, or until an associated target's
X recipe is fully completed at which time the temporary file
X is removed. NOTE: Specifying '-v' on the command line
X causes all temporary files to be retained when ddmmaakkee exits.
X
X
X
X
X
X
XVersion 3.50 UW 28
X
X
X
X
XDMAKE(p) Unsupported Software DMAKE(p)
X
X
X
XDDYYNNAAMMIICC PPRREERREEQQUUIISSIITTEESS
X ddmmaakkee looks for prerequisites whose names contain macro
X expansions during target processing. Any such prerequisites
X are expanded and the result of the expansion is used as the
X prerequisite name. As an example the line:
X
X fred : $$@.c
X
X causes the $$@ to be expanded when ddmmaakkee is making fred, and
X it resolves to the target _f_r_e_d. This enables dynamic prere-
X quisites to be generated. The value of @ may be modified by
X any of the valid macro modifiers. So you can say for exam-
X ple:
X
X fred.out : $$(@:b).c
X
X where the $$(@:b) expands to _f_r_e_d. Note the use of $$
X instead of $ to indicate the dynamic expansion, this is due
X to the fact that the rule line is expanded when it is ini-
X tially parsed, and $$ then returns $ which later triggers
X the dynamic prerequisite expansion. If you really want a $
X to be part of a prerequisite name you must use $$$$.
X Dynamic macro expansion is performed in all user defined
X rules, and the special targets .SOURCE*, and .INCLUDEDIRS.
X
XBBIINNDDIINNGG TTAARRGGEETTSS
X This operation takes a target name and binds it to an exist-
X ing file, if possible. ddmmaakkee makes a distinction between
X the internal target name of a target and it's associated
X external file name. Thus it is possible for a target's
X internal name and its external file name to differ. To per-
X form the binding, the following set of rules is used.
X Assume that we are trying to bind a target whose name is of
X the form _X_._s_u_f_f, where _._s_u_f_f is the suffix and _X is the stem
X portion (ie. that part which contains the directory and the
X basename). ddmmaakkee takes this target name and performs a
X series of search operations that try to find a suitably
X named file in the external file system. The search opera-
X tion is user controlled via the settings of the various
X .SOURCE targets.
X
X 1. If target has the .SYMBOL attribute set then look
X for it in the library. If found, replace the tar-
X get name with the library member name and continue
X with step 2. If the name is not found then
X return.
X
X 2. Extract the suffix portion (that following the
X `.') of the target name. If the suffix is not
X null, look up the special target .SOURCE.<suff>
X (<suff> is the suffix). If the special target
X exists then search each directory given in the
X
X
X
XVersion 3.50 UW 29
X
X
X
X
XDMAKE(p) Unsupported Software DMAKE(p)
X
X
X
X .SOURCE.<suff> prerequisite list for the target.
X If the target's suffix was null (ie. _._s_u_f_f was
X empty) then perform the above search but use the
X special target .SOURCE.NULL instead. If at any
X point a match is found then terminate the search.
X If a directory in the prerequisite list is the
X special name `.NULL ' perform a search for the
X full target name without prepending any directory
X portion (ie. prepend the NULL directory). (a
X default target of '.SOURCE : .NULL' is defined by
X ddmmaakkee at startup, and is user redefinable)
X
X 3. The search in step 2. failed. Repeat the same
X search but this time use the special target
X .SOURCE.
X
X 4. The search in step 3. failed. If the target has
X the library member attribute (.LIBMEMBER) set then
X try to find the target in the library which was
X passed along with the .LIBMEMBER attribute (see
X the MAKING LIBRARIES section). The bound file
X name assigned to a target which is successfully
X located in a library is the same name that would
X be assigned had the search failed (see 5.).
X
X 5. The search failed. Either the target was not
X found in any of the search directories or no
X applicable .SOURCE special targets exist. If
X applicable .SOURCE special targets exist, but the
X target was not found, then ddmmaakkee assigns the first
X name searched as the bound file name. If no
X applicable .SOURCE special targets exist, then the
X full original target name becomes the bound file
X name.
X
X There is potential here for a lot of search operations. The
X trick is to define .SOURCE.x special targets with short
X search lists and leave .SOURCE as short as possible. The
X search algorithm has the following useful side effect. When
SHAR_EOF
echo "End of part 14"
echo "File man/dmake.p is continued in part 15"
echo "15" > s2_seq_.tmp
exit 0