Makefile 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #
  2. # Copyright (C) 2015 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:=coreutils
  9. PKG_CPE_ID:=cpe:/a:gnu:coreutils
  10. PKG_VERSION:=9.5
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=@GNU/coreutils
  13. PKG_HASH:=767ae6a22950ec42f3ba5f7c1de79dd27800ee8e9b8642da5dedb5974a1741e5
  14. HOST_BUILD_PARALLEL := 1
  15. PKG_PROGRAMS:=date readlink touch ln chown ginstall
  16. include $(INCLUDE_DIR)/host-build.mk
  17. export GNULIB_SRCDIR:=$(HOST_GNULIB_SRCDIR)
  18. HOST_GNULIB_SKIP := \
  19. lib/nstrftime.c \
  20. lib/fprintftime.c \
  21. lib/fcntl.in.h \
  22. lib/locale.in.h
  23. HOST_CONFIGURE_ARGS += \
  24. --disable-year2038 \
  25. --enable-install-program=$(subst $(space),$(comma),$(strip $(PKG_PROGRAMS)))
  26. HOST_MAKE_FLAGS += \
  27. $(AM_TOOL_PATHS_FAKE) \
  28. PROGRAMS="$(patsubst %,src/%,$(PKG_PROGRAMS))" \
  29. LIBRARIES= MANS= SUBDIRS=.
  30. define Host/Bootstrap
  31. ( \
  32. cd $(HOST_BUILD_DIR); \
  33. $(AM_TOOL_PATHS_FAKE) \
  34. ./bootstrap \
  35. --bootstrap-sync \
  36. --force \
  37. --no-git \
  38. --skip-po \
  39. --gnulib-srcdir=$(GNULIB_SRCDIR) \
  40. )
  41. endef
  42. define Host/Prepare
  43. $(call Host/Prepare/Default)
  44. $(if $(QUILT),,$(call Host/Bootstrap))
  45. endef
  46. define Host/Configure
  47. $(if $(QUILT),$(call Host/Bootstrap))
  48. $(foreach src,$(HOST_GNULIB_SKIP),mv -f $(HOST_BUILD_DIR)/$(src)~ $(HOST_BUILD_DIR)/$(src) || true; )
  49. $(call Host/Configure/Default)
  50. endef
  51. define Host/Install
  52. $(INSTALL_DIR) $(1)/bin
  53. $(INSTALL_BIN) $(patsubst %,$(HOST_BUILD_DIR)/src/%,$(PKG_PROGRAMS)) $(1)/bin/
  54. ln -sf ginstall $(1)/bin/install
  55. endef
  56. define Host/Uninstall
  57. rm -f $(STAGING_DIR_HOST)/bin/install
  58. -$(call Host/Compile/Default,uninstall)
  59. endef
  60. $(eval $(call HostBuild))