2016-03-12 00:56:33 +01:00
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
.if !targets(__<${_this:T}>__)
|
|
|
|
__<${_this:T}>__:
|
|
|
|
|
|
|
|
# Makefile for the compatibility libraries.
|
2017-01-07 00:30:54 +01:00
|
|
|
# - 32-bit compat libraries on MIPS, PowerPC, and AMD64.
|
2016-03-12 00:56:33 +01:00
|
|
|
|
2019-10-15 23:08:49 +02:00
|
|
|
.include <bsd.compat.mk>
|
2016-06-16 01:58:03 +02:00
|
|
|
|
2016-03-12 00:56:33 +01:00
|
|
|
# Yes, the flags are redundant.
|
2017-11-01 22:22:05 +01:00
|
|
|
LIBCOMPATWMAKEENV+= \
|
2016-03-12 00:56:33 +01:00
|
|
|
INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
|
|
|
PATH=${TMPPATH} \
|
2017-06-19 20:08:20 +02:00
|
|
|
SYSROOT=${LIBCOMPATTMP} \
|
2016-03-12 00:56:33 +01:00
|
|
|
LIBDIR=/usr/lib${libcompat} \
|
|
|
|
SHLIBDIR=/usr/lib${libcompat} \
|
|
|
|
DTRACE="${LIB$COMPATDTRACE:U${DTRACE}}"
|
2016-04-14 23:06:10 +02:00
|
|
|
.if ${MK_META_MODE} != "no"
|
|
|
|
# Don't rebuild build-tools targets during normal build.
|
2017-04-06 20:21:59 +02:00
|
|
|
LIBCOMPATWMAKEENV+= BUILD_TOOLS_META=.NOMETA
|
2016-04-14 23:06:10 +02:00
|
|
|
.endif
|
2016-05-29 08:20:15 +02:00
|
|
|
LIBCOMPATWMAKEFLAGS+= CC="${XCC} ${LIBCOMPATCFLAGS}" \
|
2016-05-29 08:20:36 +02:00
|
|
|
CXX="${XCXX} ${LIBCOMPATCXXFLAGS} ${LIBCOMPATCFLAGS}" \
|
2016-05-29 08:20:15 +02:00
|
|
|
CPP="${XCPP} ${LIBCOMPATCFLAGS}" \
|
2016-03-12 00:56:33 +01:00
|
|
|
DESTDIR=${LIBCOMPATTMP} \
|
|
|
|
-DNO_CPU_CFLAGS \
|
|
|
|
MK_CTF=no \
|
|
|
|
-DNO_LINT \
|
|
|
|
MK_TESTS=no
|
|
|
|
LIBCOMPATWMAKE+= ${LIBCOMPATWMAKEENV} ${MAKE} ${LIBCOMPATWMAKEFLAGS} \
|
2017-11-05 01:11:47 +01:00
|
|
|
OBJTOP=${LIBCOMPAT_OBJTOP} \
|
|
|
|
OBJROOT='$${OBJTOP}/' \
|
2017-11-05 01:11:51 +01:00
|
|
|
MAKEOBJDIRPREFIX= \
|
2016-03-12 00:56:33 +01:00
|
|
|
MK_MAN=no MK_HTML=no
|
2016-04-05 23:12:03 +02:00
|
|
|
LIBCOMPATIMAKE+= ${LIBCOMPATWMAKE:NINSTALL=*:NDESTDIR=*} \
|
2018-08-03 20:52:51 +02:00
|
|
|
${IMAKE_INSTALL} \
|
2016-03-25 20:12:13 +01:00
|
|
|
-DLIBRARIES_ONLY
|
2016-03-12 00:56:33 +01:00
|
|
|
|
2018-07-30 16:28:00 +02:00
|
|
|
_LC_LIBDIRS.yes= lib
|
2018-07-30 16:42:59 +02:00
|
|
|
_LC_LIBDIRS.yes+= gnu/lib
|
2019-06-29 19:01:56 +02:00
|
|
|
_LC_LIBDIRS.yes+= usr.bin/lex/lib
|
2016-03-12 19:41:27 +01:00
|
|
|
_LC_LIBDIRS.${MK_CDDL:tl}+= cddl/lib
|
|
|
|
_LC_LIBDIRS.${MK_CRYPT:tl}+= secure/lib
|
|
|
|
_LC_LIBDIRS.${MK_KERBEROS:tl}+= kerberos5/lib
|
2016-03-12 00:56:33 +01:00
|
|
|
|
2016-03-25 20:12:38 +01:00
|
|
|
_LC_INCDIRS= \
|
|
|
|
include \
|
|
|
|
lib/ncurses/ncursesw \
|
|
|
|
${_LC_LIBDIRS.yes}
|
|
|
|
|
2018-06-15 19:03:57 +02:00
|
|
|
.if ${MK_FILE} != "no"
|
|
|
|
_libmagic= lib/libmagic
|
|
|
|
.endif
|
2018-06-15 18:48:09 +02:00
|
|
|
.if ${MK_PMC} != "no" && ${TARGET_ARCH} == "amd64"
|
|
|
|
_jevents= lib/libpmc/pmu-events
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
2016-03-12 00:56:33 +01:00
|
|
|
# Shared logic
|
|
|
|
build${libcompat}: .PHONY
|
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2019-10-15 23:22:13 +02:00
|
|
|
@echo ">>> stage 4.3: building lib${libcompat} shim libraries"
|
2016-03-12 00:56:33 +01:00
|
|
|
@echo "--------------------------------------------------------------"
|
2017-10-29 02:21:02 +01:00
|
|
|
.if !defined(NO_CLEAN)
|
|
|
|
rm -rf ${LIBCOMPATTMP}
|
|
|
|
.else
|
2018-06-20 19:20:39 +02:00
|
|
|
${_+_}@if [ -e "${LIBCOMPATTMP}" ]; then \
|
|
|
|
echo ">>> Deleting stale files in build${libcompat} tree..."; \
|
|
|
|
cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \
|
|
|
|
DESTDIR=${LIBCOMPATTMP} \
|
|
|
|
delete-old delete-old-libs >/dev/null; \
|
|
|
|
fi
|
2017-10-29 02:21:02 +01:00
|
|
|
.endif # !defined(NO_CLEAN)
|
|
|
|
|
2016-03-12 00:56:33 +01:00
|
|
|
mkdir -p ${LIBCOMPATTMP}/usr/include
|
2018-06-29 23:15:26 +02:00
|
|
|
${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
2016-03-12 00:56:33 +01:00
|
|
|
-p ${LIBCOMPATTMP}/usr >/dev/null
|
2018-06-29 23:15:26 +02:00
|
|
|
${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
2016-03-12 00:56:33 +01:00
|
|
|
-p ${LIBCOMPATTMP}/usr/include >/dev/null
|
2018-06-29 23:15:26 +02:00
|
|
|
${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
|
2016-03-12 00:56:33 +01:00
|
|
|
-p ${LIBCOMPATTMP}/usr >/dev/null
|
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
2018-06-29 23:15:26 +02:00
|
|
|
${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
|
2016-03-12 00:56:33 +01:00
|
|
|
-p ${LIBCOMPATTMP}/usr/lib >/dev/null
|
2018-06-29 23:15:26 +02:00
|
|
|
${WORLDTMP_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
|
2016-03-12 00:56:33 +01:00
|
|
|
-p ${LIBCOMPATTMP}/usr/lib/debug/usr >/dev/null
|
|
|
|
.endif
|
|
|
|
mkdir -p ${WORLDTMP}
|
|
|
|
ln -sf ${.CURDIR}/sys ${WORLDTMP}
|
2017-05-09 22:21:38 +02:00
|
|
|
.for _t in ${_obj} includes
|
2016-03-25 20:12:38 +01:00
|
|
|
.for _dir in ${_LC_INCDIRS}
|
2016-03-31 19:27:14 +02:00
|
|
|
${_+_}cd ${.CURDIR}/${_dir}; ${LIBCOMPATWMAKE} MK_INCLUDES=yes \
|
|
|
|
DIRPRFX=${_dir}/ ${_t}
|
2016-03-12 00:56:33 +01:00
|
|
|
.endfor
|
|
|
|
.endfor
|
2018-06-15 19:03:57 +02:00
|
|
|
.for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw ${_libmagic} ${_jevents}
|
2018-06-15 20:50:24 +02:00
|
|
|
.for _t in ${_obj} build-tools
|
2016-03-12 00:56:33 +01:00
|
|
|
${_+_}cd ${.CURDIR}/${_dir}; \
|
|
|
|
WORLDTMP=${WORLDTMP} \
|
|
|
|
MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \
|
2017-11-05 01:11:47 +01:00
|
|
|
${MAKE} SSP_CFLAGS= DESTDIR= \
|
2017-11-02 19:08:36 +01:00
|
|
|
OBJTOP=${LIBCOMPAT_OBJTOP} \
|
|
|
|
OBJROOT='$${OBJTOP}/' \
|
2017-11-05 01:11:51 +01:00
|
|
|
MAKEOBJDIRPREFIX= \
|
2018-11-03 20:31:11 +01:00
|
|
|
DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS \
|
|
|
|
MK_CTF=no MK_RETPOLINE=no MK_WARNS=no \
|
2018-06-15 20:50:24 +02:00
|
|
|
${_t}
|
|
|
|
.endfor
|
2016-03-12 00:56:33 +01:00
|
|
|
.endfor
|
|
|
|
${_+_}cd ${.CURDIR}; \
|
|
|
|
${LIBCOMPATWMAKE} -f Makefile.inc1 -DNO_FSCHG libraries
|
|
|
|
|
|
|
|
distribute${libcompat} install${libcompat}: .PHONY
|
|
|
|
.for _dir in ${_LC_LIBDIRS.yes}
|
|
|
|
${_+_}cd ${.CURDIR}/${_dir}; ${LIBCOMPATIMAKE} ${.TARGET:S/${libcompat}$//}
|
|
|
|
.endfor
|
|
|
|
|
2019-11-07 23:58:10 +01:00
|
|
|
.endif # !targets(__<${_this:T}>__)
|