- ln -sf ccache $(ROOT)/usr/local/bin/gcc
- ln -sf ccache $(ROOT)/usr/local/bin/g++
- ln -sf ccache $(ROOT)/usr/local/bin/cc
- $(ROOT)/usr/local/bin/ccache -z
+
+ifeq "$(TOOLCHAIN)" "1"
+ ifeq "$(PASS)" "1"
+ mkdir -pv $(TOOLS_DIR)/ccache/bin
+ ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/gcc
+ ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/g++
+ ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/cc
+ ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/c++
+ ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/$(CROSSTARGET)-gcc
+ ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/$(CROSSTARGET)-g++
+ ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/$(CROSSTARGET)-cc
+ ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/$(CROSSTARGET)-c++
+ endif
+
+ ifeq "$(PASS)" "2"
+ ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/$(BUILDTARGET)-gcc
+ ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/$(BUILDTARGET)-g++
+ ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/$(BUILDTARGET)-cc
+ ln -svf ../../bin/ccache $(TOOLS_DIR)/ccache/bin/$(BUILDTARGET)-c++
+ endif
+endif
+