| 1 | # |
| 2 | # Copyright (C) 2006-2012 OpenWrt.org |
| 3 | # |
| 4 | # This is free software, licensed under the GNU General Public License v2. |
| 5 | # See /LICENSE for more information. |
| 6 | # |
| 7 | include $(TOPDIR)/rules.mk |
| 8 | include $(INCLUDE_DIR)/target.mk |
| 9 | |
| 10 | PKG_NAME:=ccache |
| 11 | PKG_VERSION:=3.1.7 |
| 12 | |
| 13 | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz |
| 14 | PKG_SOURCE_URL:=http://samba.org/ftp/ccache/ |
| 15 | PKG_MD5SUM:=80a698c22d0b06b19c88ac58e8d8b632 |
| 16 | |
| 17 | include $(INCLUDE_DIR)/host-build.mk |
| 18 | |
| 19 | HOST_LDFLAGS += $(HOST_STATIC_LINKING) |
| 20 | HOST_CONFIGURE_VARS += CC="$(HOSTCC_NOCACHE)" |
| 21 | |
| 22 | define Host/Install/ccache |
| 23 | $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/ |
| 24 | $(CP) ./files/* $(STAGING_DIR_HOST)/bin/ |
| 25 | endef |
| 26 | |
| 27 | ifneq ($(strip $(shell which ccache >/dev/null && echo found)),found) |
| 28 | define Host/Clean |
| 29 | -$(MAKE) -C $(HOST_BUILD_DIR) uninstall |
| 30 | $(call Host/Clean/Default) |
| 31 | endef |
| 32 | define Host/Install |
| 33 | $(call Host/Install/Default) |
| 34 | $(call Host/Install/ccache) |
| 35 | endef |
| 36 | else |
| 37 | define Host/Prepare |
| 38 | endef |
| 39 | define Host/Configure |
| 40 | endef |
| 41 | define Host/Compile |
| 42 | endef |
| 43 | define Host/Install |
| 44 | $(call Host/Install/ccache) |
| 45 | endef |
| 46 | define Host/Clean |
| 47 | endef |
| 48 | define Download |
| 49 | endef |
| 50 | endif |
| 51 | |
| 52 | $(eval $(call HostBuild)) |
| 53 | |