Makefile (3117B)
1 # 2 # Copyright (C) 2008-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 8 include $(TOPDIR)/rules.mk 9 10 PKG_NAME:=coreutils 11 PKG_VERSION:=8.23 12 PKG_RELEASE:=2 13 14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz 15 PKG_SOURCE_URL:=@GNU/coreutils 16 PKG_MD5SUM:=abed135279f87ad6762ce57ff6d89c41 17 PKG_BUILD_DEPENDS:=libpthread 18 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io> 19 20 PKG_BUILD_PARALLEL:=1 21 22 include $(INCLUDE_DIR)/package.mk 23 24 COREUTILS_APPLETS := \ 25 base64 basename cat chcon chgrp chmod chown chroot cksum comm cp csplit \ 26 cut date dd dir dircolors dirname du echo env expand expr factor \ 27 false fmt fold groups head hostid id install join kill link ln logname \ 28 ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup nproc od paste \ 29 pathchk pinky pr printenv printf ptx pwd readlink realpath rm rmdir \ 30 runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum shred \ 31 shuf sleep sort split stat stdbuf stty sum sync tac tail tee test \ 32 timeout touch tr true truncate tsort tty uname unexpand uniq unlink \ 33 uptime users vdir wc who whoami yes 34 35 DEPENDS_sort = +libpthread 36 DEPENDS_timeout = +librt 37 DEPENDS_expr = +libgmp 38 DEPENDS_factor = +libgmp 39 DEPENDS_cp = +libacl 40 DEPENDS_dir = +libacl +libcap 41 DEPENDS_install = +libacl 42 DEPENDS_ls = +libacl +libcap 43 DEPENDS_mv = +libacl 44 DEPENDS_vdir = +libacl +libcap 45 46 define Package/coreutils/Default 47 SECTION:=utils 48 CATEGORY:=Utilities 49 TITLE:=The GNU core utilities 50 URL:=http://www.gnu.org/software/coreutils/ 51 endef 52 53 define Package/coreutils 54 $(call Package/coreutils/Default) 55 TITLE:=The GNU core utilities 56 MENU:=1 57 endef 58 59 define Package/coreutils/description 60 Full versions of standard GNU utilities. If an equivalent Busybox applet is 61 available, you should consider compiling that instead as Busybox applets are 62 usually smaller, at the expense of reduced functionality. 63 endef 64 65 define GenPlugin 66 define Package/$(1) 67 $(call Package/coreutils/Default) 68 DEPENDS:=coreutils $(DEPENDS_$(2)) 69 TITLE:=Utility $(2) from the GNU core utilities 70 endef 71 72 define Package/$(1)/description 73 Full version of standard GNU $(2) utility. 74 endef 75 endef 76 77 $(foreach a,$(COREUTILS_APPLETS),$(eval $(call GenPlugin,coreutils-$(a),$(a)))) 78 79 CONFIGURE_VARS += \ 80 gl_cv_func_mbrtowc_incomplete_state=yes \ 81 gl_cv_func_mbrtowc_retval=yes \ 82 gl_cv_func_wcrtomb_retval=yes 83 84 ifneq ($(CONFIG_USE_UCLIBC),) 85 CONFIGURE_VARS += \ 86 ac_cv_type_pthread_spinlock_t=$(if $(filter 0.9.30% 0.9.2% 0.9.31%,$(call qstrip,$(CONFIG_UCLIBC_VERSION))),no,yes) 87 endif 88 89 CONFIGURE_ARGS += \ 90 --disable-xattr \ 91 --enable-install-program=su 92 93 define Build/Compile 94 $(MAKE) -C $(PKG_BUILD_DIR) \ 95 DESTDIR="$(PKG_INSTALL_DIR)" \ 96 SHELL="/bin/bash" \ 97 all install 98 endef 99 100 define Package/coreutils/install 101 true 102 endef 103 104 define BuildPlugin 105 define Package/$(1)/install 106 $(INSTALL_DIR) $$(1)/usr/bin 107 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/$(2) $$(1)/usr/bin/ 108 endef 109 110 $$(eval $$(call BuildPackage,$(1))) 111 endef 112 113 $(eval $(call BuildPackage,coreutils)) 114 115 $(foreach a,$(COREUTILS_APPLETS),$(eval $(call BuildPlugin,coreutils-$(a),$(a))))