Makefile 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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_41),y)
  12. BINUTILS_VERSION:= 2.41
  13. BFDLIB:= .libs/libbfd.a
  14. endif
  15. ifeq ($(ADK_TOOLCHAIN_BINUTILS_2_40),y)
  16. BINUTILS_VERSION:= 2.40
  17. BFDLIB:= libbfd.a
  18. endif
  19. ifeq ($(ADK_TOOLCHAIN_BINUTILS_2_39),y)
  20. BINUTILS_VERSION:= 2.39
  21. BFDLIB:= libbfd.a
  22. endif
  23. ifeq ($(ADK_TOOLCHAIN_BINUTILS_2_28),y)
  24. BINUTILS_VERSION:= 2.28
  25. BFDLIB:= libbfd.a
  26. endif
  27. $(WRKBUILD)/.configured:
  28. (cd $(WRKBUILD); autoreconf -vif;)
  29. (cd $(WRKBUILD); \
  30. CPPFLAGS="-idirafter $(ADK_TOPDIR)/adk/include" \
  31. ./configure --prefix=$(STAGING_HOST_DIR)/usr \
  32. --target=$(GNU_TARGET_NAME) \
  33. --with-bfd-include-dir=$(TOOLCHAIN_BUILD_DIR)/w-binutils-$(BINUTILS_VERSION)-1/binutils-$(BINUTILS_VERSION)/bfd \
  34. --with-binutils-include-dir=$(TOOLCHAIN_BUILD_DIR)/w-binutils-$(BINUTILS_VERSION)-1/binutils-$(BINUTILS_VERSION)/include \
  35. --with-libbfd=$(TOOLCHAIN_BUILD_DIR)/w-binutils-$(BINUTILS_VERSION)-1/binutils-$(BINUTILS_VERSION)/bfd/$(BFDLIB) \
  36. --with-libiberty=$(TOOLCHAIN_BUILD_DIR)/w-binutils-$(BINUTILS_VERSION)-1/binutils-$(BINUTILS_VERSION)/libiberty/libiberty.a )
  37. touch $@
  38. $(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
  39. $(MAKE) -C $(WRKBUILD) all
  40. touch $@
  41. $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
  42. $(INSTALL_BIN) $(WRKBUILD)/elf2flt $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin
  43. $(INSTALL_BIN) $(WRKBUILD)/flthdr $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin
  44. $(INSTALL_BIN) $(WRKBUILD)/ld-elf2flt $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin
  45. $(INSTALL_DATA) $(WRKBUILD)/elf2flt.ld $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/lib
  46. rm $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-ld $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin/ld
  47. (cd $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin \
  48. && ln -sf ld.bfd ld.real \
  49. && ln -sf ld-elf2flt ld \
  50. )
  51. (cd $(TOOLCHAIN_DIR)/usr/bin && \
  52. ln -sf ../$(GNU_TARGET_NAME)/bin/elf2flt $(GNU_TARGET_NAME)-elf2flt && \
  53. ln -sf ../$(GNU_TARGET_NAME)/bin/flthdr $(GNU_TARGET_NAME)-flthdr && \
  54. ln -sf ../$(GNU_TARGET_NAME)/bin/ld-elf2flt $(GNU_TARGET_NAME)-ld-elf2flt && \
  55. ln -sf ../$(GNU_TARGET_NAME)/bin/ld-elf2flt $(GNU_TARGET_NAME)-ld )
  56. (cd $(TOOLCHAIN_DIR)/usr/bin/ && ln -sf $(GNU_TARGET_NAME)-ld.bfd $(GNU_TARGET_NAME)-ld.real )
  57. touch $@
  58. include $(ADK_TOPDIR)/mk/toolchain.mk