-$(curdir)/bison/compile := $(curdir)/flex/install
-$(curdir)/flex/compile := $(curdir)/automake/install
-$(curdir)/pkg-config/compile := $(curdir)/sed/install
-$(curdir)/libtool/compile := $(curdir)/sed/install
-$(curdir)/squashfs/compile := $(curdir)/lzma-old/install
-$(curdir)/squashfs4/compile := $(curdir)/xz/install
-$(curdir)/quilt/compile := $(curdir)/sed/install $(curdir)/autoconf/install $(curdir)/findutils/install
-$(curdir)/dtc/compile := $(curdir)/bison/install
-$(curdir)/autoconf/compile := $(curdir)/m4/install $(curdir)/libtool/install
-$(curdir)/automake/compile := $(curdir)/m4/install $(curdir)/autoconf/install $(curdir)/pkg-config/install $(curdir)/xz/install
-$(curdir)/gmp/compile := $(curdir)/automake/install
-$(curdir)/mpc/compile := $(curdir)/mpfr/install $(curdir)/gmp/install
-$(curdir)/mpfr/compile := $(curdir)/gmp/install
-$(curdir)/ppl/compile := $(curdir)/gmp/install
-$(curdir)/cloog/compile := $(curdir)/ppl/install
-$(curdir)/mtd-utils/compile := $(curdir)/e2fsprogs/install $(curdir)/xz/install
-$(curdir)/mkimage/compile := $(curdir)/sed/install
-$(curdir)/mklibs/compile := $(curdir)/automake/install
-$(curdir)/qemu/compile := $(curdir)/e2fsprogs/install
-$(curdir)/upslug2/compile := $(curdir)/automake/install
-$(curdir)/mm-macros/compile := $(curdir)/automake/install
-$(curdir)/xorg-macros/compile := $(curdir)/automake/install
-$(curdir)/xfce-macros/compile := $(curdir)/automake/install
-$(curdir)/missing-macros/compile := $(curdir)/automake/install
-$(curdir)/e2fsprogs/compile := $(curdir)/automake/install
-$(curdir)/libelf/compile := $(curdir)/automake/install
-$(curdir)/sdcc/compile := $(curdir)/bison/install
-$(curdir)/b43-tools/compile := $(curdir)/bison/install
-$(curdir)/padjffs2/compile := $(curdir)/findutils/install
-$(curdir)/cloog/compile := $(curdir)/ppl/install
-$(curdir)/bc/compile := $(curdir)/bison/install
-
-ifneq ($(CONFIG_CCACHE),)
-$(foreach tool, $(tools-y), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/install))
+$(curdir)/autoconf/compile := $(curdir)/m4/compile
+$(curdir)/automake/compile := $(curdir)/m4/compile $(curdir)/autoconf/compile $(curdir)/pkgconf/compile $(curdir)/xz/compile
+$(curdir)/b43-tools/compile := $(curdir)/bison/compile
+$(curdir)/bc/compile := $(curdir)/bison/compile $(curdir)/libtool/compile
+$(curdir)/bison/compile := $(curdir)/flex/compile
+$(curdir)/cbootimage/compile += $(curdir)/automake/compile
+$(curdir)/cmake/compile += $(curdir)/libressl/compile
+$(curdir)/dosfstools/compile := $(curdir)/autoconf/compile $(curdir)/automake/compile
+$(curdir)/e2fsprogs/compile := $(curdir)/libtool/compile
+$(curdir)/fakeroot/compile := $(curdir)/libtool/compile
+$(curdir)/findutils/compile := $(curdir)/bison/compile
+$(curdir)/firmware-utils/compile += $(curdir)/libressl/compile $(curdir)/zlib/compile
+$(curdir)/flex/compile := $(curdir)/libtool/compile
+$(curdir)/gengetopt/compile := $(curdir)/libtool/compile
+$(curdir)/gmp/compile := $(curdir)/libtool/compile
+$(curdir)/isl/compile := $(curdir)/gmp/compile
+$(curdir)/libressl/compile := $(curdir)/pkgconf/compile
+$(curdir)/libtool/compile := $(curdir)/m4/compile $(curdir)/autoconf/compile $(curdir)/automake/compile $(curdir)/missing-macros/compile
+$(curdir)/lzma-old/compile := $(curdir)/zlib/compile
+$(curdir)/make-ext4fs/compile := $(curdir)/zlib/compile
+$(curdir)/missing-macros/compile := $(curdir)/autoconf/compile
+$(curdir)/mkimage/compile += $(curdir)/libressl/compile
+$(curdir)/mklibs/compile := $(curdir)/libtool/compile
+$(curdir)/mm-macros/compile := $(curdir)/libtool/compile
+$(curdir)/mpc/compile := $(curdir)/mpfr/compile $(curdir)/gmp/compile
+$(curdir)/mpfr/compile := $(curdir)/gmp/compile
+$(curdir)/mtd-utils/compile := $(curdir)/libtool/compile $(curdir)/e2fsprogs/compile $(curdir)/zlib/compile
+$(curdir)/padjffs2/compile := $(curdir)/findutils/compile
+$(curdir)/patchelf/compile := $(curdir)/libtool/compile
+$(curdir)/quilt/compile := $(curdir)/autoconf/compile $(curdir)/findutils/compile
+$(curdir)/sdcc/compile := $(curdir)/bison/compile
+$(curdir)/squashfs/compile := $(curdir)/lzma-old/compile
+$(curdir)/squashfskit4/compile := $(curdir)/xz/compile $(curdir)/zlib/compile
+$(curdir)/zlib/compile := $(curdir)/cmake/compile
+$(curdir)/zstd/compile := $(curdir)/cmake/compile
+
+ifneq ($(HOST_OS),Linux)
+ $(curdir)/squashfskit4/compile += $(curdir)/coreutils/compile
+ tools-y += coreutils
+endif
+
+ifneq ($(CONFIG_CCACHE)$(CONFIG_SDK),)
+$(foreach tool, $(filter-out xz zstd patch pkgconf libressl cmake,$(tools-y)), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/compile))