Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compiling clang-llvm examples

Tags:

c++

c

llvm

clang

I am trying to compile the Hello example in directory lib/Transforms/Hello, which is basically a Hello World of LLVM pass, but I get the following error when I try to compile it using make.

../../../Makefile.common:61: ../../../Makefile.config: No such file or directory
../../../Makefile.common:69: /Makefile.rules: No such file or directory
make: *** No rule to make target `/Makefile.rules'.  Stop.

Any idea what is the problem and how to fix it?

like image 520
MetallicPriest Avatar asked Oct 08 '22 18:10

MetallicPriest


1 Answers

If you built LLVM + Clang according to instructions, the Hello sample should have already been built. Go to lib/Transforms/Hello in the build directory (where you ran configure and then make). There should be a Debug+Asserts (or whatever configuration you compiled) there. And you can also run make from there again.

In general, you always make from the build directory, not the source directory. The build directory has all the Makefiles properly set up.

like image 107
Eli Bendersky Avatar answered Oct 12 '22 22:10

Eli Bendersky