From f9e2534d8b87007bbfdc0dfccb5d7f4ce18bbfc6 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Fri, 21 Sep 2001 11:32:51 +0000 Subject: [PATCH] Replace our stale-lib cleanup with a better one. (less bloated) --- lib/compat/Makefile.inc | 10 ++++++++++ lib/compat/compat1x/Makefile | 5 ----- lib/compat/compat20/Makefile | 5 ----- lib/compat/compat21/Makefile | 5 ----- lib/compat/compat22/Makefile | 5 ----- lib/compat/compat3x.i386/Makefile | 5 ----- lib/compat/compat4x.alpha/Makefile | 5 ----- lib/compat/compat4x.i386/Makefile | 5 ----- 8 files changed, 10 insertions(+), 35 deletions(-) diff --git a/lib/compat/Makefile.inc b/lib/compat/Makefile.inc index 23e27116dac..99222aa1987 100644 --- a/lib/compat/Makefile.inc +++ b/lib/compat/Makefile.inc @@ -1,3 +1,13 @@ # $FreeBSD$ LIBCOMPATDIR?= ${LIBDIR}/compat/aout + +.if defined(LIBS) && !empty(LIBS) +beforeinstall: __remove-stale-libs +__remove-stale-libs: .PHONY +.for lib in ${LIBS} +.if exists(${DESTDIR}${SHLIBDIR}/${lib}) + rm -f ${DESTDIR}${SHLIBDIR}/${lib} +.endif +.endfor +.endif diff --git a/lib/compat/compat1x/Makefile b/lib/compat/compat1x/Makefile index 15cb674a71a..07be405e869 100644 --- a/lib/compat/compat1x/Makefile +++ b/lib/compat/compat1x/Makefile @@ -22,11 +22,6 @@ ${lib}: ${lib}.gz.uu beforeinstall: ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} ${LIBS} \ ${DESTDIR}${LIBCOMPATDIR}/aout -.for lib in ${LIBS} -.if exists(${DESTDIR}${SHLIBDIR}/${lib}) - rm -f ${DESTDIR}${SHLIBDIR}/${lib} -.endif -.endfor # Get all the fruit, even though we don't set PROG. # XXX bsd.lib.mk has fruitflies, e.g., it fails if LIBS is empty. diff --git a/lib/compat/compat20/Makefile b/lib/compat/compat20/Makefile index 4a4c3566cd0..f416b3381b2 100644 --- a/lib/compat/compat20/Makefile +++ b/lib/compat/compat20/Makefile @@ -19,11 +19,6 @@ beforeinstall: ${DESTDIR}/usr/libexec ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} ${LIBS} \ ${DESTDIR}${LIBCOMPATDIR}/aout -.for lib in ${LIBS} -.if exists(${DESTDIR}${SHLIBDIR}/${lib}) - rm -f ${DESTDIR}${SHLIBDIR}/${lib} -.endif -.endfor # Get all the fruit, even though we don't set PROG. # XXX bsd.lib.mk has fruitflies, e.g., it fails if LIBS is empty. diff --git a/lib/compat/compat21/Makefile b/lib/compat/compat21/Makefile index d56aa88288a..652bbb7252f 100644 --- a/lib/compat/compat21/Makefile +++ b/lib/compat/compat21/Makefile @@ -18,11 +18,6 @@ beforeinstall: ${DESTDIR}/usr/libexec ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} ${LIBS} \ ${DESTDIR}${LIBCOMPATDIR}/aout -.for lib in ${LIBS} -.if exists(${DESTDIR}${SHLIBDIR}/${lib}) - rm -f ${DESTDIR}${SHLIBDIR}/${lib} -.endif -.endfor # Get all the fruit, even though we don't set PROG. # XXX bsd.lib.mk has fruitflies, e.g., it fails if LIBS is empty. diff --git a/lib/compat/compat22/Makefile b/lib/compat/compat22/Makefile index 404a30cdf74..94457f359a9 100644 --- a/lib/compat/compat22/Makefile +++ b/lib/compat/compat22/Makefile @@ -32,11 +32,6 @@ beforeinstall: @${ECHO} "libtermlib.so.2.1 -> libtermcap.so.2.1" ; \ cd ${DESTDIR}${LIBCOMPATDIR}/aout ; \ ln -sf libtermcap.so.2.1 libtermlib.so.2.1 -.for lib in ${LIBS} -.if exists(${DESTDIR}${SHLIBDIR}/${lib}) - rm -f ${DESTDIR}${SHLIBDIR}/${lib} -.endif -.endfor # Get all the fruit, even though we don't set PROG. # XXX bsd.lib.mk has fruitflies, e.g., it fails if LIBS is empty. diff --git a/lib/compat/compat3x.i386/Makefile b/lib/compat/compat3x.i386/Makefile index ee650a292d8..425e93f3983 100644 --- a/lib/compat/compat3x.i386/Makefile +++ b/lib/compat/compat3x.i386/Makefile @@ -22,11 +22,6 @@ ${lib}: ${lib}.gz.uu beforeinstall: ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} ${LIBS} \ ${DESTDIR}${LIBCOMPATDIR} -.for lib in ${LIBS} -.if exists(${DESTDIR}${SHLIBDIR}/${lib}) - rm -f ${DESTDIR}${SHLIBDIR}/${lib} -.endif -.endfor # Get all the fruit, even though we don't set PROG. # XXX bsd.lib.mk has fruitflies, e.g., it fails if LIBS is empty. diff --git a/lib/compat/compat4x.alpha/Makefile b/lib/compat/compat4x.alpha/Makefile index c01909aaf18..29a3fd8e2c9 100644 --- a/lib/compat/compat4x.alpha/Makefile +++ b/lib/compat/compat4x.alpha/Makefile @@ -22,11 +22,6 @@ ${lib}: ${lib}.gz.uu beforeinstall: ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} ${LIBS} \ ${DESTDIR}${LIBCOMPATDIR} -.for lib in ${LIBS} -.if exists(${DESTDIR}${SHLIBDIR}/${lib}) - rm -f ${DESTDIR}${SHLIBDIR}/${lib} -.endif -.endfor # Get all the fruit, even though we don't set PROG. # XXX bsd.lib.mk has fruitflies, e.g., it fails if LIBS is empty. diff --git a/lib/compat/compat4x.i386/Makefile b/lib/compat/compat4x.i386/Makefile index c01909aaf18..29a3fd8e2c9 100644 --- a/lib/compat/compat4x.i386/Makefile +++ b/lib/compat/compat4x.i386/Makefile @@ -22,11 +22,6 @@ ${lib}: ${lib}.gz.uu beforeinstall: ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} ${LIBS} \ ${DESTDIR}${LIBCOMPATDIR} -.for lib in ${LIBS} -.if exists(${DESTDIR}${SHLIBDIR}/${lib}) - rm -f ${DESTDIR}${SHLIBDIR}/${lib} -.endif -.endfor # Get all the fruit, even though we don't set PROG. # XXX bsd.lib.mk has fruitflies, e.g., it fails if LIBS is empty.