Makefile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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.3
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@GNU/coreutils
  13. PKG_HASH:=adbcfcfe899235b71e8768dcf07cd532520b7f54f9a8064843f8d199a904bbaa
  14. HOST_BUILD_PARALLEL := 1
  15. BUILD_PROGRAMS = date readlink touch ln chown ginstall
  16. include $(INCLUDE_DIR)/host-build.mk
  17. export GNULIB_SRCDIR:=$(HOST_GNULIB_SRCDIR)
  18. BUILD_BINS = $(patsubst %,src/%,$(BUILD_PROGRAMS))
  19. HOST_CONFIGURE_ARGS += \
  20. --enable-install-program=$(subst $(space),$(comma),$(strip $(BUILD_PROGRAMS)))
  21. HOST_MAKE_FLAGS += \
  22. $(AM_TOOL_PATHS_FAKE) \
  23. PROGRAMS="$(BUILD_BINS)" \
  24. LIBRARIES= MANS= SUBDIRS=.
  25. define Host/Bootstrap
  26. ( \
  27. cd $(HOST_BUILD_DIR); \
  28. $(AM_TOOL_PATHS_FAKE) \
  29. ./bootstrap \
  30. --bootstrap-sync \
  31. --force \
  32. --no-git \
  33. --skip-po \
  34. --gnulib-srcdir=$(GNULIB_SRCDIR) \
  35. )
  36. endef
  37. define Host/Prepare
  38. $(call Host/Prepare/Default)
  39. $(if $(QUILT),,$(call Host/Bootstrap))
  40. endef
  41. define Host/Configure
  42. $(if $(QUILT),$(call Host/Bootstrap))
  43. -$(CP) $(HOST_BUILD_DIR)/lib/time.in.h~ $(HOST_BUILD_DIR)/lib/time.in.h # @GNULIB_TIME@ not defined
  44. $(call Host/Configure/Default)
  45. endef
  46. define Host/Install
  47. $(INSTALL_DIR) $(1)/bin
  48. $(INSTALL_BIN) $(patsubst %,$(HOST_BUILD_DIR)/%,$(BUILD_BINS)) $(1)/bin/
  49. ln -sf ginstall $(1)/bin/install
  50. endef
  51. define Host/Uninstall
  52. rm -f $(STAGING_DIR_HOST)/bin/install
  53. -$(call Host/Compile/Default,uninstall)
  54. endef
  55. $(eval $(call HostBuild))