Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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.20.2
  6. PKG_RELEASE:= 2
  7. PKG_MD5SUM:= e025414bc6cd79579cc7a32a45d3ae1c
  8. PKG_DESCR:= Core utilities for embedded systems
  9. PKG_SECTION:= base
  10. PKG_URL:= http://www.busybox.net/
  11. PKG_SITES:= http://www.busybox.net/downloads/
  12. DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
  13. PKG_SUBPKGS:= BUSYBOX UDHCPD
  14. PKGSD_UDHCPD:= uDHCPD meta package
  15. PKGSC_UDHCPD:= net
  16. include $(TOPDIR)/mk/package.mk
  17. $(eval $(call PKG_template,BUSYBOX,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  18. $(eval $(call PKG_template,UDHCPD,udhcpd,${PKG_VERSION}-${PKG_RELEASE},busybox,${PKGSD_UDHCPD},${PKGSC_UDHCPD}))
  19. # This is how to extract the Config.in files from a _built_ busybox source tree:
  20. #|for c in $(find build_viprinux_arm_glibc/w-busybox-1.18.1-4/busybox-1.18.1/ -name Config.in); do
  21. #| c=$(sed s,build_viprinux_arm_glibc/w-busybox-1.18.1-4/busybox-1.18.1/,, <<< $c)
  22. #| mkdir -p package/busybox/config_new/$(dirname $c)
  23. #| cp build_viprinux_arm_glibc/w-busybox-1.18.1-4/busybox-1.18.1/$c package/busybox/config_new/$c
  24. #|done
  25. CONFIG_STYLE:= manual
  26. BUILD_STYLE:= manual
  27. INSTALL_STYLE:= manual
  28. BB_MAKE_FLAGS:= V=1 IPKG_ARCH="${CPU_ARCH}" ARCH="${ARCH}" GCC_HONOUR_COPTS=s \
  29. HOSTCC="${CC_FOR_BUILD}" HOSTCFLAGS="$(CFLAGS_FOR_BUILD)" \
  30. -C ${WRKBUILD}
  31. ifneq (${ADK_NATIVE},y)
  32. BB_MAKE_FLAGS+= CROSS_COMPILE="$(TARGET_CROSS)" EXTRA_LDFLAGS='-static-libgcc'
  33. else
  34. BB_MAKE_FLAGS+= EXTRA_LDFLAGS="-static-libgcc"
  35. endif
  36. # XXX: Although this looks like all new symbols are enabled when 'make oldconfig' runs, they're not.
  37. # In fact, you can pipe "yes ''" as well as "yes n", each time leading to the default value being
  38. # chosen for each unknown symbol.
  39. # A real solution for that task (disabling everything that's unknown, as we know better) is to
  40. # upgrade ${TOPDIR}/config so it understands the oldnoconfig target, and using that to update
  41. # the busybox config before compiling.
  42. # The workaround for now is to patch all busybox symbols to default n inside the busybox source
  43. # which do depend on non-existance of other packages outside the busybox source.
  44. do-configure:
  45. grep BUSYBOX_ $(TOPDIR)/.config|sed -e 's/BUSYBOX_/CONFIG_/' > \
  46. ${WRKBUILD}/.config
  47. $(SED) 's;@IDIR@;${WRKINST};' ${WRKBUILD}/.config
  48. yes '' | $(MAKE) ${BB_MAKE_FLAGS} oldconfig $(MAKE_TRACE)
  49. do-build:
  50. $(MAKE) ${BB_MAKE_FLAGS} busybox
  51. do-install:
  52. $(MAKE) ${BB_MAKE_FLAGS} install $(MAKE_TRACE)
  53. $(CP) $(WRKINST)/* $(IDIR_BUSYBOX)/
  54. ifeq ($(ADK_DEBUG),y)
  55. ${INSTALL_BIN} $(WRKBUILD)/busybox_unstripped \
  56. $(IDIR_BUSYBOX)/bin/busybox
  57. endif
  58. ifneq ($(strip ${ADK_PACKAGE_CFGFS}),)
  59. cd ${IDIR_BUSYBOX}/sbin && rm -f halt poweroff reboot
  60. endif
  61. udhcpd-install:
  62. ${INSTALL_DIR} ${IDIR_UDHCPD}/etc/
  63. ${INSTALL_DATA} ./files/udhcpd.conf ${IDIR_UDHCPD}/etc/
  64. include ${TOPDIR}/mk/pkg-bottom.mk