Makefile 2.3 KB

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