Makefile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. # reconfigure musl, otherwise linking with libgcc or libgcc_eh is disabled
  30. $(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) clean
  31. (cd $(WRKBUILD); CC='$(TARGET_CC)' CROSS_COMPILE='$(TARGET_CROSS)' \
  32. ./configure --prefix=/usr \
  33. --target=$(REAL_GNU_TARGET_NAME) \
  34. --disable-gcc-wrapper \
  35. )
  36. $(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) all
  37. touch $@
  38. $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
  39. $(MAKE) -C $(WRKBUILD) DESTDIR=$(STAGING_TARGET_DIR) install
  40. touch $@
  41. $(WRKBUILD)/.fixup:
  42. # reconfigure musl, otherwise linking with libgcc or libgcc_eh is disabled
  43. $(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) clean
  44. (cd $(WRKBUILD); CC='$(TARGET_CC)' CROSS_COMPILE='$(TARGET_CROSS)' \
  45. ./configure --prefix=/usr \
  46. --target=$(REAL_GNU_TARGET_NAME) \
  47. --disable-gcc-wrapper \
  48. )
  49. $(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) all
  50. $(MAKE) -C $(WRKBUILD) DESTDIR=$(STAGING_TARGET_DIR) install
  51. touch $@
  52. include ${TOPDIR}/mk/toolchain.mk