Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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),microblazeel)
  14. REAL_GNU_TARGET_NAME:= $(subst microblazeel,microblaze,$(REAL_GNU_TARGET_NAME))
  15. endif
  16. $(WRKBUILD)/.headers:
  17. (cd $(WRKBUILD); CC='$(TARGET_CC)' CROSS_COMPILE='$(TARGET_CROSS)' \
  18. ./configure --prefix=/usr \
  19. --target=$(REAL_GNU_TARGET_NAME) \
  20. --disable-gcc-wrapper \
  21. )
  22. $(MAKE) -C $(WRKBUILD) DESTDIR=$(STAGING_TARGET_DIR) install-headers
  23. touch $(WRKBUILD)/.configured
  24. touch $@
  25. $(WRKBUILD)/.compiled:
  26. $(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) all
  27. touch $@
  28. $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
  29. $(MAKE) -C $(WRKBUILD) DESTDIR=$(STAGING_TARGET_DIR) install
  30. touch $@
  31. $(WRKBUILD)/.fixup:
  32. # reconfigure musl, otherwise linking with libgcc or libgcc_eh is disabled
  33. $(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) clean
  34. (cd $(WRKBUILD); CC='$(TARGET_CC)' CROSS_COMPILE='$(TARGET_CROSS)' \
  35. ./configure --prefix=/usr \
  36. --target=$(REAL_GNU_TARGET_NAME) \
  37. --disable-gcc-wrapper \
  38. )
  39. $(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) all
  40. $(MAKE) -C $(WRKBUILD) DESTDIR=$(STAGING_TARGET_DIR) install
  41. touch $@
  42. include ${TOPDIR}/mk/toolchain.mk