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