📄 dmake.man
字号:
CCOONNDDIITTIIOONNAALLSS Conditional expressions which control the
processing of the makefile.
EEXXAAMMPPLLEESS Some hopefully useful examples.
CCOOMMPPAATTIIBBIILLIITTYY How ddmmaakkee compares with previous versions
of make.
LLIIMMIITTSS Limitations of ddmmaakkee.
PPOORRTTAABBIILLIITTYY Comments on writing portable makefiles.
FFIILLEESS Files used by ddmmaakkee.
SSEEEE AALLSSOO Other related programs, and man pages.
AAUUTTHHOORR The guy responsible for this thing.
BBUUGGSS Hope not.
SSTTAARRTTUUPP
When ddmmaakkee begins execution it first processes the command
line and then processes an initial startup-makefile. This
is followed by an attempt to locate and process a user sup-
plied makefile. The startup file defines the default values
of all required control macros and the set of default rules
for making targets and inferences. When searching for the
startup makefile, ddmmaakkee searches the following locations, in
the order specified, until a startup file is located:
1. The location given as the value of the macro MAK-
ESTARTUP defined on the command line.
2. The location given as the value of the environment
variable MAKESTARTUP defined in the current
environment.
3. The location given as the value of the macro MAK-
ESTARTUP defined internally within ddmmaakkee.
The above search is disabled by specifying the -r option on
the command line. An error is issued if a startup makefile
cannot be found and the -r option was not specified. A user
may substitute a custom startup file by defining the MAKES-
TARTUP environment variable or by redefining the MAKESTARTUP
macro on the command line. To determine where ddmmaakkee looks
for the default startup file, check your environment or
issue the command _"_d_m_a_k_e _-_V_".
A similar search is performed to locate a default user
makefile when no --ff command line option is specified. By
default, the prerequisite list of the special target
Version 3.9 PL0 UW 6
DMAKE(p) Unsupported Free Software DMAKE(p)
.MAKEFILES specifies the names of possible makefiles and the
search order that ddmmaakkee should use to determine if one
exists. A typical definition for this target is:
.MAKEFILES : makefile.mk Makefile makefile
ddmmaakkee will first look for makefile.mk and then the others.
If a prerequisite cannot be found ddmmaakkee will try to make it
before going on to the next prerequisite. For example,
makefile.mk can be checked out of an RCS file if the proper
rules for doing so are defined in the startup file.
If the first line of the user makefile is of the form:
#! command command_args
then ddmmaakkee will expand and run the command prior to reading
any additional input. If the return code of the command is
zero then ddmmaakkee will continue on to process the remainder of
the user makefile, if the return code is non-zero then dmake
will exit.
ddmmaakkee builds the internal dependency graph as it parses a
user specified makefile. The graph is rooted at the special
target ..RROOOOTT. .ROOT is the top level target that dmake
builds when it starts to build targets. All user specified
targets (those from the command line or taken as defaults
from the makefile) are made prerequisites of the special
target ..TTAARRGGEETTSS. ddmmaakkee by default creates the relationship
that .ROOT depends on .TARGETS and as a result everything is
made. This approach allows the user to customize, within
their makefile, the order and which, target, is built first.
For example the default makefiles come with settings for
.ROOT that specify:
.ROOT .PHONY .NOSTATE .SEQUENTIAL : .INIT .TARGETS
.DONE
with .INIT and .DONE defined as:
.INIT .DONE :;
which nicely emulates the behaviour of Sun's make exten-
sions. The building of .ROOT's prerequisites is always
forced to be sequential.
SSYYNNTTAAXX
This section is a summary of the syntax of makefile state-
ments. The description is given in a style similar to BNF,
where { } enclose items that may appear zero or more times,
and [ ] enclose items that are optional. Alternative pro-
ductions for a left hand side are indicated by '->', and
Version 3.9 PL0 UW 7
DMAKE(p) Unsupported Free Software DMAKE(p)
newlines are significant. All symbols in bboolldd type are text
or names representing text supplied by the user.
Makefile -> { Statement }
Statement -> Macro-Definition
-> Conditional-Macro-Definition
-> Conditional
-> Rule-Definition
-> Attribute-Definition
Macro-Definition -> MMAACCRROO == LLIINNEE
-> MMAACCRROO [[!!]*= LINE
---->>>> MMAACCRROO [[!!]:= LINE
---->>>> MMAACCRROO [[!!]*:= LINE
---->>>> MMAACCRROO [[!!]+= LINE
---->>>> MMAACCRROO [[!!]+:= LINE
CCoonnddiittiioonnaall--MMaaccrroo--DDeeffiinniittiioonn ---->>>> TTAARRGGEETT ?= Macro-
Definition
Conditional -> ..IIFF expression
Makefile
[ ..EELLIIFF expression
Makefile ]
[ ..EELLSSEE
Makefile ]
..EENNDD
expression -> LLIINNEE
-> SSTTRRIINNGG ==== LLIINNEE
-> SSTTRRIINNGG !!== LLIINNEE
Rule-Definition -> target-definition
[ recipe ]
target-definition -> targets [attrs] op { PPRREERREEQQUUIISSIITTEE } [;; rcp-line]
targets -> target { targets }
-> ""target"" { targets }
target -> special-target
-> TTAARRGGEETT
attrs -> attribute { attrs }
-> ""attribute"" { attrs }
op -> :: { modifier }
Version 3.9 PL0 UW 8
DMAKE(p) Unsupported Free Software DMAKE(p)
modifier -> ::
-> ^^
-> !!
-> --
-> ||
recipe -> { TTAABB rcp-line }
-> [@@][%%][--] [[
{ LLIINNEE }
]]
rcp-line -> [@@][%%][--][++] LLIINNEE
Attribute-Definition -> attrs :: targets
attribute -> ..EEPPIILLOOGG
-> ..GGRROOUUPP
-> ..IIGGNNOORREE
-> ..IIGGNNOORREEGGRROOUUPP
-> ..LLIIBBRRAARRYY
-> ..MMKKSSAARRGGSS
-> ..NNOOIINNFFEERR
-> ..NNOOSSTTAATTEE
-> ..PPHHOONNYY
-> ..PPRREECCIIOOUUSS
-> ..PPRROOLLOOGG
-> ..SSEETTDDIIRR==_p_a_t_h
-> ..SSIILLEENNTT
-> ..SSEEQQUUEENNTTIIAALL
-> ..SSWWAAPP
-> ..UUSSEESSHHEELLLL
-> ..SSYYMMBBOOLL
-> ..UUPPDDAATTEEAALLLL
special-target -> ..EERRRROORR
-> ..EEXXIITT
-> ..EEXXPPOORRTT
-> ..GGRROOUUPPEEPPIILLOOGG
-> ..GGRROOUUPPPPRROOLLOOGG
-> ..IIMMPPOORRTT
-> ..IINNCCLLUUDDEE
-> ..IINNCCLLUUDDEEDDIIRRSS
-> ..MMAAKKEEFFIILLEESS
-> ..RREEMMOOVVEE
-> ..SSOOUURRCCEE
-> ..SSOOUURRCCEE.._s_u_f_f_i_x
-> ._s_u_f_f_i_x_1._s_u_f_f_i_x_2
Version 3.9 PL0 UW 9
DMAKE(p) Unsupported Free Software DMAKE(p)
Where, TTAABB represents a <tab> character, SSTTRRIINNGG represents
an arbitrary sequence of characters, and LLIINNEE represents a
possibly empty sequence of characters terminated by a non-
escaped (not immediately preceded by a backslash '\') new-
line character. MMAACCRROO, PPRREERREEQQUUIISSIITTEE, and TTAARRGGEETT each
represent a string of characters not including space or tab
which respectively form the name of a macro, prerequisite or
target. The name may itself be a macro expansion expres-
sion. A LLIINNEE can be continued over several physical lines
by terminating it with a single backslash character. Com-
ments are initiated by the pound ## character and extend to
the end of line. All comment text is discarded, a '#' may
be placed into the makefile text by escaping it with '\'
(ie. \# translates to # when it is parsed). An exception to
this occurs when a # is seen inside a recipe line that
begins with a <tab> or is inside a group recipe. If you
specify the --cc command line switch then this behavior is
disabled and ddmmaakkee will treat all # characters as start of
comment indicators unless they are escaped by \. A set of
continued lines may be commented out by placing a single #
at the start of the first line. A continued line cannot
span more than one makefile.
wwhhiittee ssppaaccee is defined to be any combination of <space>,
<tab>, and the sequence \<nl> when \<nl> is used to ter-
minate a LINE. When processing mmaaccrroo definition lines, any
amount of white space is allowed on either side of the macro
operator and white space is stripped from both before and
after the macro value string. The sequence \<nl> is treated
as white space during recipe expansion and is deleted from
the final recipe string. You must escape the \<nl> with
another \ in order to get a \ at the end of a recipe line.
The \<nl> sequence is deleted from macro values when they
are expanded.
When processing ttaarrggeett definition lines, the recipe for a
target must, in general, follow the first definition of the
target (See the RULES AND TARGETS section for an exception),
and the recipe may not span across multiple makefiles. Any
targets and prerequisites found on a target definition line
are taken to be white space separated tokens. The rule
operator (_o_p in SYNTAX section) is also considered to be a
token but does not require white space to precede or follow
it. Since the rule operator begins with a `:', traditional
versions of make do not allow the `:' character to form a
valid target name. ddmmaakkee allows `:' to be present in
target/prerequisite names as long as the entire
target/prerequisite name is quoted. For example:
a:fred : test
would be parsed as TARGET = a, PREREQUISITES={fred, :,
Version 3.9 PL0 UW 10
DMAKE(p) Unsupported Free Software DMAKE(p)
test}, which is not what was intended. To fix this you must
write:
"a:fred" : test
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -