Makefile 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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.22.1
  6. PKG_RELEASE:= 1
  7. PKG_MD5SUM:= 337d1a15ab1cb1d4ed423168b1eb7d7e
  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:= http://www.busybox.net/downloads/
  13. DISTFILES:= ${PKG_NAME}-${PKG_VERSION}.tar.bz2
  14. include $(TOPDIR)/mk/package.mk
  15. $(eval $(call PKG_template,BUSYBOX,busybox,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  16. CONFIG_STYLE:= manual
  17. BUILD_STYLE:= manual
  18. INSTALL_STYLE:= manual
  19. BB_MAKE_FLAGS:= V=1 \
  20. ARCH="${ADK_TARGET_ARCH}" \
  21. IPKG_ARCH="${ADK_TARGET_CPU_ARCH}" \
  22. HOSTCC="${CC_FOR_BUILD}" \
  23. HOSTCFLAGS="$(CFLAGS_FOR_BUILD)" \
  24. CROSS_COMPILE="$(TARGET_CROSS)"
  25. do-configure:
  26. # get all symbols from top level config
  27. grep BUSYBOX_ $(TOPDIR)/.config|sed -e 's/BUSYBOX_/CONFIG_/' > \
  28. ${WRKBUILD}/.config
  29. # remove all disabled symbols
  30. for i in $$(grep "BUSYBOX_DISABLE" $(TOPDIR)/.config);do \
  31. test -s "$$i" || continue; \
  32. grep -v $${i#BUSYBOX_DISABLE} ${WRKBUILD}/.config > \
  33. ${WRKBUILD}/.config.tmp; \
  34. cp ${WRKBUILD}/.config.tmp ${WRKBUILD}/.config; \
  35. done
  36. $(SED) 's;@IDIR@;${WRKINST};' ${WRKBUILD}/.config
  37. yes '' | PATH='$(HOST_PATH)' $(MAKE) ${BB_MAKE_FLAGS} -C ${WRKBUILD} oldconfig $(MAKE_TRACE)
  38. do-build:
  39. PATH='$(HOST_PATH)' $(MAKE) ${BB_MAKE_FLAGS} -C ${WRKBUILD} busybox
  40. BBDEFS:=(
  41. define BBDEF
  42. ifeq ($(ADK_RUNTIME_START_BUSYBOX_$(1)),y)
  43. BBDEFS+=echo BBDEF_$(1)=YES;
  44. else
  45. BBDEFS+=echo BBDEF_$(1)=NO;
  46. endif
  47. endef
  48. $(foreach OPTION,CROND WATCHDOG SYSLOGD INETD NTPD,$(eval $(call BBDEF,$(OPTION))))
  49. do-install:
  50. PATH='$(HOST_PATH)' $(MAKE) ${BB_MAKE_FLAGS} -C ${WRKBUILD} install $(MAKE_TRACE)
  51. $(CP) $(WRKINST)/* $(IDIR_BUSYBOX)/
  52. $(INSTALL_DIR) $(IDIR_BUSYBOX)/etc
  53. ${BBDEFS} :) >$(IDIR_BUSYBOX)/etc/.bb_defaults
  54. ifeq ($(BUSYBOX_IFUPDOWN),y)
  55. $(INSTALL_DIR) $(IDIR_BUSYBOX)/etc/init.d
  56. $(INSTALL_BIN) ./files/network $(IDIR_BUSYBOX)/etc/init.d
  57. endif
  58. ifeq ($(ADK_DEBUG),y)
  59. ${INSTALL_BIN} $(WRKBUILD)/busybox_unstripped \
  60. $(IDIR_BUSYBOX)/bin/busybox
  61. endif
  62. ifneq ($(strip ${ADK_PACKAGE_CFGFS}),)
  63. cd ${IDIR_BUSYBOX}/sbin && rm -f halt poweroff reboot
  64. endif
  65. include ${TOPDIR}/mk/pkg-bottom.mk