Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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.6
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=@GNU/coreutils
  13. PKG_HASH:=2bec616375002c92c1ed5ead32a092b174fe44c14bc736d32e5961053b821d84
  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/c++defs.h \
  20. lib/realloc.c \
  21. lib/reallocarray.c \
  22. lib/savedir.c \
  23. lib/fcntl.in.h \
  24. lib/stdio.in.h \
  25. lib/stdlib.in.h \
  26. lib/se-selinux.in.h \
  27. lib/iconv_open-aix.gperf \
  28. lib/iconv_open-hpux.gperf \
  29. lib/iconv_open-irix.gperf \
  30. lib/iconv_open-osf.gperf \
  31. lib/iconv_open-solaris.gperf \
  32. lib/iconv_open-zos.gperf
  33. HOST_CONFIGURE_ARGS += \
  34. --enable-install-program=$(subst $(space),$(comma),$(strip $(PKG_PROGRAMS)))
  35. HOST_MAKE_FLAGS += \
  36. $(AM_TOOL_PATHS_FAKE) \
  37. PROGRAMS="$(patsubst %,src/%,$(PKG_PROGRAMS))" \
  38. LIBRARIES= MANS= SUBDIRS=.
  39. define Host/Bootstrap
  40. ( \
  41. cd $(HOST_BUILD_DIR); \
  42. $(AM_TOOL_PATHS_FAKE) \
  43. ./bootstrap \
  44. --bootstrap-sync \
  45. --force \
  46. --no-git \
  47. --skip-po \
  48. --gnulib-srcdir=$(GNULIB_SRCDIR) \
  49. )
  50. endef
  51. define Host/Prepare
  52. $(call Host/Prepare/Default)
  53. $(if $(QUILT),,$(call Host/Bootstrap))
  54. endef
  55. define Host/Configure
  56. $(if $(QUILT),$(call Host/Bootstrap))
  57. $(foreach src,$(HOST_GNULIB_SKIP),mv -f $(HOST_BUILD_DIR)/$(src)~ $(HOST_BUILD_DIR)/$(src) || true; )
  58. $(call Host/Configure/Default)
  59. endef
  60. define Host/Install
  61. $(INSTALL_DIR) $(1)/bin
  62. $(INSTALL_BIN) $(patsubst %,$(HOST_BUILD_DIR)/src/%,$(PKG_PROGRAMS)) $(1)/bin/
  63. ln -sf ginstall $(1)/bin/install
  64. endef
  65. define Host/Uninstall
  66. rm -f $(STAGING_DIR_HOST)/bin/install
  67. -$(call Host/Compile/Default,uninstall)
  68. endef
  69. $(eval $(call HostBuild))