chiark / gitweb /
subdirmk.git
4 months agotests/intree: Make copy and break out from tests/example
Ian Jackson [Sun, 29 Dec 2019 12:59:14 +0000 (12:59 +0000)]
tests/intree: Make copy and break out from tests/example

We introduce make_copy, which makes a copy of tests/example
suitable for testing.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agobuild tests: Break out build-common
Ian Jackson [Sun, 29 Dec 2019 12:48:55 +0000 (12:48 +0000)]
build tests: Break out build-common

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregen.mk.in: Clarify documentation about realclean
Ian Jackson [Sun, 29 Dec 2019 12:34:39 +0000 (12:34 +0000)]
regen.mk.in: Clarify documentation about realclean

It's not sensible to `make [the provided] realclean:: into a recursive
target' in that sense since the one we provide is effective, and
present, only in the toplevel.  What we mean is that you can make your
own realclean target and regen.mk's will fit in nicely.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregen.mk.in: Document CONFIG_STATUS_OUTPUTS
Ian Jackson [Sun, 29 Dec 2019 11:00:47 +0000 (11:00 +0000)]
regen.mk.in: Document CONFIG_STATUS_OUTPUTS

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agotest/example/check: Reset times for regen tests
Ian Jackson [Sun, 29 Dec 2019 12:27:00 +0000 (12:27 +0000)]
test/example/check: Reset times for regen tests

In principle, on a filesystem with poor time resolution, the updates
to the input files might have the same timestamp as the output files.
Things would then not be regenerated.

Work around this by resetting all timestamps in the build tree to
1s ago.  This should ensure that exactly the one file whose edit we
are simulating seems, to make, to have been changed.

There is a remaining possible problem: if our last actual change to
the subdirmk source tree is less than 1s ago, this might rebuild too
much.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agotest/example/check: Make sections appear in stderr output
Ian Jackson [Sun, 29 Dec 2019 12:26:25 +0000 (12:26 +0000)]
test/example/check: Make sections appear in stderr output

This makes the output easier to navigate.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agotests/example/check: Better handling of makefile updates
Ian Jackson [Sun, 29 Dec 2019 11:01:28 +0000 (11:01 +0000)]
tests/example/check: Better handling of makefile updates

Rather than checking just for presence of a string in a templated
output file, also have the input file define a target which we try to
run.  This checks that make actually reread the file.

Also add ||false to the grep lines, which makes the stderr output
more obviously contain a failure when the test fails.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agotests/example: Include non-.sd.mk files in SUBDIRMK_MAKEFILES
Ian Jackson [Sun, 29 Dec 2019 11:01:18 +0000 (11:01 +0000)]
tests/example: Include non-.sd.mk files in SUBDIRMK_MAKEFILES

subdirmk.ac provides @_SUBDIRMK_MAKEFILES@ which is a list of the
*.mk makefiles (corresponding to *.mk.in makefiles) passed to
SUBDIRMK_MAKEFILES.  These need to be included in the
identically-named make variable for regen.mk to rerun config.status
when the .in files are edited.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agotests/example: Correct filename for for-test.mk
Ian Jackson [Sun, 29 Dec 2019 11:00:39 +0000 (11:00 +0000)]
tests/example: Correct filename for for-test.mk

&^/ means "this source directory" so &^/lib/ in lib/ is nonsense and
produces lib/lib/.  Also we didn't want the source directory:
anyway: config.status produces outputs in the build tree.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoregen.mk.in: Debugging, controlled by SUBDIRMK_REGEN_NDEBUG
Ian Jackson [Sat, 28 Dec 2019 23:17:07 +0000 (23:17 +0000)]
regen.mk.in: Debugging, controlled by SUBDIRMK_REGEN_NDEBUG

And enable this in test/example/check.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agotests: Test Perdir.sd.mk
Ian Jackson [Wed, 25 Dec 2019 19:21:51 +0000 (19:21 +0000)]
tests: Test Perdir.sd.mk

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoREADME: Do not assert that all directive arguments are &-expanded
Ian Jackson [Sat, 28 Dec 2019 00:16:58 +0000 (00:16 +0000)]
README: Do not assert that all directive arguments are &-expanded

