1
0

Makefile 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. endif
  10. ifeq ($(ADK_TOOLCHAIN_BINUTILS_2_22),y)
  11. BINUTILS_VERSION:= 2.22
  12. endif
  13. ifeq ($(ADK_TOOLCHAIN_BINUTILS_2_24),y)
  14. BINUTILS_VERSION:= 2.24
  15. endif
  16. ifeq ($(ADK_TOOLCHAIN_BINUTILS_2_25),y)
  17. BINUTILS_VERSION:= 2.25
  18. endif
  19. ifeq ($(ADK_TOOLCHAIN_BINUTILS_2_25_1),y)
  20. BINUTILS_VERSION:= 2.25.1
  21. endif
  22. ifeq ($(ADK_TOOLCHAIN_BINUTILS_2_26),y)
  23. BINUTILS_VERSION:= 2.26
  24. endif
  25. $(WRKBUILD)/.configured:
  26. (cd $(WRKBUILD); \
  27. CPPFLAGS="-idirafter $(ADK_TOPDIR)/adk/include" \
  28. ./configure --prefix=$(STAGING_HOST_DIR)/usr \
  29. --target=$(GNU_TARGET_NAME) \
  30. --with-bfd-include-dir=$(TOOLCHAIN_BUILD_DIR)/w-binutils-$(BINUTILS_VERSION)-1/binutils-$(BINUTILS_VERSION)/bfd \
  31. --with-binutils-include-dir=$(TOOLCHAIN_BUILD_DIR)/w-binutils-$(BINUTILS_VERSION)-1/binutils-$(BINUTILS_VERSION)/include \
  32. --with-libbfd=$(TOOLCHAIN_BUILD_DIR)/w-binutils-$(BINUTILS_VERSION)-1/binutils-$(BINUTILS_VERSION)/bfd/libbfd.a \
  33. --with-libiberty=$(TOOLCHAIN_BUILD_DIR)/w-binutils-$(BINUTILS_VERSION)-1/binutils-$(BINUTILS_VERSION)/libiberty/libiberty.a )
  34. touch $@
  35. $(WRKBUILD)/.compiled: $(WRKBUILD)/.configured
  36. $(MAKE) -C $(WRKBUILD) all
  37. touch $@
  38. $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
  39. $(INSTALL_BIN) $(WRKBUILD)/elf2flt $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin
  40. $(INSTALL_BIN) $(WRKBUILD)/flthdr $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin
  41. $(INSTALL_BIN) $(WRKBUILD)/ld-elf2flt $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin
  42. $(INSTALL_DATA) $(WRKBUILD)/elf2flt.ld $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/lib
  43. rm $(TOOLCHAIN_DIR)/usr/bin/$(GNU_TARGET_NAME)-ld $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin/ld
  44. (cd $(TOOLCHAIN_DIR)/usr/$(GNU_TARGET_NAME)/bin \
  45. && ln -sf ld.bfd ld.real \
  46. && ln -sf ld-elf2flt ld \
  47. )
  48. (cd $(TOOLCHAIN_DIR)/usr/bin && \
  49. ln -sf ../$(GNU_TARGET_NAME)/bin/elf2flt $(GNU_TARGET_NAME)-elf2flt && \
  50. ln -sf ../$(GNU_TARGET_NAME)/bin/flthdr $(GNU_TARGET_NAME)-flthdr && \
  51. ln -sf ../$(GNU_TARGET_NAME)/bin/ld-elf2flt $(GNU_TARGET_NAME)-ld-elf2flt && \
  52. ln -sf ../$(GNU_TARGET_NAME)/bin/ld-elf2flt $(GNU_TARGET_NAME)-ld )
  53. (cd $(TOOLCHAIN_DIR)/usr/bin/ && ln -sf $(GNU_TARGET_NAME)-ld.bfd $(GNU_TARGET_NAME)-ld.real )
  54. touch $@
  55. include $(ADK_TOPDIR)/mk/toolchain.mk