1
0

Makefile 2.8 KB

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