compiling clang with a obj/ dir

I can compile LLVM using with this method:

svn co ...
cd llvm
./configure ...
make

or with that one:

svn co ...
mkdir obj
cd obj
../llvm/configure ...
make

How does the second method work with the new, experimental C
compiler, "clang" ? The doc said that you put the clang sourcecode
into llvm/tools/clang, change into this directory and simply
enter "make". This seems to be not possible with the second method, at
least not in a way that separates sources and binaries.

It should work, but I've never tried it. I'm a srcdir=objdir kind of person :).

One thing to try: after checking out clang into tools, add clang to the llvm/tools/Makefile line. Then do a 'make' in your tools objdir. It should just make the directories in the objdir and build like normal.

-Chris

I can compile LLVM using with this method:

svn co ...
cd llvm
./configure ...
make

or with that one:

svn co ...
mkdir obj
cd obj
../llvm/configure ...
make

How does the second method work with the new, experimental C
compiler, "clang" ? The doc said that you put the clang sourcecode
into llvm/tools/clang, change into this directory and simply
enter "make". This seems to be not possible with the second method, at
least not in a way that separates sources and binaries.

It should work, but I've never tried it. I'm a srcdir=objdir kind of
person :).

srcdir != objdir is the One True Way! :slight_smile:

One thing to try: after checking out clang into tools, add clang to the
llvm/tools/Makefile line. Then do a 'make' in your tools objdir. It
should just make the directories in the objdir and build like normal.

I put my clang source tree in llvm/projects and it does just fine (doing a "make" from the top directory).

-bw