Add ccache if not installed/installable on the host-system
[openwrt/openwrt.git] / toolchain / ccache / Makefile
1 #
2 # Copyright (C) 2006 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:=2.4
12
13 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
14 PKG_SOURCE_URL:=http://samba.org/ftp/ccache/
15 PKG_MD5SUM:=73c1ed1e767c1752dd0f548ec1e66ce7
16 PKG_CAT:=zcat
17
18 PKG_BUILD_DIR:=$(TOOLCHAIN_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
19
20 include $(INCLUDE_DIR)/host-build.mk
21
22 ifneq ($(shell which ccache),)
23 define Build/Configure
24 $(call Build/Configure/Default)
25 endef
26
27 define Build/Compile
28 $(MAKE) CC="$(HOSTCC)" -C $(PKG_BUILD_DIR)
29 endef
30
31 define Build/Install
32 $(MAKE) -C $(PKG_BUILD_DIR) \
33 DESTDIR="$(STAGING_DIR)" \
34 install
35 endef
36
37 define Build/Clean
38 $(MAKE) -C $(PKG_BUILD_DIR) uninstall
39 -$(MAKE) -C $(PKG_BUILD_DIR) clean
40 endef
41 endif
42 $(eval $(call HostBuild))