summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
e7d6ffd)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
The developer is expected to write a makefile fragment, in each
relevant subdirectory, called `Subdir.sd.mk'.
The developer is expected to write a makefile fragment, in each
relevant subdirectory, called `Subdir.sd.mk'.
-These fragments may contain ordinary make language.
+These fragments may contain ordinary make language. Unqualified
+filenames are relative to the build toplevel, and all commands all run
+there.
However, the sigil & is treated specially. By and large, it refers to
However, the sigil & is treated specially. By and large, it refers to
-`the current directory'. There are a variety of convenient
-constructions.
+`the build directory corresponding to this .sd.mk file', etc.
+There are a variety of convenient constructions.
The result is that to a large extent, the Subdir.sd.mk has an easy way
to namespace its "local" make variables, and an easy way to refer to
The result is that to a large extent, the Subdir.sd.mk has an easy way
to namespace its "local" make variables, and an easy way to refer to
+its "local" filenames (and filenames in general).
The Subdir.sd.mk's are filtered, fed through autoconf in the usual way
(for @..@-substitutions) and included by one autogenerated toplevel
The Subdir.sd.mk's are filtered, fed through autoconf in the usual way
(for @..@-substitutions) and included by one autogenerated toplevel
automatic regeneration for all of this template substitution, and for
config.status etc. is done for you.
automatic regeneration for all of this template substitution, and for
config.status etc. is done for you.
-Summary of recommended directory reference syntaxes
----------------------------------------------------
+Tables of file reference syntaxes
+---------------------------------
-Path construction &-expansions, meanings summary:
+In a nonrecursive makefile supporting out of tree builds there are
+three separate important distinctions between different file
+locations:
+
+ (i) In the build tree, or in the source tree ?
+
+ (ii) In (or relative to) the subdirectory to which this Subdir.sd.mk
+ relates, or relative to the project's top level ?
+
+ (iii) Absolute or relative pathname ?
+ (Usually relative pathnames suffice.)
+
+Path construction &-expansions are built from the following:
Relative paths in... Absolute paths in...
build source build source
Relative paths in... Absolute paths in...
build source build source
This directory & &, &@ &@,
Top level . &; &@. &@;
This directory & &, &@ &@,
Top level . &; &@. &@;
-Adding `@' means "absolute path". (`&.' is not allowed without @
-because just `&./' is a silly way of writing `.'.) `/' terminates the
-escape (needed if the next thing is not a lowercase character, or
-space). `=' means "just the value, no /". Space starts multi-word
-processing.
-
In more detail, with the various options for what comes next:
Recommended Relative paths in... Absolute paths in...
In more detail, with the various options for what comes next:
Recommended Relative paths in... Absolute paths in...
; pathname of top level of source tree
. pathname of this directory in build tree, `@' must be specified
@ absolute pathnames
; pathname of top level of source tree
. pathname of this directory in build tree, `@' must be specified
@ absolute pathnames
+ / terminates the escape (needed if next is not lwsp or space)
+ lwsp starts multi-word processing (see below)
So pathname syntax is a subset of:
'&' [ '@' ] [ ',' | ';' | '.' ] [ lc | '/' ]
So pathname syntax is a subset of:
'&' [ '@' ] [ ',' | ';' | '.' ] [ lc | '/' ]