Makefile 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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_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. KMOD) \
  37. printf "# CONFIG_MODINFO is not set\n" >> ${WRKBUILD}/.config; \
  38. printf "# CONFIG_MODPROBE_SMALL is not set\n" >> ${WRKBUILD}/.config; \
  39. printf "# CONFIG_INSMOD is not set\n" >> ${WRKBUILD}/.config; \
  40. printf "# CONFIG_RMMOD is not set\n" >> ${WRKBUILD}/.config; \
  41. printf "# CONFIG_LSMOD is not set\n" >> ${WRKBUILD}/.config; \
  42. printf "# CONFIG_MODPROBE is not set\n" >> ${WRKBUILD}/.config; \
  43. printf "# CONFIG_DEPMOD is not set\n" >> ${WRKBUILD}/.config; \
  44. ;; \
  45. *) \
  46. printf "# CONFIG_$${symbol} is not set\n" >> ${WRKBUILD}/.config; \
  47. ;; \
  48. esac \
  49. done
  50. ifeq ($(ADK_TARGET_WITHOUT_MMU),y)
  51. echo 'CONFIG_NOMMU=y' >> ${WRKBUILD}/.config
  52. endif
  53. $(SED) 's;@IDIR@;${WRKINST};' ${WRKBUILD}/.config
  54. do-build:
  55. PATH='$(HOST_PATH)' $(MAKE) ${BB_MAKE_FLAGS} -C ${WRKBUILD} busybox
  56. do-install:
  57. PATH='$(HOST_PATH)' $(MAKE) ${BB_MAKE_FLAGS} -C ${WRKBUILD} install $(MAKE_TRACE)
  58. $(CP) $(WRKINST)/* $(IDIR_BUSYBOX)/
  59. ifeq ($(BUSYBOX_IFUPDOWN),y)
  60. $(INSTALL_DIR) $(IDIR_BUSYBOX)/etc/init.d
  61. ifeq ($(ADK_RUNTIME_WAIT_FOR_ETHERNET),y)
  62. $(INSTALL_BIN) ./files/network.wait $(IDIR_BUSYBOX)/etc/init.d/network
  63. else
  64. $(INSTALL_BIN) ./files/network $(IDIR_BUSYBOX)/etc/init.d/network
  65. endif
  66. endif
  67. ifeq ($(ADK_DEBUG),y)
  68. ${INSTALL_BIN} $(WRKBUILD)/busybox_unstripped \
  69. $(IDIR_BUSYBOX)/bin/busybox
  70. endif
  71. ifneq ($(strip ${ADK_PACKAGE_CFGFS}),)
  72. cd ${IDIR_BUSYBOX}/sbin && rm -f halt poweroff reboot
  73. endif
  74. include ${ADK_TOPDIR}/mk/pkg-bottom.mk