Makefile 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. # ssp partially supported
  11. TARGET_CFLAGS:= $(filter-out -fstack-protector,$(TARGET_CFLAGS))
  12. #TARGET_CFLAGS:= $(filter-out -flto,$(TARGET_CFLAGS))
  13. include Makefile.inc
  14. include ${TOPDIR}/mk/buildhlp.mk
  15. ifeq ($(ADK_TARGET_NO_FPU),y)
  16. GLIBC_CONFOPTS+= --without-fp
  17. endif
  18. GLIBC_MAKEOPTS+= cross-compiling=yes
  19. ifeq (${ADK_MAKE_PARALLEL},y)
  20. GLIBC_MAKEOPTS+= PARALLELMFLAGS="-j1"
  21. endif
  22. GLIBC_BUILD_DIR_INITIAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-headers
  23. GLIBC_BUILD_DIR_FINAL:= ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-final
  24. $(WRKBUILD)/.headers_configure:
  25. mkdir -p $(GLIBC_BUILD_DIR_INITIAL)
  26. (cd ${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION); \
  27. ln -sf ../../w-glibc-ports-$(PKG_VERSION)-1/glibc-ports-$(PKG_VERSION)/ ports);
  28. (cd $(GLIBC_BUILD_DIR_INITIAL); \
  29. ${GLIBC_ENV} \
  30. $(WRKBUILD)/configure \
  31. --prefix=$(STAGING_TARGET_DIR)/usr \
  32. --with-sysroot=$(STAGING_TARGET_DIR) \
  33. ${GLIBC_CONFOPTS} \
  34. );
  35. touch $@
  36. $(WRKBUILD)/.headers: $(WRKBUILD)/.headers_configure
  37. (cd $(GLIBC_BUILD_DIR_INITIAL); \
  38. ${GLIBC_ENV} \
  39. $(MAKE) ${GLIBC_MAKEOPTS} \
  40. install-headers \
  41. );
  42. touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h
  43. touch $@
  44. $(WRKBUILD)/.configured:
  45. mkdir -p $(GLIBC_BUILD_DIR_FINAL)
  46. (cd $(GLIBC_BUILD_DIR_FINAL); \
  47. ${GLIBC_ENV} \
  48. $(WRKBUILD)/configure \
  49. --prefix=/usr \
  50. --enable-shared \
  51. --enable-stackguard-randomization \
  52. ${GLIBC_CONFOPTS} \
  53. );
  54. touch $@
  55. $(WRKBUILD)/.compiled:
  56. ${GLIBC_ENV} $(MAKE) ${GLIBC_MAKEOPTS} -C $(GLIBC_BUILD_DIR_FINAL) all
  57. touch $@
  58. $(WRKBUILD)/.installed:
  59. ${GLIBC_ENV} $(MAKE) -C $(GLIBC_BUILD_DIR_FINAL) \
  60. install_root=$(STAGING_TARGET_DIR) install
  61. mkdir -p ${STAGING_TARGET_DIR}/etc
  62. ${INSTALL_DATA} ${WRKBUILD}/posix/gai.conf ${STAGING_TARGET_DIR}/etc
  63. ${INSTALL_DATA} ${WRKBUILD}/nscd/nscd.conf ${STAGING_TARGET_DIR}/etc
  64. ${INSTALL_DATA} ${WRKBUILD}/nss/nsswitch.conf ${STAGING_TARGET_DIR}/etc
  65. touch $(STAGING_TARGET_DIR)/usr/include/gnu/stubs.h
  66. touch $@
  67. include ${TOPDIR}/mk/toolchain.mk