How to build the 'example' projects ?

Hello,
I'm not very familiar with the autotools, so please bear with this
message if the solution is too obvious.
I am using 64 bit Linux and gcc 4.7.1.
I just built llvm and clang from the trunk and as the binaries
installed in /usr/local/bin seem to be working correctly, I guess the
compilation has gone okay.

Note that, at this point, I'm not trying to make a separate project,
which is all what the documentation seems to focus upon .
I am trying to correctly build the programs in the llvm/examples
directory and can't find how to.
The examples directory contain a CMakeLists.txt, so I tried cmake,
giving the error:
# Unknown CMake command "add_llvm_example".
Also, each individial sub folder has a Makefile, running which gives,
for example:
"
[manasij7479@manasijd HowToUseJIT]$ make
../../Makefile.common:60: ../../Makefile.config: No such file or directory
../../Makefile.common:68: /Makefile.rules: No such file or directory
make: *** No rule to make target `/Makefile.rules'. Stop.
"
I tried copying individial projects to the llvm/projects directory and
follow the instructions in http://llvm.org/docs/Projects.html only to
get the exact same errors.
It'd be great if anyone could assist me or point me to a documentation
which gives some instructions.

Manasij Mukherjee

Hi Manasij,

  Try below after installing LLVM,

  $ cd $LLVM_SRC/examples
  $ make; make install

Regards,
chenwj

  Try below after installing LLVM,

  $ cd $LLVM_SRC/examples
  $ make; make install

Same problem as before.
"
Makefile:11: ../Makefile.config: No such file or directory
../Makefile.common:60: ../Makefile.config: No such file or directory
../Makefile.common:68: /Makefile.rules: No such file or directory
make: *** No rule to make target `/Makefile.rules'. Stop.
"
Did that work for you ?
I updated the source tree just now, so my local repo isn't out of order.
Manasij Mukherjee

Same problem as before.
"
Makefile:11: ../Makefile.config: No such file or directory
../Makefile.common:60: ../Makefile.config: No such file or directory
../Makefile.common:68: /Makefile.rules: No such file or directory
make: *** No rule to make target `/Makefile.rules'. Stop.
"
Did that work for you ?
I updated the source tree just now, so my local repo isn't out of order.

  Sorry. Try below instead,

  $ cd $LLVM_BUILD/examples
  $ make; make install

  You should find example binary in your install directory. I tried LLVM
3.1 release, but I think trunk should not have problem.

Regards,
chenwj

Thanks.
Can't believe that I messed that up !

I had always 'clumsily' built in the source directory itself for my
own pet projects, so forgot that there was actually a build directory,
duh.