Makefile 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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 $(TOPDIR)/rules.mk
  4. PKG_NAME:= busybox
  5. PKG_VERSION:= 1.21.1
  6. PKG_RELEASE:= 7
  7. PKG_MD5SUM:= 795394f83903b5eec6567d51eebb417e
  8. PKG_DESCR:= core utilities for embedded systems
  9. PKG_SECTION:= core
  10. PKG_BUILDDEP:= bzip2-host
  11. PKG_URL:= http://www.busybox.net/
  12. PKG_SITES:= http://www.busybox.net/downloads/
  13. DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
  14. PKG_SUBPKGS:= BUSYBOX UDHCPD
  15. PKGSD_UDHCPD:= uDHCPD meta package
  16. PKGSC_UDHCPD:= net
  17. include $(TOPDIR)/mk/package.mk
  18. $(eval $(call PKG_template,BUSYBOX,busybox,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  19. $(eval $(call PKG_template,UDHCPD,udhcpd,${PKG_VERSION}-${PKG_RELEASE},busybox,${PKGSD_UDHCPD},${PKGSC_UDHCPD}))
  20. # This is how to extract the Config.in files from a _built_ busybox source tree:
  21. #|for c in $(find build_viprinux_arm_glibc/w-busybox-1.18.1-4/busybox-1.18.1/ -name Config.in); do
  22. #| c=$(sed s,build_viprinux_arm_glibc/w-busybox-1.18.1-4/busybox-1.18.1/,, <<< $c)
  23. #| mkdir -p package/busybox/config_new/$(dirname $c)
  24. #| cp build_viprinux_arm_glibc/w-busybox-1.18.1-4/busybox-1.18.1/$c package/busybox/config_new/$c
  25. #|done
  26. CONFIG_STYLE:= manual
  27. BUILD_STYLE:= manual
  28. INSTALL_STYLE:= manual
  29. BB_MAKE_FLAGS:= V=1 IPKG_ARCH="${CPU_ARCH}" \
  30. ARCH="${ARCH}" \
  31. GCC_HONOUR_COPTS=s \
  32. HOSTCC="${CC_FOR_BUILD}" \
  33. HOSTCFLAGS="$(CFLAGS_FOR_BUILD)" \
  34. CROSS_COMPILE="$(TARGET_CROSS)" \
  35. -C ${WRKBUILD}
  36. do-configure:
  37. # get all symbols from top level config
  38. grep BUSYBOX_ $(TOPDIR)/.config|sed -e 's/BUSYBOX_/CONFIG_/' > \
  39. ${WRKBUILD}/.config
  40. # remove all disabled symbols
  41. for i in $$(grep "BUSYBOX_DISABLE" $(TOPDIR)/.config);do \
  42. test -s "$$i" || continue; \
  43. grep -v $${i#BUSYBOX_DISABLE} ${WRKBUILD}/.config > \
  44. ${WRKBUILD}/.config.tmp; \
  45. cp ${WRKBUILD}/.config.tmp ${WRKBUILD}/.config; \
  46. done
  47. $(SED) 's;@IDIR@;${WRKINST};' ${WRKBUILD}/.config
  48. yes '' | PATH='$(HOST_PATH)' $(MAKE) ${BB_MAKE_FLAGS} oldconfig $(MAKE_TRACE)
  49. do-build:
  50. PATH='$(HOST_PATH)' $(MAKE) ${BB_MAKE_FLAGS} busybox
  51. BBDEFS:=(
  52. define BBDEF
  53. ifeq ($(ADK_RUNTIME_START_BUSYBOX_$(1)),y)
  54. BBDEFS+=echo BBDEF_$(1)=YES;
  55. else
  56. BBDEFS+=echo BBDEF_$(1)=NO;
  57. endif
  58. endef
  59. $(foreach OPTION,CROND WATCHDOG SYSLOGD INETD NTPD,$(eval $(call BBDEF,$(OPTION))))
  60. do-install:
  61. PATH='$(HOST_PATH)' $(MAKE) ${BB_MAKE_FLAGS} install $(MAKE_TRACE)
  62. $(CP) $(WRKINST)/* $(IDIR_BUSYBOX)/
  63. $(INSTALL_DIR) $(IDIR_BUSYBOX)/etc
  64. ${BBDEFS} :) >$(IDIR_BUSYBOX)/etc/.bb_defaults
  65. ifeq ($(BUSYBOX_IFUPDOWN),y)
  66. $(INSTALL_DIR) $(IDIR_BUSYBOX)/etc/init.d
  67. $(INSTALL_BIN) ./files/network $(IDIR_BUSYBOX)/etc/init.d
  68. endif
  69. ifeq ($(ADK_DEBUG),y)
  70. ${INSTALL_BIN} $(WRKBUILD)/busybox_unstripped \
  71. $(IDIR_BUSYBOX)/bin/busybox
  72. endif
  73. ifneq ($(strip ${ADK_PACKAGE_CFGFS}),)
  74. cd ${IDIR_BUSYBOX}/sbin && rm -f halt poweroff reboot
  75. endif
  76. udhcpd-install:
  77. ${INSTALL_DIR} ${IDIR_UDHCPD}/etc/
  78. ${INSTALL_DATA} ./files/udhcpd.conf ${IDIR_UDHCPD}/etc/
  79. include ${TOPDIR}/mk/pkg-bottom.mk