Makefile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 $(TOPDIR)/rules.mk
  4. include ../rules.mk
  5. include Makefile.inc
  6. include ${TOPDIR}/mk/buildhlp.mk
  7. ifeq ($(CPU_ARCH),ppc)
  8. REAL_GNU_TARGET_NAME:= $(subst ppc,powerpc,$(REAL_GNU_TARGET_NAME))
  9. endif
  10. ifeq ($(CPU_ARCH),mips64el)
  11. REAL_GNU_TARGET_NAME:= $(subst mips64el,mips,$(REAL_GNU_TARGET_NAME))
  12. endif
  13. ifeq ($(CPU_ARCH),mips64)
  14. REAL_GNU_TARGET_NAME:= $(subst mips64,mips,$(REAL_GNU_TARGET_NAME))
  15. endif
  16. ifeq ($(CPU_ARCH),microblazeel)
  17. REAL_GNU_TARGET_NAME:= $(subst microblazeel,microblaze,$(REAL_GNU_TARGET_NAME))
  18. endif
  19. $(WRKBUILD)/.headers:
  20. (cd $(WRKBUILD); CC='$(TARGET_CC)' CROSS_COMPILE='$(TARGET_CROSS)' \
  21. ./configure --prefix=/usr \
  22. --target=$(REAL_GNU_TARGET_NAME) \
  23. --disable-gcc-wrapper \
  24. )
  25. $(MAKE) -C $(WRKBUILD) DESTDIR=$(STAGING_TARGET_DIR) install-headers
  26. touch $(WRKBUILD)/.configured
  27. touch $@
  28. $(WRKBUILD)/.compiled:
  29. $(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) all
  30. touch $@
  31. $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
  32. $(MAKE) -C $(WRKBUILD) DESTDIR=$(STAGING_TARGET_DIR) install
  33. touch $@
  34. $(WRKBUILD)/.fixup:
  35. # reconfigure musl, otherwise linking with libgcc or libgcc_eh is disabled
  36. $(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) clean
  37. (cd $(WRKBUILD); CC='$(TARGET_CC)' CROSS_COMPILE='$(TARGET_CROSS)' \
  38. ./configure --prefix=/usr \
  39. --target=$(REAL_GNU_TARGET_NAME) \
  40. --disable-gcc-wrapper \
  41. )
  42. $(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) all
  43. $(MAKE) -C $(WRKBUILD) DESTDIR=$(STAGING_TARGET_DIR) install
  44. touch $@
  45. include ${TOPDIR}/mk/toolchain.mk