F.3.1 Basic compilation

When compiling with make it is necessary to have the above directory structure. Compiling the compiler is achieved with the target cycle.

Under normal circumstances, recompiling the compiler is limited to the following instructions (assuming you start in directory /pp/src):

cd compiler
make cycle

This will work only if the makefile is installed correctly and if the needed tools are present in the PATH. Which tools must be installed can be found in appendix D.8.

The above instructions will do the following:

  1. Using the current compiler, the RTL is compiled in the correct directory, which is determined by the OS. e.g. under linux, the RTL is compiled in directory rtl/linux.

  2. The compiler is compiled using the newly compiled RTL. If successful, the newly compiled compiler executable is copied to a temporary executable.

  3. Using the temporary executable from the previous step, the RTL is re-compiled.

  4. Using the temporary executable and the newly compiled RTL from the last step, the compiler is compiled again.

The last two steps are repeated 3 times, until three passes have been made or until the generated compiler binary is equal to the binary it was compiled with. This process ensures that the compiler binary is correct.