1
0

Makefile 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. #
  2. # Copyright (C) 2006-2013 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=binutils
  9. PKG_VERSION:=2.40
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_URL:=@GNU/binutils
  12. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  13. PKG_VERSION:=$(PKG_VERSION)
  14. PKG_HASH:=0f8a4c272d7f17f369ded10a4aca28b8e304828e95526da482b0ccc4dfc9d8e1
  15. PKG_FIXUP:=patch-libtool
  16. PKG_LIBTOOL_PATHS:=. gas bfd opcodes gprof gprofng binutils ld libiberty gold intl libctf libsframe
  17. PKG_REMOVE_FILES:=libtool.m4
  18. PKG_INSTALL:=1
  19. PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
  20. PKG_LICENSE:=GPL-3.0+
  21. PKG_CPE_ID:=cpe:/a:gnu:binutils
  22. PKG_BUILD_PARALLEL:=1
  23. PKG_BUILD_FLAGS:=no-mips16
  24. include $(INCLUDE_DIR)/nls.mk
  25. include $(INCLUDE_DIR)/package.mk
  26. define Package/libbfd
  27. SECTION:=libs
  28. CATEGORY:=Libraries
  29. TITLE:=libbfd
  30. DEPENDS:=+zlib $(INTL_DEPENDS)
  31. endef
  32. define Package/libctf
  33. SECTION:=libs
  34. CATEGORY:=Libraries
  35. TITLE:=libctf
  36. DEPENDS:=+libbfd
  37. endef
  38. define Package/libopcodes
  39. SECTION:=libs
  40. CATEGORY:=Libraries
  41. TITLE:=libopcodes
  42. DEPENDS:=+libbfd
  43. endef
  44. define Package/binutils
  45. SECTION:=devel
  46. CATEGORY:=Development
  47. TITLE:=binutils
  48. DEPENDS:=+objdump +ar
  49. ALTERNATIVES:=200:/usr/bin/strings:/usr/bin/binutils-strings
  50. endef
  51. define Package/objdump
  52. SECTION:=devel
  53. CATEGORY:=Development
  54. TITLE:=objdump
  55. DEPENDS:=+libopcodes +libctf
  56. endef
  57. define Package/ar
  58. SECTION:=devel
  59. CATEGORY:=Development
  60. TITLE:=ar
  61. DEPENDS:=+zlib +libbfd
  62. endef
  63. define Package/binutils/description
  64. The Binutils package contains a linker, an assembler, and other tools for handling object files
  65. endef
  66. TARGET_CFLAGS += $(FPIC) -Wno-unused-value
  67. TARGET_LDFLAGS += $(if $(INTL_FULL),-lintl)
  68. CONFIGURE_ARGS += \
  69. --host=$(REAL_GNU_TARGET_NAME) \
  70. --target=$(REAL_GNU_TARGET_NAME) \
  71. --enable-shared \
  72. --enable-install-libiberty \
  73. --enable-install-libbfd \
  74. --enable-install-libctf \
  75. --with-system-zlib \
  76. --without-zstd \
  77. --without-msgpack \
  78. --disable-gprofng
  79. define Build/Install
  80. $(call Build/Install/Default)
  81. $(MAKE) -C $(PKG_BUILD_DIR)/libiberty \
  82. target_header_dir=libiberty \
  83. DESTDIR="$(PKG_INSTALL_DIR)" \
  84. MULTIOSDIR="" \
  85. install
  86. endef
  87. define Build/InstallDev
  88. $(CP) $(PKG_INSTALL_DIR)/* $(1)/
  89. endef
  90. define Package/libbfd/install
  91. $(INSTALL_DIR) $(1)/usr/lib
  92. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libbfd*.so* $(1)/usr/lib/
  93. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsframe*.so* $(1)/usr/lib/
  94. endef
  95. define Package/libctf/install
  96. $(INSTALL_DIR) $(1)/usr/lib
  97. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libctf*.so* $(1)/usr/lib/
  98. endef
  99. define Package/libopcodes/install
  100. $(INSTALL_DIR) $(1)/usr/lib
  101. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopcodes*.so $(1)/usr/lib/
  102. endef
  103. define Package/objdump/install
  104. $(INSTALL_DIR) $(1)/usr/bin
  105. $(CP) $(PKG_INSTALL_DIR)/usr/bin/objdump $(1)/usr/bin/
  106. endef
  107. define Package/ar/install
  108. $(INSTALL_DIR) $(1)/usr/bin
  109. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ar $(1)/usr/bin/
  110. endef
  111. define Package/binutils/install
  112. $(INSTALL_DIR) $(1)/usr $(1)/bin
  113. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
  114. mv $(1)/usr/bin/strings $(1)/usr/bin/binutils-strings
  115. rm -f $(1)/usr/bin/objdump
  116. rm -f $(1)/usr/bin/ar
  117. endef
  118. $(eval $(call BuildPackage,libbfd))
  119. $(eval $(call BuildPackage,libctf))
  120. $(eval $(call BuildPackage,libopcodes))
  121. $(eval $(call BuildPackage,binutils))
  122. $(eval $(call BuildPackage,objdump))
  123. $(eval $(call BuildPackage,ar))