[cfe-dev] make target for clang

Jordan Rose jordan_rose at apple.com
Wed Jul 11 08:56:54 PDT 2012


On Jul 11, 2012, at 7:37 AM, Jean-Daniel Dupas wrote:

> 
> Le 11 juil. 2012 à 16:22, Thiago Farina <tfarina at chromium.org> a écrit :
> 
>> On Wed, Jul 11, 2012 at 11:18 AM, Jiangning Liu <liujiangning1 at gmail.com> wrote:
>>> Thiago,
>>> 
>>> I think clang is naturally retarget-able to a lot of targets simultaneously. If you don't add build target, you would be able to get a bunch of targets build, which means you can use clang command line option "-target xxx" to generate code for different targets, but with the same clang binary!
>>> 
>>> You can also specify a particular target to build on command line. If you use cmake to build, for example, you can use '-DLLVM_TARGETS_TO_BUILD="ARM"' to build arm target. If you just use make, you can use target triple like "arm-pc-linux-gnueabi".
>>> 
>> Oh, sorry for not being clearer. :(
>> 
>> What I meant is when compiling clang from source.
>> 
>> I just want to compile clang, not the tests and the other tools (my
>> system is slow unfortunately).
>> 
>> So instead of just saying:
>> 
>> $ make
>> 
>> I want to say:
>> 
>> $ make clang # or whatever that target to compile just clang is.
> 
> 
> There is a clang-only target that may reduce the number of item build, but clang has a lot of dependencies, so I'm not sure it will reduce compile time significantly.
> 
> You can also disable features you don't need too at configuration time. And make sure you compile only the backend you need (usually --enable-targets=host ).
> 
> -- Jean-Daniel


Actually, clang-only hasn't done anything (for quite a while, I believe). ;-)

> clang-only: all
> tools-only: all
> libs-only: all
> install-clang: install
> install-libs: install

But cutting targets can definitely speed up compile time, as well as only compiling from the clang directory (or Csaba's clang/tools/driver advice).

Jordan
> 




More information about the cfe-dev mailing list