build: Cope with the `subdir-objects' world Automake wants us to live in.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 15 May 2016 13:57:12 +0000 (14:57 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 16 May 2016 08:19:35 +0000 (09:19 +0100)
commitc9cfa678c1bc391d0c270df6fdab7e9d50949b1f
tree86e2e633828f8afe1f2b32c5343fbc7631e0c583
parentb760192aed74a658ebb4c613d289eea5392996bd
build: Cope with the `subdir-objects' world Automake wants us to live in.

Essentially, the Automake developers want to put the objects for
`PATH/TO/FILE.c' in `PATH/TO/FILE.o'.  This is wrongheaded, but we don't
seem to get much choice.  Unfortunately, it's also buggered.

This causes trouble for our precomputed source files.  The obvious
trouble happens if the source file we reference is explicitly in the
source tree, so we'll need to refer to the files differently in
`mumble_SOURCES' lines and the machinery which makes the generates the
files.  The obvious answer would be to introduce two variables for
referring to the precomptations tree.  This is where Automake's bugs
start to really bite.

The main problem is with Automake's automatic dependency-tracking
machinery.  For each object `FILE.o' which is going to be built, it
wants to make a `.deps/FILE.Po' file to track the detected dependencies.
Furthermore, the generated makefiles get unhappy if these files don't
already exist, so there's magic hung off the side of `config.status' to
make them.

This would be great, but the Automake machinery doesn't actually work
properly.  If you refer to a source file via a variable reference,
something like `$(things)/file.c', then Automake's `config.status' magic
creates a dependency-tracking file which is literally named
`.deps/$(things)/file.Po', and then the makefile gets upset when it
tries to include `$(things)/.deps/file.Po'.

So we have to write explicit relative paths to precomputed source file
names in `nodist_mumble_SOURCES' lists (because we make our own
arrangements for distributing them).

Even worse, in older Automake versions, the `distclean' rule prematurely
zaps the dependency-tracking files under `precomps/', so I've had to
split the precomputed sources into subdirectories for each main source
directory.

On the plus side, the `symm/' build tree is less of a mess now that all
of the boring per-mode objects are tucked away in their own
subdirectory.
configure.ac
math/Makefile.am
misc/Makefile.am
symm/Makefile.am
vars.am