With help from Steven Ellis, I’ve started switching from GNU Make to SCons. SCons determines dependencies automatically, eliminating the stuff in the Makefile that generated .d files using gcc and sed. It also knows that every target depends on the command line used to generate it, so if you change build flags you don’t have to manually do a make clean. SCons is better than make at dealing with object files being placed in separate directories from sources, and at having multiple builds using different compilers or compiler options.
The SConstruct and SConscript files are much simpler than the Makefile they replace. The only drawbacks I see are:
- Anyone building Nonpareil will have to have Python and SCons installed. I don’t think this should be too much of a burden since Python should run on any platform that can run Nonpareil, and SCons is trivial to install.
- I don’t know SCons and Python very well, so I haven’t yet figured out how to write a proper SCons “Builder” to generate .obj and .lst files from .asm by invoking my assembler, and with a dependency on the assembler since it is also built as part of Nonpareil. I also haven’t figured out how to write a rule to build the distribution tarball.