How is ccache useful when we use make in the first place?

117 views
Skip to first unread message

Alex Mayle

unread,
Jun 16, 2016, 8:33:45 PM6/16/16
to Android Building
I haven't used 'make' extensively until I started tinkering with the AOSP, but isn't the whole point of it to avoid compiling things that don't need to be recompiled? If a file and its dependencies haven't changed since the last compilation, then there is no point in compiling it again. 

If the file doesn't need to be recompiled, we don't need ccache. If the file does need to be recompiled, then ccache only has an outdated version.

Does it take advantage of the fact that a large, edited source file may have only been changed slightly?

Xin Li

unread,
Jun 17, 2016, 1:18:41 PM6/17/16
to Android Building
 You can also benefit from it if you are building multiple branches or directories (assuming the C/C++ files they share, after pre-processing were the same).  If you work only on one tree it's probably not very helpful.

Peter Kalauskas

unread,
Jun 17, 2016, 2:06:03 PM6/17/16
to android-...@googlegroups.com
It's a cache of the compiled objects. Compiling the source files takes some time, and it's faster to pull the results out of a cache.

For instance, if you 'touch main.c' and then run make (without ccache) it will compile the file again. Even if you didn't change the file, 'make' doesn't know better; it only cares about the timestamp. But if you were to use ccache, it would see that it's already compiled main.c and pull the result out of the cache.

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alex Mayle

unread,
Jun 18, 2016, 9:10:39 PM6/18/16
to Android Building
I see. Thank you for the clarification. 
Reply all
Reply to author
Forward
0 new messages