A build system generates targets from raw source code that can be used by an end user. These targets may be in the form of libraries, executable programs, generated scripts, exported interfaces (e.g. C++ header files) or anything else that is not static code. Often, the source code is organized into packages where each package typically consists of one or more targets when built.1)
In general, build automation is the act of scripting or automating a wide variety of tasks that software developers do in their day-to-day activities including things like: compiling computer source code into binary code, packaging binary code, running tests, deploying to production systems, as well as creating documentation and/or release notes.2)
Popular build systems that are used widely in software development are GNU Make, GNU Autotools, and CMake. In addition, virtually all integrated development environments (IDEs) such as
Eclipse add their own build system configuration tools for the respective languages they support. Often the build systems in these IDEs are just front ends for console-based build systems such as
To build targets, the build system needs information such as the locations of tool chain components (e.g. C++ compiler), source code locations, code dependencies, external dependencies, where those dependencies are located, which targets should be built, where targets should be built, and where they should be installed. This is typically expressed in some set of configuration files read by the build system. In an IDE, this information is typically stored as part of the workspace/project meta-information. With CMake, it is specified in a file typically called
CMakeLists.txt and with GNU Make it is within a file typically called
Makefile. The build system utilizes this information to process and build source code in the appropriate order to generate targets.