1
0

Makefile 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. GNU_TARGET_NAME:= $(subst ppc,powerpc,$(GNU_TARGET_NAME))
  9. endif
  10. $(WRKBUILD)/.headers:
  11. (cd $(WRKBUILD); CC='$(TARGET_CC)' CROSS_COMPILE='$(TARGET_CROSS)' \
  12. CFLAGS='$(TARGET_CFLAGS)' \
  13. ./configure --prefix=/usr \
  14. --target=$(GNU_TARGET_NAME) \
  15. --disable-gcc-wrapper \
  16. )
  17. $(MAKE) -C $(WRKBUILD) DESTDIR=$(STAGING_TARGET_DIR) install-headers
  18. touch $(WRKBUILD)/.configured
  19. touch $@
  20. $(WRKBUILD)/.compiled:
  21. # reconfigure musl, otherwise linking with libgcc or libgcc_eh is disabled
  22. $(MAKE) -C $(WRKBUILD) clean
  23. (cd $(WRKBUILD); CC='$(TARGET_CC)' CROSS_COMPILE='$(TARGET_CROSS)' \
  24. CFLAGS='$(TARGET_CFLAGS)' \
  25. ./configure --prefix=/usr \
  26. --target=$(GNU_TARGET_NAME) \
  27. --disable-gcc-wrapper \
  28. )
  29. $(MAKE) -C $(WRKBUILD) CFLAGS='$(TARGET_CFLAGS)' all
  30. touch $@
  31. $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
  32. $(MAKE) -C $(WRKBUILD) CFLAGS='$(TARGET_CFLAGS)' DESTDIR=$(STAGING_TARGET_DIR) install
  33. touch $@
  34. $(WRKBUILD)/.fixup:
  35. # reconfigure musl, otherwise linking with libgcc or libgcc_eh is disabled
  36. $(MAKE) -C $(WRKBUILD) clean
  37. (cd $(WRKBUILD); CC='$(TARGET_CC)' CROSS_COMPILE='$(TARGET_CROSS)' \
  38. CFLAGS='$(TARGET_CFLAGS)' \
  39. ./configure --prefix=/usr \
  40. --target=$(GNU_TARGET_NAME) \
  41. --disable-gcc-wrapper \
  42. )
  43. $(MAKE) -C $(WRKBUILD) CFLAGS='$(TARGET_CFLAGS)' all
  44. $(MAKE) -C $(WRKBUILD) CFLAGS='$(TARGET_CFLAGS)' DESTDIR=$(STAGING_TARGET_DIR) install
  45. # cleanup toolchain
  46. -find $(STAGING_TARGET_DIR) $(STAGING_HOST_DIR) -name \*.la -delete
  47. ifeq ($(ADK_TOOLCHAIN),y)
  48. # strip target libs and host tools for toolchain builds
  49. PATH="$(TARGET_PATH)" debug='0' prefix='${TARGET_CROSS}' ${BASH} ${SCRIPT_DIR}/rstrip.sh \
  50. $(STAGING_TARGET_DIR) $(TOOLCHAIN_DIR)/usr/lib/gcc/$(GNU_TARGET_NAME)
  51. debug='0' prefix=' ' ${BASH} ${SCRIPT_DIR}/rstrip.sh $(TOOLCHAIN_DIR)/usr/bin
  52. endif
  53. touch $@
  54. include ${TOPDIR}/mk/toolchain.mk