Since
  Syntax: only some directives' RHS should be &-expanded
this has not been true for &:changequote, and it is not true in
the general case.  It depends on the directive.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoREADME: Document NEWQUOTE\$ in changequote
Ian Jackson [Sun, 22 Dec 2019 18:25:55 +0000 (18:25 +0000)]
README: Document NEWQUOTE\$ in changequote

This also adds a doctest.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoSyntax: Line joining with &\
Ian Jackson [Wed, 18 Dec 2019 21:44:15 +0000 (21:44 +0000)]
Syntax: Line joining with &\

make has a weird rule for line joining in recipes, where the \ is
retained.  This is very annoying espcially when writing little scripts
in other languages in recipes.  The GNU make documentation suggests
using a `define' block, in which the \ are still necessary, but
vanish.  But that separates out the recipe from the rule, and also
demands that the recipe text be given a name.

(Note that .ONESHELL offers an alternative but sadly is not available
on a per-rule basis.  This is even less sensible with non-recursive
make, where you might want different directories to have different
settings.)

So, provide &\ which does the other thing, swallowing the newline and
discarding the &\, even in rules.

Add a test case too.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agotests: Test &TARGETS feature
Ian Jackson [Wed, 25 Dec 2019 17:14:40 +0000 (17:14 +0000)]
tests: Test &TARGETS feature

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoSyntax: Refine &TARGETS_things, mostly to avoid # wrinkle
Ian Jackson [Mon, 9 Dec 2019 15:05:22 +0000 (15:05 +0000)]
Syntax: Refine &TARGETS_things, mostly to avoid # wrinkle

We will add a test case in a moment, since it is quite a noisy diff.

We have to upate clean.sd.mk, which uses this feature.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoSyntax: only some directives' RHS should be &-expanded
Ian Jackson [Wed, 25 Dec 2019 17:08:19 +0000 (17:08 +0000)]
Syntax: only some directives' RHS should be &-expanded

In principle this is an incompatible change but only for strange input
files and only if they use &:changequote.

We need an ad-hoc test for this.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoSyntax: Provide &$VARIABLE
Ian Jackson [Mon, 9 Dec 2019 16:31:59 +0000 (16:31 +0000)]
Syntax: Provide &$VARIABLE

Testing is done by the doctests.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agodoctests: Test in sub/dir too
Ian Jackson [Wed, 25 Dec 2019 15:43:38 +0000 (15:43 +0000)]
doctests: Test in sub/dir too

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agodoctests: Add missing & from include
Ian Jackson [Wed, 25 Dec 2019 15:43:00 +0000 (15:43 +0000)]
doctests: Add missing & from include

This makes no difference in this file but we'll want the same in
sub/dir/ and they should be the same.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agodoctests: check: Define i and o vars
Ian Jackson [Wed, 25 Dec 2019 15:42:16 +0000 (15:42 +0000)]
doctests: check: Define i and o vars

This makes bash -x debugging easier.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agodoctests: Fail on extraction if we don't understand the README
Ian Jackson [Tue, 24 Dec 2019 23:04:07 +0000 (23:04 +0000)]
doctests: Fail on extraction if we don't understand the README

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agotests/filter/check: Enable pipefail
Ian Jackson [Wed, 25 Dec 2019 01:21:54 +0000 (01:21 +0000)]
tests/filter/check: Enable pipefail

So we must use bash.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agodoctests: Extract and use
Ian Jackson [Tue, 24 Dec 2019 00:49:00 +0000 (00:49 +0000)]
doctests: Extract and use

Include the doctests from the toplevel Subdir.sd.mk.

In check, extract the doctests, and seddery the expected output into
the combined expected output file.  This involves adding a comment in
Subdir.mk.expected to indicate where the doctests will appear.

In update-expected, contrive to strip the doctest output back out of
the actual output so we can update only the manually-edited part.

Consequential changes to MAKEFILE_TEMPLATES in main.mk.expected
and .gitignore.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agodoctests: Fix newline handling in changequote mode section
Ian Jackson [Wed, 25 Dec 2019 12:55:48 +0000 (12:55 +0000)]
doctests: Fix newline handling in changequote mode section

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoREADME, doctests: Use NEWQUOTE instead of STUFF
Ian Jackson [Wed, 25 Dec 2019 12:55:02 +0000 (12:55 +0000)]
README, doctests: Use NEWQUOTE instead of STUFF

STUFF is rather generic.  Also we want to seddery it in the rubric for
the doctest to avoid it triggering.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agodoctests: Provide extract-doctest
Ian Jackson [Sun, 22 Dec 2019 18:27:10 +0000 (18:27 +0000)]
doctests: Provide extract-doctest

This is not called yet.  There are a few things that need fixing
first.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoREADME: Do not use => inappropriately
Ian Jackson [Sun, 22 Dec 2019 18:25:08 +0000 (18:25 +0000)]
README: Do not use => inappropriately

Our notation is that => introduces the ouput string.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoSyntax: Use &\ for escaping; abolish \&
Ian Jackson [Mon, 9 Dec 2019 14:49:43 +0000 (14:49 +0000)]
Syntax: Use &\ for escaping; abolish \&

"\&" causes lots of trouble, including difficulty specifying certain
resulting strings.

Previously I proposed a scheme using &$@ but this is only useful to
provide a way to write &s.

The $-doubling regime which will come later wants a way to produce a
single literal $, so introduce that now using the same syntax.
And &\ feels quite natural to me.

Incompatible change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoSyntax: Introduce &. and friends
Ian Jackson [Tue, 10 Dec 2019 01:21:43 +0000 (01:21 +0000)]
Syntax: Introduce &. and friends

Incompatible change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agogenerate: Provide $var_prefix_name to process_input_mk
Ian Jackson [Wed, 25 Dec 2019 01:09:18 +0000 (01:09 +0000)]
generate: Provide $var_prefix_name to process_input_mk

Nothing uses this yet.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoSyntax: Introduce &:changequote
Ian Jackson [Wed, 11 Dec 2019 13:24:47 +0000 (13:24 +0000)]
Syntax: Introduce &:changequote

Incompatible change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agogenerate: Track output Makefiles properly
Ian Jackson [Tue, 24 Dec 2019 00:28:30 +0000 (00:28 +0000)]
generate: Track output Makefiles properly

This fixes a bug where the intermediate directory Makefile was not
included whe it should be.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agotests/filter: Add .../sub/dir
Ian Jackson [Tue, 24 Dec 2019 00:18:46 +0000 (00:18 +0000)]
tests/filter: Add .../sub/dir

This will let us test output which depends on the subdirectory,
which is kind of the whole point...

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agotests: Shuffle, make tests/check run all the tests
Ian Jackson [Wed, 25 Dec 2019 17:28:34 +0000 (17:28 +0000)]
tests: Shuffle, make tests/check run all the tests

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agotests/filter: New test framework for generate
Ian Jackson [Sat, 21 Dec 2019 11:40:54 +0000 (11:40 +0000)]
tests/filter: New test framework for generate

This test case bypasses autoconf and runs generate directly.
It also gives us somewhere to write examples of each of the
&-expansions without further cluttering test-example.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agogenerate: Handle nodes with no own Subdir.sd.mk
Ian Jackson [Sun, 22 Dec 2019 19:52:10 +0000 (19:52 +0000)]
generate: Handle nodes with no own Subdir.sd.mk

If a directory is not mentioned on the command line, we would assume
it had a Subdir.sd.mk anyway.  Instead, expect it not to have one.

We do still generate a per-subdirectory fragment for such unmentioned
nodes: this serves to wire its children ino the parent, make running
`make' in that directory possible, etc.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agogenerate: Add missing final newline to main.mk
Ian Jackson [Sat, 21 Dec 2019 11:34:12 +0000 (11:34 +0000)]
generate: Add missing final newline to main.mk

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agotests: Add some section comments.
Ian Jackson [Sat, 21 Dec 2019 11:17:41 +0000 (11:17 +0000)]
tests: Add some section comments.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoexample: Add a comment next to for-test bits
Ian Jackson [Sat, 21 Dec 2019 11:15:23 +0000 (11:15 +0000)]
example: Add a comment next to for-test bits

