Makefile 1.4 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 $(ADK_TOPDIR)/rules.mk
  4. include ../rules.mk
  5. include Makefile.inc
  6. include ${ADK_TOPDIR}/mk/buildhlp.mk
  7. ifeq ($(ADK_TARGET_CPU_ARCH),ppc)
  8. GNU_TARGET_NAME:= $(subst ppc,powerpc,$(GNU_TARGET_NAME))
  9. endif
  10. ifeq ($(ADK_TARGET_CPU_ARCH),ppc64)
  11. GNU_TARGET_NAME:= $(subst ppc64,powerpc64,$(GNU_TARGET_NAME))
  12. endif
  13. ifeq ($(ADK_TARGET_CPU_ARCH),ppc64le)
  14. GNU_TARGET_NAME:= $(subst ppc64le,powerpc64le,$(GNU_TARGET_NAME))
  15. endif
  16. # not yet possible
  17. TARGET_CFLAGS:= $(filter-out -fstack-protector-all,$(TARGET_CFLAGS))
  18. TARGET_LDFLAGS:= $(filter-out -fstack-protector-all,$(TARGET_LDFLAGS))
  19. # don't use fast-math for C library
  20. TARGET_CFLAGS:= $(filter-out -ffast-math,$(TARGET_CFLAGS))
  21. $(WRKBUILD)/.configured:
  22. (cd $(WRKBUILD); PATH='$(HOST_PATH)' \
  23. CROSS_COMPILE='$(TARGET_CROSS)' \
  24. CC='$(TARGET_CC)' \
  25. CFLAGS='$(TARGET_CFLAGS)' \
  26. ./configure --prefix=/usr \
  27. --target=$(GNU_TARGET_NAME) \
  28. --disable-gcc-wrapper \
  29. )
  30. touch $@
  31. $(WRKBUILD)/.compiled:
  32. PATH='$(HOST_PATH)' $(MAKE) -C $(WRKBUILD) \
  33. CC='$(TARGET_CC)' CFLAGS='$(TARGET_CFLAGS)' all
  34. touch $@
  35. $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
  36. PATH='$(HOST_PATH)' $(MAKE) -C $(WRKBUILD) \
  37. CC='$(TARGET_CC)' CFLAGS='$(TARGET_CFLAGS)' DESTDIR=$(STAGING_TARGET_DIR) install
  38. touch $@
  39. include ${ADK_TOPDIR}/mk/toolchain.mk