In the last article we learnt how to set up Geany for compiling your Vala applications. Now we are going to see how we can create a makefile for building the entire project.
The valac "%f" command that we assigned to the Build button in the previous article works only on the current file that is open in the editor. This is enough if your project has a single .vala source file. However, most projects usually consist of multiple source files and we need a way to compile and link all those files to generate the final executable.
This is where the make utility comes into the picture. make is a classic Unix utility that is used for building executable files from source code. It reads instructions from a makefile which contains commands for building and installing the project.
Running the make command from the project directory will build the project using the commands in the makefile. It can also be used for installing and uninstalling the executable (and related files).