This may help unconfuse people using this as an example.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoREADME: Fix a mistake in the file reference table
Ian Jackson [Tue, 17 Dec 2019 22:19:37 +0000 (22:19 +0000)]
README: Fix a mistake in the file reference table

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
4 months agoMerge from secnet
Ian Jackson [Sat, 28 Dec 2019 22:18:19 +0000 (22:18 +0000)]
Merge from secnet

5 months ago&TARGETS*: make autogenerated targets .PHONY
Ian Jackson [Sun, 8 Dec 2019 23:12:25 +0000 (23:12 +0000)]
&TARGETS*: make autogenerated targets .PHONY

Suggested-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
5 months agodocs: Minor fix to README
Ian Jackson [Sun, 8 Dec 2019 18:06:50 +0000 (18:06 +0000)]
docs: Minor fix to README

Reported-by: Mark Wooding <mdw@distorted.org.uk>
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
5 months agodocs: Minor fixes to regen.mk.in comment
Ian Jackson [Sun, 8 Dec 2019 18:06:37 +0000 (18:06 +0000)]
docs: Minor fixes to regen.mk.in comment

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
5 months agosubdirmk: Suppress MAKEFILE_TEMPLATES when running `make clean'
Ian Jackson [Sat, 7 Dec 2019 15:28:29 +0000 (15:28 +0000)]
subdirmk: Suppress MAKEFILE_TEMPLATES when running `make clean'

