chiark / gitweb /
build: Cope with the `subdir-objects' world Automake wants us to live in.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 15 May 2016 13:11:02 +0000 (14:11 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 16 May 2016 00:31:30 +0000 (01:31 +0100)
commitb012588c966395ea4098fab833c577c4f0851416
tree2bfb623331659001d53aabbd3c3331f5e1af288b
parentd44d862af4bbf8ad140277938d15466b68a31216
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).
configure.ac
hash/Makefile.am