Hacking the LRocket Compiler
lrc supports different ways to be extended.
This page gives an overview over the different ways of extending the compiler functionality and references pages that go into detail on each type of extension.
Overview
As of lrc v1.2 there are four standartized types of extensions for the compiler:
otype
An otype describes how a concrete thing is built (e.g. a PC executable, a shared library or an Android application). If you want to define your own otype, see Writing an otype.
Toolchain
A toolchain tells lrc how to configure the underlying C compiler for a specific target platform. This could be an excentric CPU architecture or an operating system/execution environemnt which requires extra processing (such as e.g. WebAssembly).
For details on this type of compiler extension, see Writing a Toolchain.
Target Rule
Target rules are triggers that are activated when the user builds for a specific operating system, architecture or ABI.
They are useful to select the correct toolchain automatically, when it is implicitly needed (e.g. the android-toolchain when the target OS is android-).
To see how to write your own target rule, see Target Rules.
Language Extension
lrc can even be extended to support new languages (yes, that is other than Lua)!
An example for a language extension is lrcs integrated Teal support.
If you want to extend lrc with support for a new language, see Writing a Language Extension.