#!/usr/local/bin/cbsd
#v10.0.4
MYARG=""
MYOPTARG="ver arch target_arch stable"
MYDESC="make delete-old and delete-old-libs for base"
ADDHELP="ver=9_1 for 9.1 ver=. for current.\n\
stable=1 for RELENG_X\n\
destdir= for alternative install path in root dir\n"

. ${subrdir}/nc.subr
readconf buildworld.conf
. ${subrdir}/universe.subr
. ${cbsdinit}

over="${ver}"
oarch="${arch}"

# By default ver=current version
. ${subrdir}/build.subr

init_distcc
init_notify
init_target_arch
init_srcdir
init_supported_arch
init_basedir

[ -n "${destdir}" ] && BASE_DIR="${destdir}"
[ ! -d "${BASE_DIR}" ] && err 1 "${N1_COLOR}No such dir: ${N2_COLOR}${BASE_DIR}${N0_COLOR}"
yes | make -C ${SRC_DIR} DESTDIR="${BASE_DIR}" delete-old delete-old-libs
