I want to use llvm to compile px4 as ir and then instrument it, how do I compile px4?

hello,Now px4 is using ninja for automated compilation, and I am a novice compiler ninja is very new to me, for I don’t know how to generate llvm ir for me to instrument px4’s source code and then link them as an executable. Can anyone tell how to do it?