Makefile 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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.16.1
  6. PKG_RELEASE:= 1
  7. PKG_MD5SUM:= 319486ec65078d07fde26eb620fecde7
  8. PKG_DESCR:= Core utilities for embedded Linux 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_DESCR_UDHCPD:= uDHCPD meta package
  14. PKG_SECTION_UDHCPD:= net
  15. include $(TOPDIR)/mk/package.mk
  16. $(eval $(call PKG_template,BUSYBOX,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  17. $(eval $(call PKG_template,UDHCPD,udhcpd,${PKG_VERSION}-${PKG_RELEASE},busybox,${PKG_DESCR_UDHCPD},${PKG_SECTION_UDHCPD}))
  18. SUB_INSTALLS-y:=
  19. SUB_INSTALLS-m:=
  20. SUB_INSTALLS-${ADK_PACKAGE_UDHCPD}+= udhcpd-install
  21. CONFIG_STYLE:= manual
  22. BUILD_STYLE:= manual
  23. INSTALL_STYLE:= manual
  24. ${TOPDIR}/.busyboxcfg: ${TOPDIR}/.config
  25. grep BUSYBOX_ $(TOPDIR)/.config|sed -e 's/BUSYBOX_/CONFIG_/' > \
  26. ${TOPDIR}/.busyboxcfg
  27. ${WRKBUILD}/.config: ${TOPDIR}/.busyboxcfg
  28. cp $(TOPDIR)/.busyboxcfg ${WRKBUILD}/.config
  29. $(SED) 's;@IDIR@;${WRKINST};' ${WRKBUILD}/.config
  30. do-configure: $(TOPDIR)/.busyboxcfg ${WRKBUILD}/.config
  31. ifeq ($(ADK_NATIVE),y)
  32. yes '' | \
  33. $(MAKE) V=1 \
  34. IPKG_ARCH="$(CPU_ARCH)" \
  35. ARCH="$(ARCH)" HOSTCC="$(HOSTCC)" -C $(WRKBUILD) oldconfig $(MAKE_TRACE)
  36. else
  37. yes '' | \
  38. $(MAKE) V=1 CROSS_COMPILE="$(TARGET_CROSS)" \
  39. EXTRA_CFLAGS="$(TARGET_CFLAGS)" IPKG_ARCH="$(CPU_ARCH)" \
  40. ARCH="$(ARCH)" HOSTCC="$(HOSTCC)" -C $(WRKBUILD) oldconfig $(MAKE_TRACE)
  41. endif
  42. do-build: $(TOPDIR)/.busyboxcfg ${WRKBUILD}/.config
  43. ifeq ($(ADK_NATIVE),y)
  44. $(MAKE) V=1 \
  45. IPKG_ARCH="$(CPU_ARCH)" ARCH="$(ARCH)" HOSTCC="$(HOSTCC)" -C $(WRKBUILD) busybox
  46. else
  47. $(MAKE) V=1 CROSS_COMPILE="$(TARGET_CROSS)" \
  48. IPKG_ARCH="$(CPU_ARCH)" ARCH="$(ARCH)" HOSTCC="$(HOSTCC)" -C $(WRKBUILD) busybox
  49. endif
  50. do-install: $(TOPDIR)/.busyboxcfg ${WRKBUILD}/.config ${SUB_INSTALLS-m} ${SUB_INSTALLS-y}
  51. ifeq ($(ADK_NATIVE),y)
  52. $(MAKE) V=1 \
  53. IPKG_ARCH="$(CPU_ARCH)" ARCH="$(ARCH)" HOSTCC="$(HOSTCC)" -C $(WRKBUILD) install $(MAKE_TRACE)
  54. else
  55. $(MAKE) V=1 CROSS_COMPILE="$(TARGET_CROSS)" \
  56. IPKG_ARCH="$(CPU_ARCH)" ARCH="$(ARCH)" HOSTCC="$(HOSTCC)" -C $(WRKBUILD) install $(MAKE_TRACE)
  57. endif
  58. $(CP) $(WRKINST)/* $(IDIR_BUSYBOX)/
  59. ifeq ($(ADK_DEBUG),y)
  60. ${INSTALL_BIN} $(WRKBUILD)/busybox_unstripped \
  61. $(IDIR_BUSYBOX)/bin/busybox
  62. endif
  63. udhcpd-install:
  64. ${INSTALL_DIR} ${IDIR_UDHCPD}/etc/
  65. ${INSTALL_DATA} ./files/udhcpd.conf ${IDIR_UDHCPD}/etc/
  66. fake: $(TOPDIR)/.busyboxcfg do-configure do-install
  67. include ${TOPDIR}/mk/pkg-bottom.mk