WhyTools Build Environment
One annoying part of writing and maintaining a large-scale software project with dozens of classes, source files, C++ templates and other resources is to maintain a makefile that automates the rebuilding process and cuts down turnaround times during development by only recompiling those sources that have been changed, or that depend on sources that have been changed. Many other demands on the software creation process, such as maintaining differently built versions of object files at the same time, production of debug and release versions, management of external software packages that are to be linked into a project, support for development under different operating systems or compiler environments, etc., can turn the seemingly simple task of creating and maintaining a proper makefile into a nightmare. While very simple makefiles might waste time due to unnecessary compilation, not perfectly maintained complex makefiles might be dangerous by not updating object files on a source code change and thus introducing spurious errors into a project (the infamous "make clean" problem).
Project Goals
The main goals in developing WhyTools were to create a build environment with a mostly templatized makefile, such that most intelligence and wizardry is stored in a central project-independent place, and that project-specific makefiles are as short and simple as possible without sacrificing efficiency during the development process. The WhyTools environment offers the following functionality:
- Support for multiple operating systems and compilers from the same home directory.
- Support for multiple object file versions in the same project directory.
- Fully automatic source code dependency generation and maintenance (no "make depend" necessary).
- Support for project directories with subdirectories.
- Support automatic inclusion of external software packages that require setting up include paths, library search paths and lists of included libraries to work.
- Definable destination directories for depedency files, object files, libraries, and executables to eliminate clutter inside a project directory.
- Simplicity. Although the WhyTools build environment offers quite advanced functionality, using it in a project is as simple as copying a template makefile into the project's root directory, setting some parameters such as compiler and linker flags, and typing "make."
- Project-specific makefiles usually only contain settings for compiler and linker flags, the list of external software packages referenced by a project, and targets to build a project's executables and/or dynamic shared libraries. The makefile for real projects can be as short as 10-20 lines plus the boilerplate copied from the template makefile.
- Based solely on GNU make, sed, and find.
Why WhyTools?
Why not WhyTools?
Project Status
The current version of the WhyTools build environment can be downloaded from the download page. The following list of missing features will be addressed in the future, as time allows:
- Recursive expansion of software package dependencies is not truly recursive; it is currently limited to nine levels of dependencies.
- The command sequences to compile C/C++ sources and to link object files into a single executable should be moved from BasicMakefile to SystemDefinitions, since they might need to be adapted based on the operating system/compiler suite.
- Due to a bug in make(?), canned command sequences do not allow to suppress echoing of selected lines in a command sequence. This is highly annoying; need to find a workaround.
- Support for "targetless" projects currently not included. I imagine providing a default target "Main" that would be linked by including all source files found in the project directory and all its subdirectories. This requires some find/sed magic.
- At this point, one still needs to issue a "make clean" when parameters in the makefile are changed, e.g., when a definition is added to the CFLAGS variable. It would be nice to make targets depend on makefile variables as well, in some automatic way. In other words, change a parameter, and make will automatically recompile all sources that reference that variable.
Pages In This Section
- Tutorial
- A brief (and somewhat hyperbolic) tutorial on why you absolutely need the WhyTools build environment, and how to get it up and running in no time.
- Documentation
- Detailed documentation of the settings that might need to be adjusted to install the WhyTools build environment on a user's account, and a list of parameters that can be adjusted for individual projects.
- Download
- Download page for all files necessary to install and use the WhyTools build environment.