Makefile 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. # glibc does not compile with Os
  6. TARGET_CFLAGS:=$(subst Os,O2,$(TARGET_CFLAGS))
  7. ifneq ($(ADK_DEBUG),)
  8. TARGET_CFLAGS+=-O2
  9. endif
  10. include Makefile.inc
  11. include ${TOPDIR}/mk/buildhlp.mk
  12. ifeq ($(ADK_TARGET_NO_FPU),y)
  13. GLIBC_CONFOPTS+= --without-fp
  14. endif
  15. ifeq (${ADK_MAKE_PARALLEL},y)
  16. GLIBC_MAKEOPTS+= PARALLELMFLAGS="-j${ADK_MAKE_JOBS}"
  17. endif
  18. GLIBC_BUILD_DIR_INITIAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-headers
  19. GLIBC_BUILD_DIR_FINAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-final
  20. $(WRKBUILD)/.headers_configure:
  21. mkdir -p $(GLIBC_BUILD_DIR_INITIAL)
  22. (cd ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION); \
  23. ln -sf ../../w-glibc-ports-$(GLIBC_PORTS_VERSION)-1/glibc-ports-$(GLIBC_PORTS_VERSION)/ ports);
  24. (cd $(GLIBC_BUILD_DIR_INITIAL); \
  25. ${GLIBC_ENV} \
  26. $(WRKBUILD)/configure \
  27. --prefix=$(TOOLCHAIN_SYSROOT)/usr \
  28. --with-sysroot=$(TOOLCHAIN_SYSROOT) \
  29. ${GLIBC_CONFOPTS} \
  30. );
  31. touch $@
  32. $(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure
  33. mkdir -p $(TOOLCHAIN_SYSROOT)/usr/lib
  34. (cd $(GLIBC_BUILD_DIR_INITIAL); \
  35. ${GLIBC_ENV} \
  36. $(MAKE) ${GLIBC_MAKEOPTS} \
  37. cross-compiling=yes \
  38. install-headers \
  39. );
  40. touch $(TOOLCHAIN_SYSROOT)/usr/include/gnu/stubs.h
  41. touch $@
  42. $(WRKBUILD)/.configured:
  43. mkdir -p $(GLIBC_BUILD_DIR_FINAL)
  44. (cd $(GLIBC_BUILD_DIR_FINAL); \
  45. ${GLIBC_ENV} \
  46. $(WRKBUILD)/configure \
  47. --prefix=/usr \
  48. --enable-shared \
  49. --enable-stackguard-randomization \
  50. ${GLIBC_CONFOPTS} \
  51. );
  52. touch $@
  53. $(WRKBUILD)/.compiled:
  54. ${GLIBC_ENV} $(MAKE) ${GLIBC_MAKEOPTS} -C $(GLIBC_BUILD_DIR_FINAL) all
  55. touch $@
  56. $(WRKBUILD)/.installed:
  57. ${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL) \
  58. install_root=$(STAGING_DIR) install
  59. touch $(STAGING_DIR)/usr/include/gnu/stubs.h
  60. touch $@
  61. include ${TOPDIR}/mk/toolchain.mk