From 0a6dd433bf3969cf7dfa6dcfecfc1244a289c0b4 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 14 Nov 2019 14:26:12 +0000 Subject: [PATCH] docs: Improve docs. Signed-off-by: Ian Jackson --- README | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/README b/README index b4f9a15..ef839d5 100644 --- a/README +++ b/README @@ -28,15 +28,17 @@ Basic approach 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 -`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 -its "local" filenames. +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 @@ -138,10 +140,22 @@ If you `include subdirmk/regen.mk', dependency management and 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 @@ -149,12 +163,6 @@ Path construction &-expansions, meanings summary: 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... @@ -213,6 +221,8 @@ In general: ; 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 | '/' ] -- 2.30.2