$ make -j8 CC=distcc
2. USING DISTCC WITH CCACHE
ccache is a program that speeds software builds by caching the results of compilations. ccache is normally called before distcc, so
that results are retrieved from a normal cache. Some experimentation may be required for idiosyncratic makefiles to make everything
work together.
The most reliable method is to set
CCACHE_PREFIX="distcc"
This tells ccache to run distcc as a wrapper around the real compiler. ccache still uses the real compiler to detect compiler
upgrades.
ccache can then be run using either a masquerade directory or by setting
CC="ccache gcc"
As of version 2.2, ccache does not cache compilation from preprocessed source and so will never get a cache hit if it is run from
distccd or distcc. It must be run only on the client side and before distcc to be any use.
distcc's pump mode is not compatible with ccache.
3. 设置:
# 除了正在使用的 gcc 的版本,机器上通常不需要其他任何公用的东西
# 告诉 distcc 它可以使用哪些机器
vi /etc/distcc/hosts
localhost/3 192.168.23.38/3
export DISTCC_HOSTS="localhost 192.168.23.38"
或者export DISTCC_HOSTS="localhost 192.168.23.13"
# avoid blocked
distccd --daemon --allow 192.168.23.13 --allow 192.168.23.38
/etc/init.d/distccd start
make -j8 CC=distcc
参照连接:
http://www.ibm.com/developerworks/cn/linux/l-distcc/
http://www.doc88.com/p-67911619568.html
http://code.google.com/p/distcc/