HardenedBSD src tree https://hardenedbsd.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
3.7KB

  1. # $FreeBSD$
  2. .if !targets(__<${_this:T}>__)
  3. __<${_this:T}>__:
  4. # Makefile for the compatibility libraries.
  5. # - 32-bit compat libraries on MIPS, PowerPC, and AMD64.
  6. .include <bsd.compat.mk>
  7. # Yes, the flags are redundant.
  8. LIBCOMPATWMAKEENV+= \
  9. INSTALL="sh ${.CURDIR}/tools/install.sh" \
  10. PATH=${TMPPATH} \
  11. SYSROOT=${LIBCOMPATTMP} \
  12. LIBDIR=/usr/lib${libcompat} \
  13. SHLIBDIR=/usr/lib${libcompat} \
  14. DTRACE="${LIB$COMPATDTRACE:U${DTRACE}}"
  15. .if ${MK_META_MODE} != "no"
  16. # Don't rebuild build-tools targets during normal build.
  17. LIBCOMPATWMAKEENV+= BUILD_TOOLS_META=.NOMETA
  18. .endif
  19. LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCOMPATCFLAGS}" \
  20. CXX="${XCXX} ${LIBCOMPATCXXFLAGS} ${LIBCOMPATCFLAGS}" \
  21. CPP="${XCPP} ${LIBCOMPATCFLAGS}" \
  22. DESTDIR=${LIBCOMPATTMP} \
  23. -DNO_CPU_CFLAGS \
  24. MK_CTF=no \
  25. -DNO_LINT \
  26. MK_CFI=no \
  27. MK_SAFESTACK=no \
  28. MK_SPECTREV1_FIX=no \
  29. MK_RETPOLINE=no \
  30. MK_TESTS=no
  31. LIBCOMPATWMAKE+= ${LIBCOMPATWMAKEENV} ${MAKE} ${LIBCOMPATWMAKEFLAGS} \
  32. OBJTOP=${LIBCOMPAT_OBJTOP} \
  33. OBJROOT='$${OBJTOP}/' \
  34. MAKEOBJDIRPREFIX= \
  35. MK_MAN=no MK_HTML=no \
  36. MK_RETPOLINE=no
  37. LIBCOMPATIMAKE+= ${LIBCOMPATWMAKE:NINSTALL=*:NDESTDIR=*} \
  38. MK_TOOLCHAIN=no \
  39. MK_RETPOLINE=no \
  40. ${IMAKE_INSTALL} \
  41. -DLIBRARIES_ONLY
  42. _LC_LIBDIRS.yes= lib
  43. _LC_LIBDIRS.yes+= gnu/lib
  44. _LC_LIBDIRS.${MK_CDDL:tl}+= cddl/lib
  45. _LC_LIBDIRS.${MK_CRYPT:tl}+= secure/lib
  46. _LC_LIBDIRS.${MK_KERBEROS:tl}+= kerberos5/lib
  47. _LC_INCDIRS= \
  48. include \
  49. lib/ncurses/ncursesw \
  50. ${_LC_LIBDIRS.yes}
  51. .if ${MK_FILE} != "no"
  52. _libmagic= lib/libmagic
  53. .endif
  54. .if ${MK_PMC} != "no" && ${TARGET_ARCH} == "amd64"
  55. _jevents= lib/libpmc/pmu-events
  56. .endif
  57. # Shared logic
  58. build${libcompat}: .PHONY
  59. @echo
  60. @echo "--------------------------------------------------------------"
  61. @echo ">>> stage 4.3: building lib${libcompat} shim libraries"
  62. @echo "--------------------------------------------------------------"
  63. .if !defined(NO_CLEAN)
  64. rm -rf ${LIBCOMPATTMP}
  65. .else
  66. ${_+_}@if [ -e "${LIBCOMPATTMP}" ]; then \
  67. echo ">>> Deleting stale files in build${libcompat} tree..."; \
  68. cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \
  69. DESTDIR=${LIBCOMPATTMP} \
  70. delete-old delete-old-libs >/dev/null; \
  71. fi
  72. .endif # !defined(NO_CLEAN)
  73. mkdir -p ${LIBCOMPATTMP}/usr/include
  74. ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
  75. -p ${LIBCOMPATTMP}/usr >/dev/null
  76. ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
  77. -p ${LIBCOMPATTMP}/usr/include >/dev/null
  78. ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
  79. -p ${LIBCOMPATTMP}/usr >/dev/null
  80. .if ${MK_DEBUG_FILES} != "no"
  81. ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
  82. -p ${LIBCOMPATTMP}/usr/lib >/dev/null
  83. ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
  84. -p ${LIBCOMPATTMP}/usr/lib/debug/usr >/dev/null
  85. .endif
  86. mkdir -p ${WORLDTMP}
  87. ln -sf ${.CURDIR}/sys ${WORLDTMP}
  88. .for _t in ${_obj} includes
  89. .for _dir in ${_LC_INCDIRS}
  90. ${_+_}cd ${.CURDIR}/${_dir}; ${LIBCOMPATWMAKE} MK_INCLUDES=yes \
  91. DIRPRFX=${_dir}/ ${_t}
  92. .endfor
  93. .endfor
  94. .for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw ${_libmagic} ${_jevents}
  95. .for _t in ${_obj} build-tools
  96. ${_+_}cd ${.CURDIR}/${_dir}; \
  97. WORLDTMP=${WORLDTMP} \
  98. MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \
  99. ${MAKE} SSP_CFLAGS= DESTDIR= \
  100. OBJTOP=${LIBCOMPAT_OBJTOP} \
  101. OBJROOT='$${OBJTOP}/' \
  102. MAKEOBJDIRPREFIX= \
  103. DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS \
  104. MK_CTF=no MK_RETPOLINE=no MK_WARNS=no \
  105. ${_t}
  106. .endfor
  107. .endfor
  108. ${_+_}cd ${.CURDIR}; \
  109. ${LIBCOMPATWMAKE} -f Makefile.inc1 -DNO_FSCHG libraries
  110. distribute${libcompat} install${libcompat}: .PHONY
  111. .for _dir in ${_LC_LIBDIRS.yes}
  112. ${_+_}cd ${.CURDIR}/${_dir}; ${LIBCOMPATIMAKE} ${.TARGET:S/${libcompat}$//}
  113. .endfor
  114. .endif # !targets(__<${_this:T}>__)