d2efd62d2357d782575cdf64f0a88e70e569f0b3
[openwrt/openwrt.git] / tools / mkimage / Makefile
1 #
2 # Copyright (C) 2006-2013 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
9 PKG_NAME:=mkimage
10 PKG_VERSION:=2013.07-rc1
11
12 PKG_SOURCE:=u-boot-$(PKG_VERSION).tar.bz2
13 PKG_SOURCE_URL:=ftp://ftp.denx.de/pub/u-boot
14 PKG_MD5SUM:=9b14d9a8981ce2e429956af7cc96996e
15 PKG_CAT:=bzcat
16
17 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/u-boot-$(PKG_VERSION)
18
19 include $(INCLUDE_DIR)/host-build.mk
20
21 define Host/Prepare
22 $(Host/Prepare/Default)
23 rm -f \
24 $(HOST_BUILD_DIR)/include/errno.h \
25 $(HOST_BUILD_DIR)/include/malloc.h \
26 $(HOST_BUILD_DIR)/tools/.depend
27 touch $(HOST_BUILD_DIR)/include/config.h
28 endef
29
30 define Host/Compile
31 $(MAKE) -C $(HOST_BUILD_DIR) BUILD_DIR= BIN_FILES-y="mkimage" HOSTLDFLAGS="$(HOST_STATIC_LINKING)" tools
32 endef
33
34 define Host/Install
35 $(CP) $(HOST_BUILD_DIR)/tools/mkimage $(STAGING_DIR_HOST)/bin/
36 endef
37
38 define Host/Clean
39 rm -f $(STAGING_DIR_HOST)/bin/mkimage
40 endef
41
42 $(eval $(call HostBuild))