See the README hunk for the reasoning.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
5 months agosubdirmk: break out subdirmk_target in generated Makefile
Ian Jackson [Sat, 7 Dec 2019 15:17:12 +0000 (15:17 +0000)]
subdirmk: break out subdirmk_target in generated Makefile

We are going to want to reuse this.  Make it a simply-expanded make
variable rather than a perl variable, so that it only gets computed
once.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
5 months agosubdirmk: stub Makefiles: filter out `all'
Ian Jackson [Tue, 3 Dec 2019 23:07:00 +0000 (23:07 +0000)]
subdirmk: stub Makefiles: filter out `all'

Otherwise `make all' generates this:
  Makefile:3: target 'all' given more than once in the same rule
which is harmless but mildly irritating.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agosubdirmk: clean.sd.mk: Delete .*~ too (eg .gitignore~) subdirmk/0.1
Ian Jackson [Sun, 24 Nov 2019 22:45:07 +0000 (22:45 +0000)]
subdirmk: clean.sd.mk: Delete .*~ too (eg .gitignore~)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agosubdirmk: cdeps.sd.mk: Honour &CDEPS_OBJECTS
Ian Jackson [Sun, 24 Nov 2019 22:44:36 +0000 (22:44 +0000)]
subdirmk: cdeps.sd.mk: Honour &CDEPS_OBJECTS

This makes this facility more flexible.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agosubdirmk: Fix bug in regen.mk.in
Ian Jackson [Sat, 23 Nov 2019 18:42:31 +0000 (18:42 +0000)]
subdirmk: Fix bug in regen.mk.in

Apparently, if you just write `;', make knows that the command can't
have done anything.  It therefore concludes tha the target file cannot
have been updated and doesn't bother rereading it.

The result is that you end up using last run's makefiles.

Writing @: fixes this.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agosubdirmk: Change stub force target to `run-main.mk'
Ian Jackson [Sun, 17 Nov 2019 01:26:26 +0000 (01:26 +0000)]
subdirmk: Change stub force target to `run-main.mk'

