Makefile 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. # reconfigure musl, otherwise linking with libgcc or libgcc_eh is disabled
  27. $(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) clean
  28. (cd $(WRKBUILD); CC='$(TARGET_CC)' CROSS_COMPILE='$(TARGET_CROSS)' \
  29. ./configure --prefix=/usr \
  30. --target=$(REAL_GNU_TARGET_NAME) \
  31. --disable-gcc-wrapper \
  32. )
  33. $(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) all
  34. $(MAKE) -C $(WRKBUILD) DESTDIR=$(STAGING_TARGET_DIR) install
  35. touch $@
  36. $(WRKBUILD)/.fixup:
  37. touch $@
  38. include ${TOPDIR}/mk/toolchain.mk