2 .if !targets(__<${_this:T}>__)
5 # Makefile for the compatibility libraries.
6 # - 32-bit compat libraries on some 64-bit architectures
8 .if defined(_LIBCOMPATS)
10 .include <bsd.compat.mk>
12 .for libcompatidx _LIBCOMPAT libcompat in ${_LIBCOMPATS:range:@i@${i} ${_LIBCOMPATS:[$i]} ${libcompats:[$i]}@}
14 # Yes, the flags are redundant.
15 LIB${_LIBCOMPAT}WMAKEENV+= \
16 INSTALL="${INSTALL_CMD} -U" \
19 LIBDIR=/usr/lib${libcompat} \
20 SHLIBDIR=/usr/lib${libcompat} \
21 LIBDATADIR=/usr/lib${libcompat} \
22 DTRACE="${LIB${_LIBCOMPAT}DTRACE:U${DTRACE}}"
23 .if ${MK_META_MODE} != "no"
24 # Don't rebuild build-tools targets during normal build.
25 LIB${_LIBCOMPAT}WMAKEENV+= BUILD_TOOLS_META=.NOMETA
27 LIB${_LIBCOMPAT}WMAKEFLAGS+= CC=${${XCC} ${LIB${_LIBCOMPAT}CFLAGS}:L:Q} \
28 CXX=${${XCXX} ${LIB${_LIBCOMPAT}CXXFLAGS} ${LIB${_LIBCOMPAT}CFLAGS}:L:Q} \
29 CPP=${${XCPP} ${LIB${_LIBCOMPAT}CFLAGS}:L:Q} \
35 LIB${_LIBCOMPAT}WMAKE+= ${TIME_ENV} ${LIB${_LIBCOMPAT}WMAKEENV} ${MAKE} \
36 ${LIB${_LIBCOMPAT}WMAKEFLAGS} \
37 OBJTOP=${LIB${_LIBCOMPAT}_OBJTOP} \
38 OBJROOT='$${OBJTOP}/' \
39 UNIVERSE_TOOLCHAIN_PATH=${UNIVERSE_TOOLCHAIN_PATH} \
43 LIB${_LIBCOMPAT}IMAKE+= ${LIB${_LIBCOMPAT}WMAKE:NINSTALL=*:NDESTDIR=*} \
48 build${libcompat}: .PHONY
50 @echo "--------------------------------------------------------------"
51 @echo ">>> stage 4.3.${libcompatidx}: building lib${libcompat} shim libraries"
52 @echo "--------------------------------------------------------------"
53 ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
54 -p ${WORLDTMP}/usr >/dev/null
55 .if ${MK_DEBUG_FILES} != "no"
56 ${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
57 -p ${WORLDTMP}/usr/lib/debug/usr >/dev/null
59 ${_+_}cd ${.CURDIR}; \
60 WORLDTMP=${WORLDTMP} \
61 MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \
62 ${MAKE} -f Makefile.inc1 \
64 OBJTOP=${LIB${_LIBCOMPAT}_OBJTOP} \
65 OBJROOT='$${OBJTOP}/' \
66 UNIVERSE_TOOLCHAIN_PATH=${UNIVERSE_TOOLCHAIN_PATH} \
77 ${_+_}cd ${.CURDIR}; \
78 ${LIB${_LIBCOMPAT}WMAKE} -f Makefile.inc1 -DNO_FSCHG libraries
80 distribute${libcompat} install${libcompat}: .PHONY
81 ${_+_}cd ${.CURDIR}; \
82 ${LIB${_LIBCOMPAT}IMAKE} -f Makefile.inc1 _lc_${.TARGET:S/${libcompat}$//}
84 .endfor # libcompatidx _LIBCOMPAT libcompat
86 .endif # defined(_LIBCOMPATS)
88 # These depend on MK_*, which could vary between the native and compat
89 # architectures. Thus targets using them are run within a compat sub-make
90 # rather than the native make environment.
93 _LC_LIBDIRS.yes+= gnu/lib
94 _LC_LIBDIRS.${MK_CDDL:tl}+= cddl/lib
95 _LC_LIBDIRS.${MK_CRYPT:tl}+= secure/lib
96 _LC_LIBDIRS.${MK_KERBEROS:tl}+= kerberos5/lib
98 .if ${MK_FILE} != "no"
99 _libmagic= lib/libmagic
101 .if ${MK_PMC} != "no"
102 _jevents= lib/libpmc/pmu-events
106 .for _dir in lib/ncurses/tinfo ${_libmagic} ${_jevents}
107 .for _t in ${_obj} build-tools
108 ${_+_}cd ${.CURDIR}/${_dir}; ${MAKE} DIRPRFX=${_dir}/ ${_t}
112 _lc_distribute _lc_install:
113 .for _dir in ${_LC_LIBDIRS.yes}
114 ${_+_}cd ${.CURDIR}/${_dir}; ${MAKE} ${.TARGET:S/^_lc_//}
117 .endif # !targets(__<${_this:T}>__)