[tools] fix ccache build
[openwrt.git] / tools / ccache / Makefile
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 HOSTCC:=$(HOSTCC_NOCACHE)
20
21 define Host/Install/ccache
22         $(INSTALL_DIR) $(STAGING_DIR_HOST)/bin/
23         $(CP) ./files/* $(STAGING_DIR_HOST)/bin/
24 endef
25
26 ifneq ($(strip $(shell which ccache >/dev/null && echo found)),found)
27   define Host/Compile
28         $(MAKE) -C $(HOST_BUILD_DIR)
29   endef
30
31   define Host/Clean
32         -$(MAKE) -C $(HOST_BUILD_DIR) uninstall
33         $(call Host/Clean/Default)
34   endef
35   define Host/Install
36         $(call Host/Install/Default)
37         $(call Host/Install/ccache)
38   endef
39 else
40   define Host/Prepare
41   endef
42   define Host/Configure
43   endef
44   define Host/Compile
45   endef
46   define Host/Install
47         $(call Host/Install/ccache)
48   endef
49   define Host/Clean
50   endef
51   define Download
52   endef
53 endif
54
55 $(eval $(call HostBuild))