move ccache to tools/ and fix potential dependency issue