This produces significantly better error messages:
  [some error from actual makefiles]
  make[1]: Leaving directory '/home/ian/wherever'
  Makefile:6: recipe for target 'run-main.mk' failed

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agosubdirmk: Fix bug when target in subdir exists
Ian Jackson [Sun, 17 Nov 2019 01:21:51 +0000 (01:21 +0000)]
subdirmk: Fix bug when target in subdir exists

If you try to make a file that exists, the % rule doesn't seem to
match.  But providing the dependency for all of $(MAKCMDGOALS)
works.

We have to mention `all' explicitly because it might not appear in
$(MAKECMDGOALS).

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agoDocs: Fix some leftover ; and ,
Ian Jackson [Thu, 14 Nov 2019 20:23:27 +0000 (20:23 +0000)]
Docs: Fix some leftover ; and ,

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agosubdirmk: Docs, go back to ^ and ~
Ian Jackson [Thu, 14 Nov 2019 19:45:50 +0000 (19:45 +0000)]
subdirmk: Docs, go back to ^ and ~

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agosubdirmk: Go back to ^ and ~
Ian Jackson [Thu, 14 Nov 2019 19:40:59 +0000 (19:40 +0000)]
subdirmk: Go back to ^ and ~

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agosubdirmk: Implement new syntax
Ian Jackson [Thu, 14 Nov 2019 19:36:39 +0000 (19:36 +0000)]
subdirmk: Implement new syntax

But I plan to go back to ^ and ~

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agodocs: Discuss variable settings and inclusion order
Ian Jackson [Thu, 14 Nov 2019 15:43:14 +0000 (15:43 +0000)]
docs: Discuss variable settings and inclusion order

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agosubdirmk: Actually clear right variable
Ian Jackson [Thu, 14 Nov 2019 15:42:19 +0000 (15:42 +0000)]
subdirmk: Actually clear right variable

"subdirmk: main.mk: clear SUBDIRMK_MAKEFILES MAKEFILE_TEMPLATES"
cleared MAKEFILES by mistake (this was a rebase transposition error -
this commit originally came before "subdirmk: Rename MAKEFILES
variable".

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agodocs: Abolish all absolute pathname syntaxes
Ian Jackson [Thu, 14 Nov 2019 14:54:48 +0000 (14:54 +0000)]
docs: Abolish all absolute pathname syntaxes

These are rare and make things much more confusing.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agodocs: Improve docs.
Ian Jackson [Thu, 14 Nov 2019 14:26:12 +0000 (14:26 +0000)]
docs: Improve docs.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agodocs: Fill in an empty cell with a copy instead
Ian Jackson [Thu, 14 Nov 2019 14:25:51 +0000 (14:25 +0000)]
docs: Fill in an empty cell with a copy instead

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agodocs: Transpose columns in path syntax reference
Ian Jackson [Thu, 14 Nov 2019 14:15:48 +0000 (14:15 +0000)]
docs: Transpose columns in path syntax reference

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agodocs: Change . to require rather than imply @
Ian Jackson [Thu, 14 Nov 2019 14:13:44 +0000 (14:13 +0000)]
docs: Change . to require rather than imply @

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agodocs: Further corresponding new syntax
Ian Jackson [Thu, 14 Nov 2019 14:03:18 +0000 (14:03 +0000)]
docs: Further corresponding new syntax

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agodocs: wip new syntax
Ian Jackson [Thu, 14 Nov 2019 13:56:19 +0000 (13:56 +0000)]
docs: wip new syntax

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agodocs: Swap rows in syntax table
Ian Jackson [Thu, 14 Nov 2019 13:33:26 +0000 (13:33 +0000)]
docs: Swap rows in syntax table

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agodocs: New plan for directory references, further
Ian Jackson [Thu, 14 Nov 2019 13:33:19 +0000 (13:33 +0000)]
docs: New plan for directory references, further

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agodocs: New plan for directory references, new
Ian Jackson [Thu, 14 Nov 2019 13:30:44 +0000 (13:30 +0000)]
docs: New plan for directory references, new

Not yet implemented.  About to simplify this...

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agodocs: New plan for directory references
Ian Jackson [Thu, 14 Nov 2019 12:59:30 +0000 (12:59 +0000)]
docs: New plan for directory references

Not yet implemented.  About to simplify this...

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agodocs: Summarise directory reference syntaxes, permute
Ian Jackson [Thu, 14 Nov 2019 12:39:00 +0000 (12:39 +0000)]
docs: Summarise directory reference syntaxes, permute

Just permute the columns which seems to be clearer.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agodocs: Summarise directory reference syntaxes
Ian Jackson [Thu, 14 Nov 2019 12:36:23 +0000 (12:36 +0000)]
docs: Summarise directory reference syntaxes

This reveals it to be a bit of a mess.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agoClarify incremental paragraph
Ian Jackson [Thu, 14 Nov 2019 02:06:16 +0000 (02:06 +0000)]
Clarify incremental paragraph

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agoClarify race lossage paragraph
Ian Jackson [Thu, 14 Nov 2019 02:05:11 +0000 (02:05 +0000)]
Clarify race lossage paragraph

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agoSome hints in docs
Ian Jackson [Thu, 14 Nov 2019 02:03:45 +0000 (02:03 +0000)]
Some hints in docs

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agosubdirmk: main.mk: clear SUBDIRMK_MAKEFILES MAKEFILE_TEMPLATES
Ian Jackson [Thu, 14 Nov 2019 00:00:11 +0000 (00:00 +0000)]
subdirmk: main.mk: clear SUBDIRMK_MAKEFILES MAKEFILE_TEMPLATES

Otherwise, if we reenter main.mk (for exmaple, there are some reasons
why one might want to $(MAKE) a particular target), and someone
foolishly said `export', we inherit SUBDIRMK_MAKEFILES from our
previous self and end up reading everything twice.  That causes things
not to work very well.

