Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. $(WRKBUILD)/.headers:
  14. (cd $(WRKBUILD); CC='$(TARGET_CC)' CROSS_COMPILE='$(TARGET_CROSS)' \
  15. ./configure --prefix=/usr \
  16. --target=$(REAL_GNU_TARGET_NAME) \
  17. --disable-gcc-wrapper \
  18. )
  19. $(MAKE) -C $(WRKBUILD) DESTDIR=$(STAGING_TARGET_DIR) install-headers
  20. touch $(WRKBUILD)/.configured
  21. touch $@
  22. $(WRKBUILD)/.compiled:
  23. $(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) all
  24. touch $@
  25. $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
  26. $(MAKE) -C $(WRKBUILD) DESTDIR=$(STAGING_TARGET_DIR) install
  27. touch $@
  28. $(WRKBUILD)/.fixup:
  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. $(MAKE) -C $(WRKBUILD) DESTDIR=$(STAGING_TARGET_DIR) install
  38. touch $@
  39. include ${TOPDIR}/mk/toolchain.mk