Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 $(ADK_TOPDIR)/rules.mk
  4. include Makefile.inc
  5. include ../rules.mk
  6. include $(ADK_TOPDIR)/mk/buildhlp.mk
  7. ifeq ($(ADK_TOOLCHAIN_BINUTILS_GIT),y)
  8. BINUTILS_VERSION:= git
  9. BFDLIB:= .libs/libbfd.a
  10. endif
  11. ifeq ($(ADK_TOOLCHAIN_BINUTILS_2_43),y)
  12. BINUTILS_VERSION:= 2.43
  13. BFDLIB:= .libs/libbfd.a
  14. endif
  15. ifeq ($(ADK_TOOLCHAIN_BINUTILS_2_42),y)
  16. BINUTILS_VERSION:= 2.42
  17. BFDLIB:= .libs/libbfd.a
  18. endif
  19. ifeq ($(ADK_TOOLCHAIN_BINUTILS_2_41),y)
  20. BINUTILS_VERSION:= 2.41
  21. BFDLIB:= .libs/libbfd.a
  22. endif
  23. ifeq ($(ADK_TOOLCHAIN_BINUTILS_2_40),y)
  24. BINUTILS_VERSION:= 2.40
  25. BFDLIB:= libbfd.a
  26. endif
  27. ifeq ($(ADK_TOOLCHAIN_BINUTILS_2_39),y)
  28. BINUTILS_VERSION:= 2.39
  29. BFDLIB:= libbfd.a
  30. endif
  31. ifeq ($(ADK_TOOLCHAIN_BINUTILS_2_28),y)
  32. BINUTILS_VERSION:= 2.28
  33. BFDLIB:= libbfd.a
  34. endif
  35. $(WRKBUILD)/.configured:
  36. (cd $(WRKBUILD); PATH='${HOST_PATH}' autoreconf -vif;)
  37. (cd $(WRKBUILD); \
  38. CPPFLAGS="-idirafter $(ADK_TOPDIR)/adk/include" \
  39. ./configure --prefix=$(STAGING_HOST_DIR)/usr \
  40. --target=$(GNU_TARGET_NAME) \
  41. --with-bfd-include-dir=$(TOOLCHAIN_BUILD_DIR)/w-binutils-$(BINUTILS_VERSION)-1/binutils-$(BINUTILS_VERSION)/bfd \
  42. --with-binutils-include-dir=$(TOOLCHAIN_BUILD_DIR)/w-binutils-$(BINUTILS_VERSION)-1/binutils-$(BINUTILS_VERSION)/include \
  43. --with-libbfd=$(TOOLCHAIN_BUILD_DIR)/w-binutils-$(BINUTILS_VERSION)-1/binutils-$(BINUTILS_VERSION)/bfd/$(BFDLIB) \
  44. --with-libiberty=$(TOOLCHAIN_BUILD_DIR)/w-binutils-$(BINUTILS_VERSION)-1/binutils-$(BINUTILS_VERSION)/libiberty/libiberty.a )
  45. touch $@
  46. $(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
  47. $(MAKE) -C $(WRKBUILD) all
  48. touch $@
  49. $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
  50. $(INSTALL_BIN) $(WRKBUILD)/elf2flt $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin
  51. $(INSTALL_BIN) $(WRKBUILD)/flthdr $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin
  52. $(INSTALL_BIN) $(WRKBUILD)/ld-elf2flt $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin
  53. $(INSTALL_DATA) $(WRKBUILD)/elf2flt.ld $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/lib
  54. rm $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-ld $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin/ld
  55. (cd $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin \
  56. && ln -sf ld.bfd ld.real \
  57. && ln -sf ld-elf2flt ld \
  58. )
  59. (cd $(TOOLCHAIN_DIR)/usr/bin && \
  60. ln -sf ../$(GNU_TARGET_NAME)/bin/elf2flt $(GNU_TARGET_NAME)-elf2flt && \
  61. ln -sf ../$(GNU_TARGET_NAME)/bin/flthdr $(GNU_TARGET_NAME)-flthdr && \
  62. ln -sf ../$(GNU_TARGET_NAME)/bin/ld-elf2flt $(GNU_TARGET_NAME)-ld-elf2flt && \
  63. ln -sf ../$(GNU_TARGET_NAME)/bin/ld-elf2flt $(GNU_TARGET_NAME)-ld )
  64. (cd $(TOOLCHAIN_DIR)/usr/bin/ && ln -sf $(GNU_TARGET_NAME)-ld.bfd $(GNU_TARGET_NAME)-ld.real )
  65. touch $@
  66. include $(ADK_TOPDIR)/mk/toolchain.mk