While we're here, clear MAKEFILE_TEMPLATES too.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agosubdirmk: Rename MAKEFILES variable
Ian Jackson [Thu, 14 Nov 2019 00:20:07 +0000 (00:20 +0000)]
subdirmk: Rename MAKEFILES variable

This is very magic to make and the behaviour is very undesirable.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agosubdirmk: Honour CONFIG_STATUS_OUTPUTS
Ian Jackson [Thu, 14 Nov 2019 00:13:24 +0000 (00:13 +0000)]
subdirmk: Honour CONFIG_STATUS_OUTPUTS

Principally to support autoheader.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agosubdirmk: Make \& work (!)
Ian Jackson [Thu, 14 Nov 2019 00:00:02 +0000 (00:00 +0000)]
subdirmk: Make \& work (!)

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agoTwo minor docs fixes
Ian Jackson [Wed, 13 Nov 2019 23:03:55 +0000 (23:03 +0000)]
Two minor docs fixes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agoDrop AC_PROG_INSTALL and remove build-aux/install-sh from example
Ian Jackson [Wed, 13 Nov 2019 22:58:03 +0000 (22:58 +0000)]
Drop AC_PROG_INSTALL and remove build-aux/install-sh from example

This is just deadweight.  It's rather poor practice too.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agotest regeneration after a -included .in file changes
Ian Jackson [Wed, 13 Nov 2019 22:56:45 +0000 (22:56 +0000)]
test regeneration after a -included .in file changes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agotest regeneration after a &:-included file (ie a .sd.mk) changes
Ian Jackson [Wed, 13 Nov 2019 22:47:24 +0000 (22:47 +0000)]
test regeneration after a &:-included file (ie a .sd.mk) changes

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agoTests: use set -x
Ian Jackson [Wed, 13 Nov 2019 22:47:13 +0000 (22:47 +0000)]
Tests: use set -x

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agoFix docs typo
Ian Jackson [Wed, 13 Nov 2019 22:38:36 +0000 (22:38 +0000)]
Fix docs typo

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agotests/check: New test script, quite basic
Ian Jackson [Wed, 13 Nov 2019 22:38:23 +0000 (22:38 +0000)]
tests/check: New test script, quite basic

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agoTranspose directories
Ian Jackson [Wed, 13 Nov 2019 22:31:43 +0000 (22:31 +0000)]
Transpose directories

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agoDocumentation for regen.mk
Ian Jackson [Wed, 13 Nov 2019 22:26:50 +0000 (22:26 +0000)]
Documentation for regen.mk

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agorealclean: Use @_SUBDIRMK_MAKEFILES@
Ian Jackson [Wed, 13 Nov 2019 22:26:34 +0000 (22:26 +0000)]
realclean: Use @_SUBDIRMK_MAKEFILES@

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agoDrop Perdir.sd.mk from explicit MAKEFILE_TEMPLATES
Ian Jackson [Wed, 13 Nov 2019 22:25:46 +0000 (22:25 +0000)]
Drop Perdir.sd.mk from explicit MAKEFILE_TEMPLATES

