Building
Anjuta handles autotools projects. It is able to cope with other kinds of projects, such as projects using a user-written Makefile, but the current build interface is targeted at autotools projects. Some knowledge of them is useful to better understand the way a project is built.
An autotools project is built in three steps:
- Generate
- Configure
- Build
Build is the main step in which all target files are generated from the source files. It can be divided into two subphases: Compile and Link. In the Compile phase each object file is generated from its corresponding source file. For instance, a source file hello.c will generate hello.o after compilation. Usually you do not need to worry about these object files — just think of them as intermediate files. In the Link phase, all object files and libraries are linked together to create the final executable. Some programming languages do not need a Compile and a Link phase. Moreover the Build step may be used to generate other files, like documentation which doesn't need such phases.
Configure is the step in which the source tree is adjusted to your system. autotools projects can be built on a wide range of systems using different compilers and having different library functions. This step runs a script named configure that will check for various characteristics of your system and create some of the files required to perform a build (such as Makefile and config.h). This step is used to select build options, too; for instance, a build option may disable optimization to make debugging easier or disable some experimental part of a program.
Generate is the step in which the configure script and other related files are created. The configure script used above needs to run on various systems and checks a lot of things. It would be quite difficult to write it by hand. Moreover autotools enforces some project organization rules such as the presence of some mandatory files: NEWS and COPYING, for example. It includes several tools to create necessary files from simpler files written by the developer such as configure.in (or configure.ac) and Makefile.am. All these tools are commonly run from a script named autogen.sh in the project directory. This step is useful only for a developer (someone modifying the source files), as the configure script depends only on the source files, and is distributed within the project package. Note that the makefiles created by configure include some rules to automatically regenerate the project when needed, so it often not needed to rerun it directly.
Read the info pages of automake and autoconf for more details on how these tools work.
- 5.1. Generate and Configure
- 5.2. Compile and Build
- 5.3. Other operations
