2 // vim: set syntax=asciidoc:
5 ==== Using +ccache+ in Buildroot
7 http://ccache.samba.org[ccache] is a compiler cache. It stores the
8 object files resulting from each compilation process, and is able to
9 skip future compilation of the same source file (with same compiler
10 and same arguments) by using the pre-existing object files. When doing
11 almost identical builds from scratch a number of times, it can nicely
12 speed up the build process.
14 +ccache+ support is integrated in Buildroot. You just have to enable
15 +Enable compiler cache+ in +Build options+. This will automatically
16 build +ccache+ and use it for every host and target compilation.
18 The cache is located in +$HOME/.buildroot-ccache+. It is stored
19 outside of Buildroot output directory so that it can be shared by
20 separate Buildroot builds. If you want to get rid of the cache, simply
21 remove this directory.
23 You can get statistics on the cache (its size, number of hits,
24 misses, etc.) by running +make ccache-stats+.
26 The make target +ccache-options+ and the +CCACHE_OPTIONS+ variable
27 provide more generic access to the ccache. For example
30 # set cache limit size
31 make CCACHE_OPTIONS="--max-size=5G" ccache-options
33 # zero statistics counters
34 make CCACHE_OPTIONS="--zero-stats" ccache-options