generate does this itself now.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agoDocumentation for usual.mk.in
Ian Jackson [Wed, 13 Nov 2019 22:14:48 +0000 (22:14 +0000)]
Documentation for usual.mk.in

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agoDocumentation for clean.sd.mk and cdeps.sd.mk
Ian Jackson [Wed, 13 Nov 2019 22:12:10 +0000 (22:12 +0000)]
Documentation for clean.sd.mk and cdeps.sd.mk

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agoMove knowledge of DEPFILES into cdeps.sd.mk
Ian Jackson [Wed, 13 Nov 2019 22:11:47 +0000 (22:11 +0000)]
Move knowledge of DEPFILES into cdeps.sd.mk

No overall functional change.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agoIntroduce CDEPS_CFLAGS so without cdeps.sd.mk you don't get .*.d
Ian Jackson [Wed, 13 Nov 2019 22:04:32 +0000 (22:04 +0000)]
Introduce CDEPS_CFLAGS so without cdeps.sd.mk you don't get .*.d

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agoNew &# feature
Ian Jackson [Wed, 13 Nov 2019 22:03:57 +0000 (22:03 +0000)]
New &# feature

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agoMore docs updates
Ian Jackson [Wed, 13 Nov 2019 22:02:55 +0000 (22:02 +0000)]
More docs updates

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
6 months agoMerge branch 'master' of https://git.distorted.org.uk/~markw/subdirmk
Ian Jackson [Wed, 13 Nov 2019 21:42:10 +0000 (21:42 +0000)]
Merge branch 'master' of https://git.distorted.org.uk/~markw/subdirmk

6 months agosubdirmk/*: Some simple whitespace cleanups
Mark Wooding [Wed, 13 Nov 2019 19:17:40 +0000 (19:17 +0000)]
subdirmk/*: Some simple whitespace cleanups

Zap trailing whitespace, and spaces-followed-by-tabs.  This commit is
empty in `git show -b'.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
6 months agosubdirmk/generate: Make `FORCE-ALWAYS-RUN' be `.PHONY'
Mark Wooding [Wed, 13 Nov 2019 19:24:41 +0000 (19:24 +0000)]
subdirmk/generate: Make `FORCE-ALWAYS-RUN' be `.PHONY'

Otherwise `touch FORCE-ALWAYS-RUN' stops your build from working, which
seems a shame, even though nobody should ever want to do this.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>
6 months agosubdirmk/usual.mk.in: Fix `VPATH' setting
Mark Wooding [Wed, 13 Nov 2019 19:08:46 +0000 (19:08 +0000)]
subdirmk/usual.mk.in: Fix `VPATH' setting

This file isn't processed through `generate', so `&' doesn't mean
anything special.

Use `$(top_srcdir)' here because we can rely on that being established
by `main.mk'.

Signed-off-by: Mark Wooding <mdw@distorted.org.uk>