[cfe-users] Problems compiling within the clang source tree

Adrian Ortega elfus0.1 at gmail.com
Tue Feb 18 19:33:07 PST 2014


I am trying to compile the example 'clang-interpreter' from path 
'tools/clang/examples'. I copied that folder into the build-llvm folder 
I created for building llvm and clang, specifically in folder 
'tools/clang/tools/'. When I do 'make' all I get is

make: *** No rule to make target 
`/home/blah/llvm/tools/clang/tools/clang-interpreter/Makefile', needed 
by `Makefile'.  Stop.

I thought that my build was broken, but it was not. I tried downloading 
this example https://github.com/kevinaboos/LibToolingExample and placed 
it under the same 'tools/clang/tools/' folder as the clang interpreter. 
When I did 'make' it just compiled, created the Debug+Asserts folder in 
'tools/clang/tools/LibToolingExample/Debug+Asserts/' and placed the 
binary under the '$LLVM_ROOT/Debug+Asserts/bin/' folder, and it works fine.

I tried copying the makefile from that LibToolingExample and changed 
only the name of source file to be compiled, it didn't work, I get the 
same error I described above.

 From this I can tell that I'm doing something wrong as I don't fully 
understand the llvm-clang build system yet, I was able to compile an 
example but not the example provided in clang directory. Do you have any 
idea on what the problem is? Or do you have a hint of what Makefile or 
Documentation I should read to solve this?


P.D. I am able to able to compile the clang examples out of the 
llvm-clang source tree by providing the correct compiler flags, but I'd 
like to use the llvm-clang build system :)

More information about the cfe-users mailing list