Makefile 2.1 KB

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