Makefile with Clang


I would like to compile applications which consists of multiple source files (for example, file1.c file2.c, main.c) with Clang using Makefile to get the LLVM bitcode file. Anyone knows how to do that? Thanks.

With regards
Yan Lin

Try the following:
make CC="clang -emit-llvm"


You mean you want one bitcode file for each C source file or you would like to have a whole program bitcode file?

2010/4/20 Yan Lin Aung <>

Actually, we have been working on this way, the key to acquire the bitcode file is to write a “dummy_gcc” which can call cc &llvm-ld to finish the compiling procedure, since the llvm-gcc cannot invoke llvm-ld to generate LLVM bitcode files for you automatically

2010/4/20 Yan Lin Aung <>