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):
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 E.
The above instructions will do the following:
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.
Compiling for another target: When compiling the compiler for another target, it is necessary to specify the OS_TARGET makefile variable. It can be set to the following values: win32, go32v2, os2 and linux. As an example, cross-compilation for the go32v2 target from the win32 target is chosen:
This will compile the go32v2 RTL, and compile a go32v2 compiler.
When compiling a new compiler and the compiler should be compiled using an existing compiled RTL, the all target must be used, and another RTL directory than the default (which is the ../rtl/$(OS_TARGET) directory) must be indicated. For instance, assuming that the compiled RTL units are in /pp/rtl/units/i386-linux, typing
should use the RTL from the /pp/rtl/units/i386-linux directory.
This will then compile the compiler using the RTL units in /pp/rtl/units/i386-linux. After this has been done, the ’make cycle’ can be used, starting with this compiler:
This will do the make cycle from above, but will start with the compiler that was generated by the make all instruction.
In all cases, many options can be passed to make to influence the compile process. In general, the makefiles add any needed compiler options to the command line, so that the RTL and compiler can be compiled. Additional options (e.g. optimization options) can be specified by passing them in OPT.