Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. include $(ADK_TOPDIR)/rules.mk
  4. PKG_NAME:= busybox
  5. PKG_VERSION:= 1.26.2
  6. PKG_RELEASE:= 2
  7. PKG_HASH:= da3e44913fc1a9c9b7c5337ea5292da518683cbff32be630777f565d6036af16
  8. PKG_DESCR:= core utilities for embedded systems
  9. PKG_SECTION:= base/apps
  10. PKG_URL:= http://www.busybox.net/
  11. PKG_SITES:= https://www.busybox.net/downloads/
  12. DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
  13. include $(ADK_TOPDIR)/mk/package.mk
  14. $(eval $(call PKG_template,BUSYBOX,busybox,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  15. # disable lto
  16. TARGET_CFLAGS:= $(filter-out -flto,$(TARGET_CFLAGS))
  17. CONFIG_STYLE:= manual
  18. BUILD_STYLE:= manual
  19. INSTALL_STYLE:= manual
  20. BB_MAKE_FLAGS:= V=1 \
  21. ARCH="${ADK_TARGET_ARCH}" \
  22. IPKG_ARCH="${ADK_TARGET_CPU_ARCH}" \
  23. HOSTCC="${CC_FOR_BUILD}" \
  24. HOSTCFLAGS="$(CFLAGS_FOR_BUILD)" \
  25. CROSS_COMPILE="$(TARGET_CROSS)" \
  26. SKIP_STRIP=y
  27. do-configure:
  28. # get all symbols from top level config
  29. grep "^BUSYBOX_\|# BUSYBOX" $(ADK_TOPDIR)/.config|grep -v BUSYBOX_DISABLE|sed -e 's/BUSYBOX_/CONFIG_/' > \
  30. ${WRKBUILD}/.config
  31. # convert all disabled symbols
  32. for i in $$(grep ^BUSYBOX_DISABLE $(ADK_TOPDIR)/.config);do \
  33. sym=$${i#BUSYBOX_DISABLE_}; \
  34. symbol=$$(echo $$sym|sed -e "s#=y##"); \
  35. case $$symbol in \
  36. GREP) \
  37. printf "# CONFIG_GREP is not set\n" >> ${WRKBUILD}/.config; \
  38. printf "# CONFIG_EGREP is not set\n" >> ${WRKBUILD}/.config; \
  39. printf "# CONFIG_FGREP is not set\n" >> ${WRKBUILD}/.config; \
  40. ;; \
  41. KMOD) \
  42. printf "# CONFIG_MODINFO is not set\n" >> ${WRKBUILD}/.config; \
  43. printf "# CONFIG_MODPROBE_SMALL is not set\n" >> ${WRKBUILD}/.config; \
  44. printf "# CONFIG_INSMOD is not set\n" >> ${WRKBUILD}/.config; \
  45. printf "# CONFIG_RMMOD is not set\n" >> ${WRKBUILD}/.config; \
  46. printf "# CONFIG_LSMOD is not set\n" >> ${WRKBUILD}/.config; \
  47. printf "# CONFIG_MODPROBE is not set\n" >> ${WRKBUILD}/.config; \
  48. printf "# CONFIG_DEPMOD is not set\n" >> ${WRKBUILD}/.config; \
  49. ;; \
  50. *) \
  51. printf "# CONFIG_$${symbol} is not set\n" >> ${WRKBUILD}/.config; \
  52. ;; \
  53. esac \
  54. done
  55. $(SED) 's;@IDIR@;${WRKINST};' ${WRKBUILD}/.config
  56. do-build:
  57. PATH='$(HOST_PATH)' $(MAKE) ${BB_MAKE_FLAGS} -C ${WRKBUILD} busybox
  58. do-install:
  59. PATH='$(HOST_PATH)' $(MAKE) ${BB_MAKE_FLAGS} -C ${WRKBUILD} install $(MAKE_TRACE)
  60. $(CP) $(WRKINST)/* $(IDIR_BUSYBOX)/
  61. ifeq ($(ADK_RUNTIME_INIT_SYSTEMD),)
  62. ifeq ($(BUSYBOX_IFUP),y)
  63. $(INSTALL_DIR) $(IDIR_BUSYBOX)/etc/init.d
  64. ifeq ($(ADK_RUNTIME_WAIT_FOR_ETHERNET),y)
  65. $(INSTALL_BIN) ./files/network.wait $(IDIR_BUSYBOX)/etc/init.d/network
  66. else
  67. $(INSTALL_BIN) ./files/network $(IDIR_BUSYBOX)/etc/init.d/network
  68. endif
  69. endif
  70. endif
  71. ifeq ($(ADK_DEBUG),y)
  72. ${INSTALL_BIN} $(WRKBUILD)/busybox_unstripped \
  73. $(IDIR_BUSYBOX)/bin/busybox
  74. endif
  75. ifneq ($(strip ${ADK_PACKAGE_CFGFS}),)
  76. cd ${IDIR_BUSYBOX}/sbin && rm -f halt poweroff reboot
  77. endif
  78. include ${ADK_TOPDIR}/mk/pkg-bottom.mk