Building a backend outside the LLVM source tree

I’m trying to build a backend outside the LLVM source tree. My directory structure is as follows:
llvm – the root of the LLVM source tree
llvm/lib/Target – where the standard backends are stored (Sparc, etc).
my_dir/my_backend – where I store the backend I’m writing.

I’ve been fiddeling with the variables documented in the llvm/Makefile.common (LEVEL, LLVM_SRC_ROOT, PROJ_SRC_DIR, etc) but without success. Is what I’m trying to do possible with the LLVM buildsystem? If so, how?

Thank you!

/ Torgny

You don’t need to change the makefiles. Simply update the configure script as explained here

Have your backend’s folder live in llvm/lib/Target/ with the others.