Makefile 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. include ${TOPDIR}/toolchain/binutils/Makefile.inc
  5. PKG_NAME:= binutils
  6. PKG_DESCR:= binary utilities (nm, objdump, as, ..)
  7. PKG_SECTION:= lang
  8. PKG_DEPENDS:= libbfd
  9. PKG_OPTS:= dev
  10. PKG_SUBPKGS:= BINUTILS LIBBFD
  11. PKGSD_LIBBFD:= Binary File Descriptor library
  12. PKGSC_LIBBFD:= libs
  13. PKG_HOST_DEPENDS:= !cygwin
  14. PKG_ARCH_DEPENDS:= !avr32
  15. ifeq ($(ADK_STATIC),y)
  16. PKG_OPTS+= libmix
  17. endif
  18. include ${TOPDIR}/mk/package.mk
  19. $(eval $(call PKG_template,BINUTILS,${PKG_NAME},${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
  20. $(eval $(call PKG_template,LIBBFD,libbfd,${PKG_VERSION}-${PKG_RELEASE},,${PKGSD_LIBBFD},${PKGSC_LIBBFD},${PKG_OPTS}))
  21. ifeq ($(ADK_TARGET_WITH_MULTILIB),y)
  22. CONFIGURE_ARGS+= --enable-multilib
  23. else
  24. CONFIGURE_ARGS+= --disable-multilib
  25. endif
  26. TARGET_CFLAGS:= $(filter-out -flto,$(TARGET_CFLAGS))
  27. TARGET_CFLAGS+= -fPIC
  28. ifeq ($(ADK_NATIVE),)
  29. CONFIGURE_ARGS+= --disable-werror \
  30. --host=$(REAL_GNU_TARGET_NAME) \
  31. --target=$(REAL_GNU_TARGET_NAME)
  32. else
  33. CONFIGURE_ARGS+= --disable-werror
  34. endif
  35. pre-build:
  36. @-rm $(STAGING_TARGET_DIR)/lib/libiberty.a $(STAGING_TARGET_DIR)/usr/lib/libiberty.a
  37. libbfd-install:
  38. ${INSTALL_DIR} ${IDIR_LIBBFD}/usr/lib
  39. $(CP) ${WRKINST}/usr/lib/*.so* ${IDIR_LIBBFD}/usr/lib
  40. binutils-install:
  41. ${INSTALL_DIR} ${IDIR_BINUTILS}/usr/bin
  42. ${INSTALL_BIN} ${WRKINST}/usr/bin/{ar,as,ld,strip,strings,size,nm} \
  43. ${IDIR_BINUTILS}/usr/bin/
  44. ${INSTALL_BIN} ${WRKINST}/usr/bin/{objcopy,ranlib,readelf,objdump} \
  45. ${IDIR_BINUTILS}/usr/bin/
  46. include ${TOPDIR}/mk/pkg-bottom.mk