パッケージ化されたccacheをPATHに追加します
PATH="/usr/lib/ccache:${PATH}" make
これは用途の広い方法であり、次のようになります。
- すべてのコンパイラで同時に機能します:C、C++など。
- 可能性の
Makefile
あるように実際のセットアップにあまり依存しませんCC
ccache
あなたが何かを自動化していて、ターゲットユーザーがインストールしていない場合、人々のビルドを壊すことはありません
で言及man ccache
:
Debianシステムで2番目の方法を使用するには、PATHの前に/ usr / lib/ccacheを追加するのが最も簡単です。/ usr / lib / ccacheには、現在Debianパッケージとしてインストールされているすべてのコンパイラのシンボリックリンクが含まれています。
そして、あなたはそれを次のように確認することができます:
ls -l /usr/lib/ccache
これには、インストールされているクロスコンパイラを含む、多数の可能なGCC名が含まれています。
total 0
lrwxrwxrwx 1 root root 16 May 6 13:51 aarch64-linux-gnu-gcc -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 aarch64-linux-gnu-gcc-7 -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 Jun 23 18:25 arm-linux-gnueabi-g++ -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 Jun 23 18:25 arm-linux-gnueabi-g++-7 -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 arm-linux-gnueabi-gcc -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 arm-linux-gnueabi-gcc-7 -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 28 22:11 arm-linux-gnueabihf-gcc -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 28 22:11 arm-linux-gnueabihf-gcc-7 -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 arm-none-eabi-g++ -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 arm-none-eabi-gcc -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 arm-none-eabi-gcc-6.3.1 -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 c++ -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 c89-gcc -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 c99-gcc -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 cc -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 clang -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 clang++ -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 g++ -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 g++-5 -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 g++-6 -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 g++-7 -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 gcc -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 gcc-5 -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 gcc-6 -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 gcc-7 -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 x86_64-linux-gnu-g++ -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 x86_64-linux-gnu-g++-5 -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 x86_64-linux-gnu-g++-6 -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 x86_64-linux-gnu-g++-7 -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 x86_64-linux-gnu-gcc -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 x86_64-linux-gnu-gcc-5 -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 x86_64-linux-gnu-gcc-6 -> ../../bin/ccache
lrwxrwxrwx 1 root root 16 May 6 13:51 x86_64-linux-gnu-gcc-7 -> ../../bin/ccache
Ubuntu16.04でテスト済み。