This is your primary source regarding how to build fpc from source (its customization, etc.), while
this talks about the compiler architecture. The latter is incomplete and might not be up to date, primarily since the introduction of JVM target, which serves as a testbed for code generator split, high level (targets another abstract machine language) and low level (targets real machine code). Otherwise, as far as I can see it is align with the code.