Makefile 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. --enable-install-program=$(subst $(space),$(comma),$(strip $(PKG_PROGRAMS)))
  25. HOST_MAKE_FLAGS += \
  26. $(AM_TOOL_PATHS_FAKE) \
  27. PROGRAMS="$(patsubst %,src/%,$(PKG_PROGRAMS))" \
  28. LIBRARIES= MANS= SUBDIRS=.
  29. define Host/Bootstrap
  30. ( \
  31. cd $(HOST_BUILD_DIR); \
  32. $(AM_TOOL_PATHS_FAKE) \
  33. ./bootstrap \
  34. --bootstrap-sync \
  35. --force \
  36. --no-git \
  37. --skip-po \
  38. --gnulib-srcdir=$(GNULIB_SRCDIR) \
  39. )
  40. endef
  41. define Host/Prepare
  42. $(call Host/Prepare/Default)
  43. $(if $(QUILT),,$(call Host/Bootstrap))
  44. endef
  45. define Host/Configure
  46. $(if $(QUILT),$(call Host/Bootstrap))
  47. $(foreach src,$(HOST_GNULIB_SKIP),mv -f $(HOST_BUILD_DIR)/$(src)~ $(HOST_BUILD_DIR)/$(src) || true; )
  48. $(call Host/Configure/Default)
  49. endef
  50. define Host/Install
  51. $(INSTALL_DIR) $(1)/bin
  52. $(INSTALL_BIN) $(patsubst %,$(HOST_BUILD_DIR)/src/%,$(PKG_PROGRAMS)) $(1)/bin/
  53. ln -sf ginstall $(1)/bin/install
  54. endef
  55. define Host/Uninstall
  56. rm -f $(STAGING_DIR_HOST)/bin/install
  57. -$(call Host/Compile/Default,uninstall)
  58. endef
  59. $(eval $(call HostBuild))