Makefile 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #
  2. # Copyright (C) 2006-2014 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. PKG_NAME:=mkimage
  9. PKG_VERSION:=2014.10
  10. PKG_SOURCE:=u-boot-$(PKG_VERSION).tar.bz2
  11. PKG_SOURCE_URL:=\
  12. http://mirror2.librecmc.org/sources \
  13. ftp://ftp.denx.de/pub/u-boot
  14. PKG_MD5SUM:=3ddcaee2f05b7c464778112ec83664b5
  15. PKG_CAT:=bzcat
  16. HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/u-boot-$(PKG_VERSION)
  17. include $(INCLUDE_DIR)/host-build.mk
  18. define Host/Prepare
  19. $(Host/Prepare/Default)
  20. rm -f \
  21. $(HOST_BUILD_DIR)/include/errno.h \
  22. $(HOST_BUILD_DIR)/include/malloc.h \
  23. $(HOST_BUILD_DIR)/tools/.depend
  24. touch $(HOST_BUILD_DIR)/include/config.mk
  25. touch $(HOST_BUILD_DIR)/include/config.h
  26. endef
  27. define Host/Compile
  28. $(MAKE) -C $(HOST_BUILD_DIR) defconfig HOSTCFLAGS="$(HOST_CPPFLAGS) $(HOST_CFLAGS)" HOSTLDFLAGS="$(HOST_LDFLAGS)"
  29. $(MAKE) -C $(HOST_BUILD_DIR) tools-only HOSTCFLAGS="$(HOST_CPPFLAGS) $(HOST_CFLAGS)" HOSTLDFLAGS="$(HOST_LDFLAGS)"
  30. endef
  31. define Host/Install
  32. $(CP) $(HOST_BUILD_DIR)/tools/mkimage $(STAGING_DIR_HOST)/bin/
  33. endef
  34. define Host/Clean
  35. rm -f $(STAGING_DIR_HOST)/bin/mkimage
  36. endef
  37. $(eval $(call HostBuild))