From: Mark Wooding Date: Sun, 15 May 2016 13:57:12 +0000 (+0100) Subject: build: Cope with the `subdir-objects' world Automake wants us to live in. X-Git-Tag: 2.2.2~11 X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb/commitdiff_plain/c9cfa678c1bc391d0c270df6fdab7e9d50949b1f?hp=c9cfa678c1bc391d0c270df6fdab7e9d50949b1f 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. ---