Rombobjörn

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Persson <bjorn@rombobjörn.se>2013-08-13 15:19:53 +0200
committerBjörn Persson <bjorn@rombobjörn.se>2013-08-13 15:19:53 +0200
commit98656d5ea6079457992eb779787d7be51ab2917a (patch)
tree3f6e91ef3c65c1e325726fd7c05848ce66efc87d
parenta52ebd4b95b52d281c90837027d081ce4378130d (diff)
Keeping most of the build system in a subdirectory in the source tree should also work now.
-rw-r--r--comfignat.mk13
-rwxr-xr-xmanual.en.html4
2 files changed, 10 insertions, 7 deletions
diff --git a/comfignat.mk b/comfignat.mk
index 07ae8d2..15fb467 100644
--- a/comfignat.mk
+++ b/comfignat.mk
@@ -136,9 +136,10 @@ install_cp_flags = ${if ${DESTDIR},--preserve=timestamps}
#
srcdir := ${abspath ${dir ${lastword ${MAKEFILE_LIST}}}}
-# srcdir is the root of the source tree, computed as the directory part of the
-# last pathname in MAKEFILE_LIST – which is this file since there is no include
-# directive above this point.
+# srcdir is the directory in the source tree where makefiles and project files
+# are. It may be the root of the source tree or a subdirectory. It is computed
+# as the directory part of the last pathname in MAKEFILE_LIST – which is this
+# file since there is no include directive above this point.
stage_bindir = ${stagedir}${bindir}
stage_libexecdir = ${stagedir}${libexecdir}
@@ -446,8 +447,10 @@ options_building = ${addprefix -X,${option_values}}
# Some other data that the rules below need:
#
-delegation_command := @$${MAKE} --file=${abspath ${firstword ${MAKEFILE_LIST}}}\
- --include-dir=${srcdir} --no-print-directory
+main_makefile := ${firstword ${MAKEFILE_LIST}}
+delegation_command = @$${MAKE} --file=${abspath ${main_makefile}} \
+ --include-dir=${abspath ${dir ${main_makefile}}} \
+ --no-print-directory
# delegation_command is the Make command line that delegating makefiles in
# separate build directories use to delegate commands to the main makefile. The
# first pathname in MAKEFILE_LIST is the main makefile.
diff --git a/manual.en.html b/manual.en.html
index 414746e..03052f1 100755
--- a/manual.en.html
+++ b/manual.en.html
@@ -460,8 +460,8 @@ file will be in the build directory, so it can't refer to source directories
with pathnames relative to the project file or rely on the source files being
in the same directory as the project file. The preprocessor symbol
<var>Srcdir</var> must be used in the value of <var>Source_Dirs</var>. Its
-value is the directory where <var>comfignat.mk</var> is, which is supposed to
-be the root of the source tree. Here's an example:</p>
+value is the directory where <var>comfignat.mk</var> is, which is usually the
+root of the source tree. Here's an example:</p>
<pre class="example gpr">for Source_Dirs use ($Srcdir &amp; "/tools");</pre>