home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-05-11 | 40.2 KB | 1,117 lines |
- Newsgroups: comp.sources.misc
- From: Dennis Vadura <dvadura@watdragon.waterloo.edu>
- Subject: v19i036: dmake - dmake version 3.7, Part15/37
- Message-ID: <1991May12.001827.9186@sparky.IMD.Sterling.COM>
- X-Md4-Signature: 3e9c22ff0ed047ff36ef5affe85d8ee4
- Date: Sun, 12 May 1991 00:18:27 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: Dennis Vadura <dvadura@watdragon.waterloo.edu>
- Posting-number: Volume 19, Issue 36
- Archive-name: dmake/part15
- Supersedes: dmake-3.6: Volume 15, Issue 52-77
-
- ---- Cut Here and feed the following to sh ----
- #!/bin/sh
- # this is dmake.shar.15 (part 15 of a multipart archive)
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file dmake/man/dmake.nc continued
- #
- if test ! -r _shar_seq_.tmp; then
- echo 'Please unpack part 1 first!'
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 15; then
- echo Please unpack part "$Scheck" next!
- exit 1
- else
- exit 0
- fi
- ) < _shar_seq_.tmp || exit 1
- if test -f _shar_wnt_.tmp; then
- sed 's/^X//' << 'SHAR_EOF' >> 'dmake/man/dmake.nc' &&
- X
- X
- X
- Version 3.70 UW 42
- X
- X
- X
- X
- DMAKE(p) Unsupported Free Software DMAKE(p)
- X
- X
- X
- X .NOSTATE attribute will have a record written into the state
- X file indicating the target's name, the current directory,
- X the command used to update the target, and which, if any, ::
- X rule is being used. When you make this target again if any
- X of this information does not match the previous settings and
- X the target is not out dated it will still be re-made. The
- X assumption is that one of the conditions above has changed
- X and that we wish to remake the target. For example, state
- X keeping is used in the maintenance of dmake to test compile
- X different versions of the source using different compilers.
- X Changing the compiler causes the compilation flags to be
- X modified and hence all sources to be recompiled.
- X
- X The state file is an ascii file and is portable, however it
- X is not in human readable form as the entries represent hash
- X keys of the above information.
- X
- X The Sun Microsystem's Make construct
- X
- X .KEEP_STATE :
- X
- X is recognized and is mapped to .KEEP_STATE:=_state.mk. The
- X dmake version of state keeping does not include scanning C
- X source files for dependencies like Sun Make. This is
- X specific to C programs and it was felt that it does not
- X belong in make. dmake instead provides the tool, cdepend,
- X to scan C source files and to produce depedency information.
- X Users are free to modify cdepend to produce other dependency
- X files. (NOTE: cdepend does not come with the distribution
- X at this time, but will be available in a patch in the near
- X future)
- X
- MULTI PROCESSING
- X If the architecture supports it then dmake is capable of
- X making a target's prerequisites in parallel. dmake will
- X make as much in parallel as it can and use a number of child
- X processes up to the maximum specified by MAXPROCESS or by
- X the value supplied to the -P command line flag. A parallel
- X make is enabled by setting the value of MAXPROCESS (either
- X directly or via -P option) to a value which is > 1. dmake
- X guarantees that all dependencies as specified in the
- X makefile are honored. A target will not be made until all
- X of its prerequisites have been made. If a parallel make is
- X being performed then the following restrictions on parallel-
- X ism are enforced.
- X
- X 1. Individual recipe lines in a non-group recipe are
- X performed sequentially in the order in which they
- X are specified within the makefile and in parallel
- X with the recipes of other targets.
- X
- X
- X
- X
- X
- Version 3.70 UW 43
- X
- X
- X
- X
- DMAKE(p) Unsupported Free Software DMAKE(p)
- X
- X
- X
- X 2. If a target contains multiple recipe definitions
- X (cf. :: rules) then these are performed sequen-
- X tially in the order in which the :: rules are
- X specified within the makefile and in parallel with
- X the recipes of other targets.
- X
- X 3. If a target rule contains the `!' modifier, then
- X the recipe is performed sequentially for the list
- X of outdated prerequisites and in parallel with the
- X recipes of other targets.
- X
- X 4. If a target has the .SEQUENTIAL attribute set then
- X all of its prerequisites are made sequentially
- X relative to one another (as if MAXPROCESS=1), but
- X in parallel with other targets in the makefile.
- X
- X Note: If you specify a parallel make then the order of tar-
- X get update and the order in which the associated recipes are
- X invoked will not correspond to that displayed by the -n
- X flag.
- X
- CONDITIONALS
- X dmake supports a makefile construct called a conditional.
- X It allows the user to conditionally select portions of
- X makefile text for input processing and to discard other por-
- X tions. This becomes useful for writing makefiles that are
- X intended to function for more than one target host and
- X environment. The conditional expression is specified as
- X follows:
- X
- X .IF expression
- X ... if text ...
- X .ELIF expression
- X ... if text ...
- X .ELSE
- X ... else text ...
- X .END
- X
- X The .ELSE and .ELIF portions are optional, and the condi-
- X tionals may be nested (ie. the text may contain another
- X conditional). .IF, .ELSE, and .END may appear anywhere in
- X the makefile, but a single conditional expression may not
- X span multiple makefiles.
- X
- X expression can be one of the following three forms:
- X
- X <text> | <text> == <text> | <text> != <text>
- X
- X where text is either text or a macro expression. In any
- X case, before the comparison is made, the expression is
- X expanded. The text portions are then selected and compared.
- X White space at the start and end of the text portion is
- X
- X
- X
- Version 3.70 UW 44
- X
- X
- X
- X
- DMAKE(p) Unsupported Free Software DMAKE(p)
- X
- X
- X
- X discarded before the comparison. This means that a macro
- X that evaluates to nothing but white space is considered a
- X NULL value for the purpose of the comparison. In the first
- X case the expression evaluates TRUE if the text is not NULL
- X otherwise it evaluates FALSE. The remaining two cases both
- X evaluate the expression on the basis of a string comparison.
- X If a macro expression needs to be equated to a NULL string
- X then compare it to the value of the macro $(NULL). You can
- X use the $(shell ...) macro to construct more complex test
- X expressions.
- X
- EXAMPLES
- X # A simple example showing how to use make
- X #
- X prgm : a.o b.o
- X cc a.o b.o -o prgm
- X a.o : a.c g.h
- X cc a.c -o $@
- X b.o : b.c g.h
- X cc b.c -o $@
- X
- X In the previous example prgm is remade only if a.o and/or
- X b.o is out of date with respect to prgm. These dependencies
- X can be stated more concisely by using the inference rules
- X defined in the standard startup file. The default rule for
- X making .o's from .c's looks something like this:
- X
- X %.o : %.c; cc -c $(CFLAGS) -o $@ $<
- X
- X Since there exists a rule (defined in the startup file) for
- X making .o's from .c's dmake will use that rule for manufac-
- X turing a .o from a .c and we can specify our dependencies
- X more concisely.
- X
- X prgm : a.o b.o
- X cc -o prgm $<
- X a.o b.o : g.h
- X
- X A more general way to say the above using the new macro
- X expansions would be:
- X
- X SRC = a b
- X OBJ = {$(SRC)}.o
- X
- X prgm : $(OBJ)
- X cc -o $@ $<
- X
- X $(OBJ) : g.h
- X
- X If we want to keep the objects in a separate directory,
- X called objdir, then we would write something like this.
- X
- X
- X
- X
- Version 3.70 UW 45
- X
- X
- X
- X
- DMAKE(p) Unsupported Free Software DMAKE(p)
- X
- X
- X
- X SRC = a b
- X OBJ = {$(SRC)}.o
- X
- X prgm : $(OBJ)
- X cc $< -o $@
- X
- X $(OBJ) : g.h
- X %.o : %.c
- X $(CC) -c $(CFLAGS) -o $(@:f) $<
- X mv $(@:f) objdir
- X
- X .SOURCE.o : objdir # tell make to look here for .o's
- X
- X An example of building library members would go something
- X like this: (NOTE: The same rules as above will be used to
- X produce .o's from .c's)
- X
- X SRC = a b
- X LIB = lib
- X LIBm = { $(SRC) }.o
- X
- X prgm: $(LIB)
- X cc -o $@ $(LIB)
- X
- X $(LIB) .LIBRARY : $(LIBm)
- X ar rv $@ $<
- X rm $<
- X
- X Finally, suppose that each of the source files in the previ-
- X ous example had the `:' character in their target name.
- X Then we would write the above example as:
- X
- X SRC = f:a f:b
- X LIB = lib
- X LIBm = "{ $(SRC) }.o" # put quotes around each token
- X
- X prgm: $(LIB)
- X cc -o $@ $(LIB)
- X
- X $(LIB) .LIBRARY : $(LIBm)
- X ar rv $@ $<
- X rm $<
- X
- COMPATIBILITY
- X There are two notable differences between dmake and the
- X standard version of BSD UNIX 4.2/4.3 Make.
- X
- X 1. BSD UNIX 4.2/4.3 Make supports wild card filename
- X expansion for prerequisite names. Thus if a direc-
- X tory contains a.h, b.h and c.h, then a line like
- X
- X target: *.h
- X
- X
- X
- Version 3.70 UW 46
- X
- X
- X
- X
- DMAKE(p) Unsupported Free Software DMAKE(p)
- X
- X
- X
- X will cause UNIX make to expand the *.h into "a.h b.h
- X c.h". dmake does not support this type of filename
- X expansion.
- X
- X 2. Unlike UNIX make, touching a library member causes
- X dmake to search the library for the member name and
- X to update the library time stamp. This is only
- X implemented in the UNIX version. MSDOS and other
- X versions may not have librarians that keep file time
- X stamps, as a result dmake touches the library file
- X itself, and prints a warning.
- X
- X dmake is not compatible with GNU Make. In particular it
- X does not understand GNU Make's macro expansions that query
- X the file system.
- X
- X dmake is fully compatible with SYSV AUGMAKE, and supports
- X the following AUGMAKE features:
- X
- X 1. The word include appearing at the start of a line
- X can be used instead of the ".INCLUDE :" construct
- X understood by dmake.
- X
- X 2. The macro modifier expression $(macro:str=sub) is
- X understood and is equivalent to the expression
- X $(macro:s/str/sub), with the restriction that str
- X must match the following regular expression:
- X
- X str[ |\t][ |\t]*
- X
- X (ie. str only matches at the end of a token where
- X str is a suffix and is terminated by a space, a tab,
- X or end of line)
- X
- X 3. The macro % is defined to be $@ (ie. $% expands to
- X the same value as $@).
- X
- X 4. The AUGMAKE notion of libraries is handled
- X correctly.
- X
- X 5. When defining special targets for the inference
- X rules and the AUGMAKE special target handling is
- X enabled then the special target .X is equivalent to
- X the %-rule "% : %.X".
- X
- X 6. Directories are always made if you specify -A. This
- X is consistent with other UNIX versions of Make.
- X
- X 7. Makefiles that utilize virtual targets to force mak-
- X ing of other targets work as expected if AUGMAKE
- X special target handling is enabled. For example:
- X
- X
- X
- X
- Version 3.70 UW 47
- X
- X
- X
- X
- DMAKE(p) Unsupported Free Software DMAKE(p)
- X
- X
- X
- X FRC:
- X myprog.o : myprog.c $(FRC) ; ...
- X
- X Works as expected if you issue the command
- X
- X 'dmake -A FRC=FRC'
- X
- X but fails with a 'don't know how to make FRC' error
- X message if you do not specify AUGMAKE special target
- X handling via the -A flag (or by setting AUGMAKE:=yes
- X internally).
- X
- LIMITS
- X In some environments the length of an argument string is
- X restricted. (e.g. MSDOS command line arguments cannot be
- X longer than 128 bytes if you are using the standard
- X command.com command interpreter as your shell, dmake text
- X diversions may help in these situations.)
- X
- PORTABILITY
- X To write makefiles that can be moved from one environment to
- X another requires some forethought. In particular you must
- X define as macros all those things that may be different in
- X the new environment. dmake has two facilities that help to
- X support writing portable makefiles, recursive macros and
- X conditional expressions. The recursive macros, allow one to
- X define environment configurations that allow different
- X environments for similar types of operating systems. For
- X example the same make script can be used for SYSV and BSD
- X but with different macro definitions.
- X
- X To write a makefile that is portable between UNIX and MSDOS
- X requires both features since in almost all cases you will
- X need to define new recipes for making targets. The recipes
- X will probably be quite different since the capabilities of
- X the tools on each machine are different. Different macros
- X will be needed to help handle the smaller differences in the
- X two environments.
- X
- X NOTE: Unlike UNIX, MSDOS does maintain cd requests cross
- X single recipe lines. This is not portable, and your
- X makefiles will not work the same way if you depend on it.
- X Use the .IF ... .ELSE ... .END conditionals to supply dif-
- X ferent make scripts as necessary.
- X
- FILES
- X Makefile, makefile, startup.mk (use dmake -V to tell you
- X where the startup file is)
- X
- SEE ALSO
- X sh(1), csh(1), touch(1), f77(1), pc(1), cc(1)
- X S.I. Feldman Make - A Program for Maintaining Computer
- X
- X
- X
- Version 3.70 UW 48
- X
- X
- X
- X
- DMAKE(p) Unsupported Free Software DMAKE(p)
- X
- X
- X
- X Programs
- X
- AUTHOR
- X Dennis Vadura, CS Dept. University of Waterloo.
- X dvadura@watdragon.uwaterloo.ca
- X Many thanks to Carl Seger for his helpful suggestions, and
- X to Trevor John Thompson for his many excellent ideas and
- X informative bug reports.
- X
- BUGS
- X Some system commands return non-zero status inappropriately.
- X Use -i (`-' within the makefile) to overcome the difficulty.
- X
- X Some systems do not have easily accessible time stamps for
- X library members (MSDOS, AMIGA, etc) for these dmake uses the
- X time stamp of the library instead and prints a warning the
- X first time it does so. This is almost always ok, except
- X when multiple makefiles update a single library file. In
- X these instances it is possible to miss an update if one is
- X not careful.
- X
- X This man page is way too long.
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- X
- Version 3.70 UW 49
- SHAR_EOF
- chmod 0640 dmake/man/dmake.nc ||
- echo 'restore of dmake/man/dmake.nc failed'
- Wc_c="`wc -c < 'dmake/man/dmake.nc'`"
- test 117216 -eq "$Wc_c" ||
- echo 'dmake/man/dmake.nc: original size 117216, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= dmake/man/dmake.p ==============
- if test -f 'dmake/man/dmake.p' -a X"$1" != X"-c"; then
- echo 'x - skipping dmake/man/dmake.p (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- sed 's/^X//' << 'SHAR_EOF' > 'dmake/man/dmake.p' &&
- X
- X
- X
- X
- DMAKE(p) Unsupported Free Software DMAKE(p)
- X
- X
- X
- NNAAMMEE
- X ddmmaakkee - maintain program groups, or interdependent files
- X
- SSYYNNOOPPSSIISS
- X ddmmaakkee [-AceEhiknpqrsStTuVx] [-v{dfimt}] [-P#] [-{f|C|K}
- X file] [macro[*][+][:]=_v_a_l_u_e ...] [target ...]
- X
- DDEESSCCRRIIPPTTIIOONN
- X ddmmaakkee executes commands found in an external file called a
- X _m_a_k_e_f_i_l_e to update one or more target names. Each target
- X may depend on zero or more prerequisite targets. If any of
- X the target's prerequisites is newer than the target or if
- X the target itself does not exist, then ddmmaakkee will attempt to
- X make the target.
- X
- X If no --ff command line option is present then ddmmaakkee searches
- X for an existing _m_a_k_e_f_i_l_e from the list of prerequisites
- X specified for the special target _._M_A_K_E_F_I_L_E_S (see the STARTUP
- X section for more details). If "-" is the name of the file
- X specified to the --ff flag then ddmmaakkee uses standard input as
- X the source of the makefile text.
- X
- X Any macro definitions (arguments with embedded "=" signs)
- X that appear on the command line are processed first and
- X supersede definitions for macros of the same name found
- X within the makefile. In general it is impossible for defin-
- X itions found inside the makefile to redefine a macro defined
- X on the command line, see the MACROS section for an excep-
- X tion.
- X
- X If no _t_a_r_g_e_t names are specified on the command line, then
- X ddmmaakkee uses the first non-special target found in the
- X makefile as the default target. See the SSPPEECCIIAALL TTAARRGGEETTSS
- X section for the list of special targets and their function.
- X ddmmaakkee is a re-implementation of the UNIX Make utility with
- X significant enhancements. Makefiles written for most previ-
- X ous versions of _M_a_k_e will be handled correctly by ddmmaakkee..
- X Known differences between ddmmaakkee and other versions of make
- X are discussed in the CCOOMMPPAATTIIBBIILLIITTYY section found at the end
- X of this document.
- X
- OOPPTTIIOONNSS
- X --AA Enable AUGMAKE special inference rule transformations
- X (see the "PERCENT(%) RULES" section), these are set to
- X off by default.
- X
- X --cc Use non-standard comment stripping. If you specify --cc
- X then ddmmaakkee will treat any ## character as a start of
- X comment character wherever it may appear unless it is
- X escaped by a \.
- X
- X
- X
- X
- X
- Version 3.70 UW 1
- X
- X
- X
- X
- DMAKE(p) Unsupported Free Software DMAKE(p)
- X
- X
- X
- X --CC [[++]]ffiillee
- X This option writes to _f_i_l_e a copy of standard output
- X and standard error from any child processes and from
- X the ddmmaakkee process itself. If you specify a ++ prior to
- X the file name then the text is appended to the previous
- X contents of _f_i_l_e. This option is active in the MSDOS
- X implementation only and is ignored by non-MSDOS ver-
- X sions of ddmmaakkee..
- X
- X --ee Read the environment and define all strings of the form
- X 'EENNVV--VVAARR=_e_v_a_l_u_e' defined within as macros whose name is
- X EENNVV--VVAARR, and whose value is '_e_v_a_l_u_e'. The environment
- X is processed prior to processing the user specified
- X makefile thereby allowing definitions in the makefile
- X to override definitions in the environment.
- X
- X --EE Same as -e, except that the environment is processed
- X after the user specified makefile has been processed
- X (thus definitions in the environment override defini-
- X tions in the makefile). The -e and -E options are
- X mutually exclusive. If both are given the latter takes
- X effect.
- X
- X --ff ffiillee
- X Use ffiillee as the source for the makefile text. Only one
- X --ff option is allowed.
- X
- X --hh Print the command summary for ddmmaakkee.
- X
- X --ii Tells ddmmaakkee to ignore errors, and continue making other
- X targets. This is equivalent to the .IGNORE attribute
- X or macro.
- X
- X --KK ffiillee
- X Turns on ..KKEEEEPP__SSTTAATTEE state tracking and tells ddmmaakkee to
- X use _f_i_l_e as the state file.
- X
- X --kk Causes ddmmaakkee to ignore errors caused by command execu-
- X tion and to make all targets not depending on targets
- X that could not be made. Ordinarily ddmmaakkee stops after a
- X command returns a non-zero status, specifying --kk causes
- X ddmmaakkee to ignore the error and continue to make as much
- X as possible.
- X
- X --nn Causes ddmmaakkee to print out what it would have executed,
- X but does not actually execute the commands. A special
- X check is made for the string "$(MAKE)" inside a recipe
- X line, if found, the line is expanded and invoked,
- X thereby enabling recursive makes to give a full
- X description of all that they will do. The check for
- X "$(MAKE)" is disabled inside group recipes.
- X
- X
- X
- X
- Version 3.70 UW 2
- X
- X
- X
- X
- DMAKE(p) Unsupported Free Software DMAKE(p)
- X
- X
- X
- X --pp Print out a version of the digested makefile in human
- X readable form. (useful for debugging, but cannot be
- X re-read by ddmmaakkee)
- X
- X --PP## On systems that support multi-processing cause ddmmaakkee to
- X use _# concurrent child processes to make targets. See
- X the "MULTI PROCESSING" section for more information.
- X
- X --qq Check and see if the target is up to date. Exits with
- X code 0 if up to date, 1 otherwise.
- X
- X --rr Tells ddmmaakkee not to read the initial startup makefile,
- X see STARTUP section for more details.
- X
- X --ss Tells ddmmaakkee to do all its work silently and not echo
- X the commands it is executing to stdout (also suppresses
- X warnings). This is equivalent to the .SILENT attri-
- X bute or macro.
- X
- X --SS Force sequential execution of recipes on architectures
- X which support concurrent makes. For backward compati-
- X bility with old makefiles that have nasty side-effect
- X prerequisite dependencies.
- X
- X --tt Causes ddmmaakkee to touch the targets and bring them up to
- X date without executing any commands.
- X
- X --TT Tells ddmmaakkee to not perform transitive closure on the
- X inference graph.
- X
- X --uu Force an unconditional update. (ie. do everything that
- X would be done if everything that a target depended on
- X was out of date)
- X
- X --vv[[ddffiimmtt]]
- X Verbose flag, when making targets print to stdout what
- X we are going to make and what we think its time stamp
- X is. The optional flags [[ddffiimmtt]] can be used to restrict
- X the information that is displayed. In the absence of
- X any optional flags all are assumed to be given (ie. --vv
- X is equivalent to --vvddffiimmtt). The meanings of the
- X optional flags are:
- X
- X dd Notify of change directory operations only.
- X
- X ff Notify of file I/O operations only.
- X
- X ii Notify of inference algorithm operation only.
- X
- X mm Notify of target update operations only.
- X
- X
- X
- X
- X
- Version 3.70 UW 3
- X
- X
- X
- X
- DMAKE(p) Unsupported Free Software DMAKE(p)
- X
- X
- X
- X tt Keep any temporary files created; normally they
- X are automatically deleted.
- X
- X --VV Print the version of ddmmaakkee, and values of builtin mac-
- X ros.
- X
- X --xx Upon processing the user makefile export all non-
- X internally defined macros to the user's environment.
- X This option together with the -e option allows SYSV
- X AUGMAKE recursive makes to function as expected.
- X
- IINNDDEEXX
- X Here is a list of the sections that follow and a short
- X description of each. Perhaps you won't have to read the
- X whole man page to find what you need.
- X
- X SSTTAARRTTUUPP Describes ddmmaakkee initialization.
- X
- X SSYYNNTTAAXX Describes the syntax of makefile expres-
- X sions.
- X
- X AATTTTRRIIBBUUTTEESS Describes the notion of attributes and
- X how they are used when making targets.
- X
- X MMAACCRROOSS Defining and expanding macros.
- X
- X RRUULLEESS AANNDD TTAARRGGEETTSS How to define targets and their prere-
- X quisites.
- X
- X RREECCIIPPEESS How to tell ddmmaakkee how to make a target.
- X
- X TTEEXXTT DDIIVVEERRSSIIOONNSS How to use text diversions in recipes and
- X macro expansions.
- X
- X SSPPEECCIIAALL TTAARRGGEETTSS Some targets are special.
- X
- X SSPPEECCIIAALL MMAACCRROOSS Macros used by ddmmaakkee to alter the pro-
- X cessing of the makefile, and those
- X defined by ddmmaakkee for the user.
- X
- X CCOONNTTRROOLL MMAACCRROOSS Itemized list of special control macros.
- X
- X RRUUNN--TTIIMMEE MMAACCRROOSS Discussion of special run-time macros
- X such as $@ and $<.
- X
- X FFUUNNCCTTIIOONN MMAACCRROOSS GNU style function macros, only $(mktmp
- X ...) for now.
- X
- X DDYYNNAAMMIICC PPRREERREEQQUUIISSIITTEESS
- X Processing of prerequisites which contain
- X macro expansions in their name.
- X
- X
- X
- X
- Version 3.70 UW 4
- X
- X
- X
- X
- DMAKE(p) Unsupported Free Software DMAKE(p)
- X
- X
- X
- X BBIINNDDIINNGG TTAARRGGEETTSS The rules that ddmmaakkee uses to bind a tar-
- X get to an existing file in the file sys-
- X tem.
- X
- X PPEERRCCEENNTT((%%)) RRUULLEESS Specification of recipes to be used by
- X the inference algorithm.
- X
- X MMAAKKIINNGG IINNFFEERREENNCCEESS The rules that ddmmaakkee uses when inferring
- X how to make a target which has no expli-
- X cit recipe. This and the previous sec-
- X tion are really a single section in the
- X text.
- X
- X MMAAKKIINNGG TTAARRGGEETTSS How ddmmaakkee makes targets other than
- X libraries.
- X
- X MMAAKKIINNGG LLIIBBRRAARRIIEESS How ddmmaakkee makes libraries.
- X
- X KKEEEEPP SSTTAATTEE A discussion of how .KEEP_STATE works.
- X
- X MMUULLTTII PPRROOCCEESSSSIINNGG Discussion of ddmmaakkee''ss parallel make
- X facilities for architectures that support
- X them.
- X
- X CCOONNDDIITTIIOONNAALLSS Conditional expressions which control the
- X processing of the makefile.
- X
- X EEXXAAMMPPLLEESS Some hopefully useful examples.
- X
- X CCOOMMPPAATTIIBBIILLIITTYY How ddmmaakkee compares with previous versions
- X of make.
- X
- X LLIIMMIITTSS Limitations of ddmmaakkee.
- X
- X PPOORRTTAABBIILLIITTYY Comments on writing portable makefiles.
- X
- X FFIILLEESS Files used by ddmmaakkee.
- X
- X SSEEEE AALLSSOO Other related programs, and man pages.
- X
- X AAUUTTHHOORR The guy responsible for this thing.
- X
- X BBUUGGSS Hope not.
- X
- SSTTAARRTTUUPP
- X When ddmmaakkee begins execution it first processes the command
- X line and then processes an initial startup-makefile. This
- X is followed by an attempt to locate and process a user sup-
- X plied makefile. The startup file defines the default values
- X of all required control macros and the set of default rules
- X for making targets and inferences. When searching for the
- X startup makefile, ddmmaakkee searches the following locations, in
- X
- X
- X
- Version 3.70 UW 5
- X
- X
- X
- X
- DMAKE(p) Unsupported Free Software DMAKE(p)
- X
- X
- X
- X the order specified, until a startup file is located:
- X
- X 1. The location given as the value of the macro MAK-
- X ESTARTUP defined on the command line.
- X
- X 2. The location given as the value of the environment
- X variable MAKESTARTUP defined in the current
- X environment.
- X
- X 3. The location given as the value of the macro MAK-
- X ESTARTUP defined internally within ddmmaakkee.
- X
- X The above search is disabled by specifying the -r option on
- X the command line. An error is issued if a startup makefile
- X cannot be found and the -r option was not specified. A user
- X may substitute a custom startup file by defining the MAKES-
- X TARTUP environment variable or by redefining the MAKESTARTUP
- X macro on the command line. To determine where ddmmaakkee looks
- X for the default startup file, check your environment or
- X issue the command _"_d_m_a_k_e _-_V_".
- X
- X A similar search is performed to locate a default user
- X makefile when no --ff command line option is specified. By
- X default, the prerequisite list of the special target
- X .MAKEFILES specifies the names of possible makefiles and the
- X search order that ddmmaakkee should use to determine if one
- X exists. A typical definition for this target is:
- X
- X .MAKEFILES : makefile.mk Makefile makefile
- X
- X ddmmaakkee will first look for makefile.mk and then the others.
- X If a prerequisite cannot be found ddmmaakkee will try to make it
- X before going on to the next prerequisite. For example,
- X makefile.mk can be checked out of an RCS file if the proper
- X rules for doing so are defined in the startup file.
- X
- SSYYNNTTAAXX
- X This section is a summary of the syntax of makefile state-
- X ments. The description is given in a style similar to BNF,
- X where { } enclose items that may appear zero or more times,
- X and [ ] enclose items that are optional. Alternative pro-
- X ductions for a left hand side are indicated by '->', and
- X newlines are significant. All symbols in bboolldd type are text
- X or names representing text supplied by the user.
- X
- X
- X
- X Makefile -> { Statement }
- X
- X Statement -> Macro-Definition
- X -> Conditional
- X -> Rule-Definition
- X
- X
- X
- Version 3.70 UW 6
- X
- X
- X
- X
- DMAKE(p) Unsupported Free Software DMAKE(p)
- X
- X
- X
- X -> Attribute-Definition
- X
- X Macro-Definition -> MMAACCRROO == LLIINNEE
- X -> MMAACCRROO **== LLIINNEE
- X -> MMAACCRROO ::== LLIINNEE
- X -> MMAACCRROO **::== LLIINNEE
- X -> MMAACCRROO ++== LLIINNEE
- X -> MMAACCRROO ++::== LLIINNEE
- X
- X Conditional -> ..IIFF expression
- X Makefile
- X [ ..EELLIIFF expression
- X Makefile ]
- X [ ..EELLSSEE
- X Makefile ]
- X ..EENNDD
- X
- X expression -> LLIINNEE
- X -> SSTTRRIINNGG ==== LLIINNEE
- X -> SSTTRRIINNGG !!== LLIINNEE
- X
- X
- X Rule-Definition -> target-definition
- X [ recipe ]
- X
- X target-definition -> targets [attrs] op { PPRREERREEQQUUIISSIITTEE } [;; rcp-line]
- X
- X targets -> target { targets }
- X -> ""target"" { targets }
- X
- X target -> special-target
- X -> TTAARRGGEETT
- X
- X attrs -> attribute { attrs }
- X -> ""attribute"" { attrs }
- X
- X op -> :: { modifier }
- X
- X modifier -> ::
- X -> ^^
- X -> !!
- X -> --
- X
- X recipe -> { TTAABB rcp-line }
- X -> [@@][%%][--] [[
- X { LLIINNEE }
- X ]]
- X
- X rcp-line -> [@@][%%][--][++] LLIINNEE
- X
- X
- X
- X
- X
- X
- Version 3.70 UW 7
- X
- X
- X
- X
- DMAKE(p) Unsupported Free Software DMAKE(p)
- X
- X
- X
- X Attribute-Definition -> attrs :: targets
- X
- X
- X attribute -> ..EEPPIILLOOGG
- X -> ..IIGGNNOORREE
- X -> ..LLIIBBRRAARRYY
- X -> ..MMKKSSAARRGGSS
- X -> ..NNOOIINNFFEERR
- X -> ..NNOOSSTTAATTEE
- X -> ..PPHHOONNYY
- X -> ..PPRREECCIIOOUUSS
- X -> ..PPRROOLLOOGG
- X -> ..SSEETTDDIIRR==_p_a_t_h
- X -> ..SSIILLEENNTT
- X -> ..SSEEQQUUEENNTTIIAALL
- X -> ..SSWWAAPP
- X -> ..UUSSEESSHHEELLLL
- X -> ..SSYYMMBBOOLL
- X -> ..UUPPDDAATTEEAALLLL
- X
- X special-target -> ..EERRRROORR
- X -> ..EEXXPPOORRTT
- X -> ..GGRROOUUPPEEPPIILLOOGG
- X -> ..GGRROOUUPPPPRROOLLOOGG
- X -> ..IIMMPPOORRTT
- X -> ..IINNCCLLUUDDEE
- X -> ..IINNCCLLUUDDEEDDIIRRSS
- X -> ..MMAAKKEEFFIILLEESS
- X -> ..RREEMMOOVVEE
- X -> ..SSOOUURRCCEE
- X -> ..SSOOUURRCCEE.._s_u_f_f_i_x
- X -> ._s_u_f_f_i_x_1._s_u_f_f_i_x_2
- X
- X
- X Where, TTAABB represents a <tab> character, SSTTRRIINNGG represents
- X an arbitrary sequence of characters, and LLIINNEE represents a
- X possibly empty sequence of characters terminated by a non-
- X escaped (not immediately preceded by a backslash '\') new-
- X line character. MMAACCRROO, PPRREERREEQQUUIISSIITTEE, and TTAARRGGEETT each
- X represent a string of characters not including space or tab
- X which respectively form the name of a macro, prerequisite or
- X target. The name may itself be a macro expansion expres-
- X sion. A LLIINNEE can be continued over several physical lines
- X by terminating it with a single backslash character. Com-
- X ments are initiated by the pound ## character and extend to
- X the end of line. All comment text is discarded, a '#' may
- X be placed into the makefile text by escaping it with '\'
- X (ie. \# translates to # when it is parsed). An exception to
- X this occurs when a # is seen inside a recipe line that
- X begins with a <tab> or is inside a group recipe. If you
- X specify the --cc command line switch then this behavior is
- X disabled and ddmmaakkee will treat all # characters as start of
- X
- X
- X
- Version 3.70 UW 8
- X
- X
- X
- X
- DMAKE(p) Unsupported Free Software DMAKE(p)
- X
- X
- X
- X comment indicators unless they are escaped by \. A set of
- X continued lines may be commented out by placing a single #
- X at the start of the first line. A continued line cannot
- X span more than one makefile.
- X
- X wwhhiittee ssppaaccee is defined to be any combination of <space>,
- X <tab>, and the sequence \<nl> when \<nl> is used to ter-
- X minate a LINE. When processing mmaaccrroo definition lines, any
- X amount of white space is allowed on either side of the macro
- X operator (=, *=, :=, *:=, += or +:=), and white space is
- X stripped from both before and after the macro value string.
- X The sequence \<nl> is treated as white space during recipe
- X expansion and is deleted from the final recipe string. You
- X must escape the \<nl> with another \ in order to get a \ at
- X the end of a recipe line. The \<nl> sequence is deleted
- X from macro values when they are expanded.
- X
- X When processing ttaarrggeett definition lines, the recipe for a
- X target must, in general, follow the first definition of the
- X target (See the RULES AND TARGETS section for an exception),
- X and the recipe may not span across multiple makefiles. Any
- X targets and prerequisites found on a target definition line
- X are taken to be white space separated tokens. The rule
- X operator (_o_p in SYNTAX section) is also considered to be a
- X token but does not require white space to precede or follow
- X it. Since the rule operator begins with a `:', traditional
- X versions of make do not allow the `:' character to form a
- X valid target name. ddmmaakkee allows `:' to be present in
- X target/prerequisite names as long as the entire
- X target/prerequisite name is quoted. For example:
- X
- X a:fred : test
- X
- X would be parsed as TARGET = a, PREREQUISITES={fred, :,
- X test}, which is not what was intended. To fix this you must
- X write:
- X
- X "a:fred" : test
- X
- X Which will be parsed as expected. See the EXAMPLES section
- X for how to apply "" quoting to a list of targets.
- X
- AATTTTRRIIBBUUTTEESS
- X ddmmaakkee defines several target attributes. Attributes may be
- X assigned to a single target, a group of targets, or to all
- X targets in the makefile. Attributes are used to modify
- X ddmmaakkee actions during target update. The recognized attri-
- X butes are:
- X
- X
- X ..EEPPIILLOOGG Insert shell epilog code when executing a group
- X recipe associated with any target having this
- X
- X
- X
- Version 3.70 UW 9
- X
- X
- X
- X
- DMAKE(p) Unsupported Free Software DMAKE(p)
- X
- X
- X
- X attribute set.
- X
- X ..IIGGNNOORREE Ignore an error when trying to make any target
- X with this attribute set.
- X
- X ..LLIIBBRRAARRYY Target is a library.
- X
- X ..MMKKSSAARRGGSS If running in an MSDOS environment then use MKS
- X extended argument passing conventions to pass
- X arguments to commands. Non-MSDOS environments
- X ignore this attribute.
- X
- X ..NNOOIINNFFEERR Any target with this attribute set will not be
- X subjected to transitive closure if it is
- X inferred as a prerequisite of a target whose
- X recipe and prerequisites are being inferred.
- X (i.e. the inference algorithm will not use any
- X prerequisite with this attribute set, as a tar-
- X get) If specified as '.NOINFER:' (ie. with no
- SHAR_EOF
- true || echo 'restore of dmake/man/dmake.p failed'
- fi
- echo 'End of part 15, continue with part 16'
- echo 16 > _shar_seq_.tmp
- exit 0
-
- exit 0 # Just in case...
- --
- Kent Landfield INTERNET: kent@sparky.IMD.Sterling.COM
- Sterling Software, IMD UUCP: uunet!sparky!kent
- Phone: (402) 291-8300 FAX: (402) 291-4362
- Please send comp.sources.misc-related mail to kent@uunet.uu.net.
-