I maintain a "master" makefile for a project with many submodules, each of which has its own autotools structure. This project is tested in a number of configurations (e.g. built against different-version backends) and can be built on different platforms/architectures using the same home directory over NFS or with cross-compilers. All this is handled by taking the current source checkout (git repo clone) workspace, "cloning(*)" the source to a separate directory for current build setup and configureing/autogening that clone of sources (so not polluting original checkout), and finally building it out-of-tree as nicely supported by autotools.

The "(*)cloning" part is implemented in a number of ways, such as cp/tar copying of original workspace to the "source clone", or by making a directory structure in the clone populated with relative symlinks to original files in the main workspace. And here be dragons :)

The source clone populated by natural files is self-sufficient and passes automake jobs nicely, and in particular the dist (and distcheck) ones - unlike the "symlink clone" where make dist apparently tarballs the relative symlinks "as is" so after un-tarring they point nowhere meaningful.

The upside of symlinks is that a developer can edit files in the workspace and rebuild all platforms in one spell, without committing them to git etc. - speeding up the dev iteration cycles (at least as long as new files are not added - just re-"make" of edited existing ones). It is also considerably less storage and time overhead than copying same files around many times.

So the question is: Is it possible to "make dist" a directory populated by relative symlinks to original sources? Perhaps some "dist hook" or other ways to override how the tarball is made? (it would be acceptable if the dist procedure creates real files in its dedicated subdirectory, by e.g. dereferencing source-dir symlinks)

Or is it just not doable and we cannot both have the cake and eat it? :)

(For reference, the "master" Makefile in question is at https://github.com/42ity/FTY/ )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.