1# $FreeBSD$ 2 3.if !targets(__<${_this:T}>__) 4__<${_this:T}>__: 5 6# Makefile for the compatibility libraries. 7# - 32-bit compat libraries on PowerPC, and AMD64. 8 9.include <bsd.compat.mk> 10 11# Yes, the flags are redundant. 12LIBCOMPATWMAKEENV+= \ 13 INSTALL="${INSTALL_CMD} -U" \ 14 PATH=${TMPPATH} \ 15 SYSROOT=${WORLDTMP} \ 16 LIBDIR=/usr/lib${libcompat} \ 17 SHLIBDIR=/usr/lib${libcompat} \ 18 LIBDATADIR=/usr/lib${libcompat} \ 19 DTRACE="${LIB$COMPATDTRACE:U${DTRACE}}" 20.if ${MK_META_MODE} != "no" 21# Don't rebuild build-tools targets during normal build. 22LIBCOMPATWMAKEENV+= BUILD_TOOLS_META=.NOMETA 23.endif 24LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCOMPATCFLAGS}" \ 25 CXX="${XCXX} ${LIBCOMPATCXXFLAGS} ${LIBCOMPATCFLAGS}" \ 26 CPP="${XCPP} ${LIBCOMPATCFLAGS}" \ 27 DESTDIR=${WORLDTMP} \ 28 -DNO_CPU_CFLAGS \ 29 MK_BOOT=no \ 30 MK_CTF=no \ 31 MK_TESTS=no 32LIBCOMPATWMAKE+= ${TIME_ENV} ${LIBCOMPATWMAKEENV} ${MAKE} ${LIBCOMPATWMAKEFLAGS} \ 33 OBJTOP=${LIBCOMPAT_OBJTOP} \ 34 OBJROOT='$${OBJTOP}/' \ 35 MAKEOBJDIRPREFIX= \ 36 MK_MAN=no MK_HTML=no 37LIBCOMPATIMAKE+= ${LIBCOMPATWMAKE:NINSTALL=*:NDESTDIR=*} \ 38 ${IMAKE_INSTALL} \ 39 MK_INCLUDES=no \ 40 -DLIBRARIES_ONLY 41 42# Shared logic 43build${libcompat}: .PHONY 44 @echo 45 @echo "--------------------------------------------------------------" 46 @echo ">>> stage 4.3: building lib${libcompat} shim libraries" 47 @echo "--------------------------------------------------------------" 48 ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \ 49 -p ${WORLDTMP}/usr >/dev/null 50.if ${MK_DEBUG_FILES} != "no" 51 ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \ 52 -p ${WORLDTMP}/usr/lib/debug/usr >/dev/null 53.endif 54 ${_+_}cd ${.CURDIR}; \ 55 WORLDTMP=${WORLDTMP} \ 56 MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \ 57 ${MAKE} -f Makefile.inc1 \ 58 DESTDIR= \ 59 OBJTOP=${LIBCOMPAT_OBJTOP} \ 60 OBJROOT='$${OBJTOP}/' \ 61 MAKEOBJDIRPREFIX= \ 62 -DNO_LINT \ 63 -DNO_CPU_CFLAGS \ 64 MK_ASAN=no \ 65 MK_CTF=no \ 66 MK_RETPOLINE=no \ 67 MK_SSP=no \ 68 MK_UBSAN=no \ 69 MK_WERROR=no \ 70 _lc_build-tools 71 ${_+_}cd ${.CURDIR}; \ 72 ${LIBCOMPATWMAKE} -f Makefile.inc1 -DNO_FSCHG libraries 73 74distribute${libcompat} install${libcompat}: .PHONY 75 ${_+_}cd ${.CURDIR}; \ 76 ${LIBCOMPATIMAKE} -f Makefile.inc1 _lc_${.TARGET:S/${libcompat}$//} 77 78# These depend on MK_*, which could vary between the native and compat 79# architectures. Thus targets using them are run within a compat sub-make 80# rather than the native make environment. 81 82_LC_LIBDIRS.yes= lib 83_LC_LIBDIRS.yes+= gnu/lib 84_LC_LIBDIRS.${MK_CDDL:tl}+= cddl/lib 85_LC_LIBDIRS.${MK_CRYPT:tl}+= secure/lib 86_LC_LIBDIRS.${MK_KERBEROS:tl}+= kerberos5/lib 87 88.if ${MK_FILE} != "no" 89_libmagic= lib/libmagic 90.endif 91.if ${MK_PMC} != "no" 92_jevents= lib/libpmc/pmu-events 93.endif 94 95_lc_build-tools: 96.for _dir in lib/ncurses/tinfo ${_libmagic} ${_jevents} 97.for _t in ${_obj} build-tools 98 ${_+_}cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ ${_t} 99.endfor 100.endfor 101 102_lc_distribute _lc_install: 103.for _dir in ${_LC_LIBDIRS.yes} 104 ${_+_}cd ${.CURDIR}/${_dir}; ${MAKE} ${.TARGET:S/^_lc_//} 105.endfor 106 107.endif # !targets(__<${_this:T}>__) 108