2008-10-26 10:38:27 +03:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
# generate src/compat/* Makefile's based on SUBDIR values in
|
|
|
|
# the main source tree
|
|
|
|
|
|
|
|
srcdir=/usr/src
|
|
|
|
rwsrcdir=/home/current/src
|
|
|
|
MAKE=${MAKE-make}
|
|
|
|
|
2009-01-19 10:16:38 +03:00
|
|
|
CHECK_SUBDIRS="gnu/lib gnu/lib/libgcc4 lib lib/csu lib/i18n_module external/bsd/atf/lib external/bsd/openldap/lib lib/libpam/modules"
|
2008-10-26 10:38:27 +03:00
|
|
|
# lib/csu is spsecial
|
|
|
|
# lib/libm needs to be special -- i387
|
|
|
|
# gnu/lib/libsupc++ -- fails to get NOPROFILE properly
|
|
|
|
|
|
|
|
for _dir in ${CHECK_SUBDIRS}; do
|
|
|
|
if [ ${_dir} = "lib/csu" ]; then
|
|
|
|
_subdirs="i386_elf sparc_elf"
|
|
|
|
else
|
|
|
|
_subdirs=`cd ${srcdir}/${_dir}; ${MAKE} -V SUBDIR`
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "looking in: $_dir: subdirs $_subdirs"
|
|
|
|
for _sd in $_subdirs; do
|
|
|
|
# skip lib/csu --
|
|
|
|
if [ "$_dir" = "lib" -a "$_sd" = "csu" ]; then
|
|
|
|
continue
|
|
|
|
fi
|
|
|
|
# skip .WAIT --
|
|
|
|
if [ "$_sd" = ".WAIT" ]; then
|
|
|
|
continue
|
|
|
|
fi
|
2008-10-27 06:17:58 +03:00
|
|
|
_libdplibs="`cd ${srcdir}/${_dir}/${_sd}; ${MAKE} -V LIBDPLIBS`"
|
2008-10-26 10:38:27 +03:00
|
|
|
echo "creating stuff for subdir: $_sd"
|
2008-10-27 10:17:05 +03:00
|
|
|
echo " - libdplibs = ${_libdplibs}"
|
2008-10-26 10:38:27 +03:00
|
|
|
mkdir -p ${rwsrcdir}/compat/${_dir}/${_sd}
|
|
|
|
(
|
|
|
|
cat <<'EOF'
|
2009-01-19 10:16:38 +03:00
|
|
|
# $NetBSD: build-makefiles,v 1.5 2009/01/19 07:16:38 jmmv Exp $
|
2008-10-26 10:38:27 +03:00
|
|
|
|
|
|
|
NOLINT= # defined
|
|
|
|
NOMAN= # defined
|
|
|
|
NONLS= # defined
|
|
|
|
NOINFO= # defined
|
|
|
|
NOSHARE= # defined
|
|
|
|
EOF
|
2008-10-27 06:17:58 +03:00
|
|
|
# XXX various hacks
|
|
|
|
case "${_sd}" in
|
|
|
|
libsupc++4)
|
2008-10-26 10:38:27 +03:00
|
|
|
echo "NOPROFILE= # defined"
|
2008-10-27 06:17:58 +03:00
|
|
|
;;
|
|
|
|
libc)
|
|
|
|
echo "# XXX"
|
|
|
|
echo "nsparser.h: nsparser.c"
|
|
|
|
;;
|
|
|
|
libpcap)
|
|
|
|
echo "# XXX"
|
|
|
|
echo "grammar.h: grammar.c"
|
|
|
|
;;
|
2008-10-27 10:17:05 +03:00
|
|
|
libipsec)
|
2008-10-27 06:17:58 +03:00
|
|
|
echo "# XXX"
|
2008-10-27 10:17:05 +03:00
|
|
|
echo "policy_parse.h: policy_parse.c"
|
2008-10-27 06:17:58 +03:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if [ -n "${_libdplibs}" ]; then
|
|
|
|
echo "LIBDPLIBS= ${_libdplibs}"
|
2008-10-26 10:38:27 +03:00
|
|
|
fi
|
|
|
|
cat <<'EOF'
|
|
|
|
|
|
|
|
NOCHECKVER= # defined
|
|
|
|
|
|
|
|
.include <bsd.obj.mk>
|
|
|
|
|
|
|
|
# Resolve pathnames in variables.
|
2008-10-27 10:17:05 +03:00
|
|
|
_RESOLVE_VARS= CFLAGS CPPFLAGS DPADD LDADD LIBDPLIBS LIB_ROOT_DIR
|
2008-10-26 10:38:27 +03:00
|
|
|
.for var in ${_RESOLVE_VARS}
|
|
|
|
${var}:= ${${var}}
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
_CURDIR:= ${.CURDIR}
|
|
|
|
|
|
|
|
EOF
|
|
|
|
printf ".PATH: \${NETBSDSRCDIR}/${_dir}/${_sd}\n"
|
|
|
|
printf ".CURDIR:=\${NETBSDSRCDIR}/${_dir}/${_sd}\n\n"
|
|
|
|
cat <<'EOF'
|
|
|
|
.include "${NETBSDSRCDIR}/compat/Makefile.compat"
|
|
|
|
.include "${.CURDIR}/Makefile"
|
|
|
|
|
|
|
|
# Resolve pathnames from "real" Makefile, and switch .CURDIR back.
|
|
|
|
_RESOLVE_VARS= CFLAGS CPPFLAGS DPADD LDADD ARCHDIR COMPATDIR COMPATARCHDIR LIBCDIR RPC_INCS RPC_XDIR LIBEDITDIR MODOBJDIR RUMPTOP
|
|
|
|
.for var in ${_RESOLVE_VARS}
|
|
|
|
${var}:= ${${var}}
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.CURDIR:= ${_CURDIR}
|
|
|
|
.undef _CURDIR
|
|
|
|
EOF
|
|
|
|
) > ${rwsrcdir}/compat/${_dir}/${_sd}/Makefile
|
|
|
|
done
|
|
|
|
|
2008-10-27 06:17:58 +03:00
|
|
|
if [ "${_dir}" = "lib" -a "${_sd}" = "csu" ]; then
|
2008-10-26 10:38:27 +03:00
|
|
|
(printf '# $'NetBSD'$\n\n'
|
|
|
|
printf "_CURDIR:= \${.CURDIR}\n\n"
|
2008-10-26 15:58:38 +03:00
|
|
|
printf ".CURDIR:=\${NETBSDSRCDIR}/${_dir}\n\n"
|
|
|
|
printf ".include "'"'"\${.CURDIR}/Makefile"'"'"\n\n"
|
2008-10-26 10:38:27 +03:00
|
|
|
printf ".CURDIR:= \${_CURDIR}\n"
|
2008-10-26 15:58:38 +03:00
|
|
|
) > ${rwsrcdir}/compat/${_dir}/Makefile
|
|
|
|
|
|
|
|
if [ -f "${srcdir}/${_dir}/Makefile.inc" ]; then
|
|
|
|
(printf '# $'NetBSD'$\n\n'
|
|
|
|
printf "_CURDIR:= \${.CURDIR}\n\n"
|
|
|
|
printf ".include "'"'"\${NETBSDSRCDIR}/${_dir}/Makefile.inc"'"'"\n\n"
|
|
|
|
printf ".CURDIR:= \${_CURDIR}\n"
|
|
|
|
) > ${rwsrcdir}/compat/${_dir}/Makefile.inc
|
|
|
|
fi
|
2008-10-26 10:38:27 +03:00
|
|
|
fi
|
|
|
|
done
|