Build System Improvements
Chris & Jeremy's ideas for improvements to the k42 build system. There is also a summary of the CurrentBuildSystem.
Requirements
correct & complete dependencies
- builds often (silently!) fail due to stale deps
- too much rebuilt after a small change
get rid of SEQ=x stuff, use make-standard -j instead
- remove different targets (full_snapshot and fast_snapshot) - make should build exactly what is required for a complete compile.
use gcc -MD ?
- you might run into problems here with dependencies on generated files (eg. headers generated by the stub compiler), which aren't there when dependency generation runs. In another project I (AB) ended up writing our own dependency generator which parsed gcc -E output, and knew enough about the specific IDL compiler (eg. MetaX.H is generated in directory A by running the stub compiler over X.H somewhere else). That's pretty ugly, but the only correct alternative is to rerun stub generation on each build before generating the main dependencies.
- reduce make output
- just use linux's quiet cmd stuff (see the main Makefile)?
- single config file for paths, programs, etc
get rid of defines/ directores
- allow a single config file for compiling which can be passed around
'make check' target for testing the build environment, especially external dependencies
- eg. a missing linux source dir will cause the build to fail half-way through with no explicit error
- configurable (single!) build (output) dir, can be the same as or separate from source dir
eg. kernel output: make O=build-dir/
allows internal use of autoconf-style $objdir and $srcdir
- source dir can be read-only
separate build tools target (make tools ?)
- do we need to do so much with installed scripts?
- do we need to check tool deps on every build?
- variables for targets which handle deps automatically to facilitate development
eg. obj-stub += FRKernelPinned
- per-directory makefile fragments should be as simple as possible
- efficiency
- current system: recursive make with large amounts of rules, which need to be parsed by each invocation
A good single-level make with properly-specified dependencies is the way to go... AB suggests skim reading recursive make considered harmful.
