ccache.mk 919 B

123456789101112131415161718192021222324252627282930313233
  1. #############################################################
  2. #
  3. # ccache
  4. #
  5. #############################################################
  6. CCACHE_VERSION = 3.1.4
  7. CCACHE_SITE = http://samba.org/ftp/ccache
  8. CCACHE_SOURCE = ccache-$(CCACHE_VERSION).tar.bz2
  9. # When ccache is being built for the host, ccache is not yet
  10. # available, so we have to use the special C compiler without the
  11. # cache.
  12. HOST_CCACHE_CONF_ENV = \
  13. CC="$(HOSTCC_NOCCACHE)"
  14. # We directly hardcode the cache location into the binary, as it is
  15. # much easier to handle than passing an environment variable.
  16. define HOST_CCACHE_FIX_CCACHE_DIR
  17. sed -i 's,getenv("CCACHE_DIR"),"$(CCACHE_CACHE_DIR)",' $(@D)/ccache.c
  18. endef
  19. HOST_CCACHE_POST_CONFIGURE_HOOKS += \
  20. HOST_CCACHE_FIX_CCACHE_DIR
  21. $(eval $(call AUTOTARGETS,package,ccache))
  22. $(eval $(call AUTOTARGETS,package,ccache,host))
  23. ifeq ($(BR2_CCACHE),y)
  24. ccache-stats: host-ccache
  25. $(Q)$(CCACHE) -s
  26. endif