link-categories/unlink-categories target:

populate ports tree with symlinks.
This commit is contained in:
espie 2000-12-16 15:49:12 +00:00
parent 12dc728de6
commit 78564b0e02
2 changed files with 29 additions and 5 deletions

View File

@ -1,6 +1,6 @@
#-*- mode: Fundamental; tab-width: 4; -*-
# ex:ts=4 sw=4 filetype=make:
FULL_REVISION=$$OpenBSD: bsd.port.mk,v 1.345 2000/12/16 15:47:35 espie Exp $$
FULL_REVISION=$$OpenBSD: bsd.port.mk,v 1.346 2000/12/16 15:49:12 espie Exp $$
# $FreeBSD: bsd.port.mk,v 1.264 1996/12/25 02:27:44 imp Exp $
# $NetBSD: bsd.port.mk,v 1.62 1998/04/09 12:47:02 hubertf Exp $
#
@ -2524,6 +2524,28 @@ depend:
tags:
.endif
link-categories:
.for _CAT in ${CATEGORIES}
@linkname=${PORTSDIR}/${_CAT}/`basename ${.CURDIR}`; \
if [ ! -e $$linkname ]; then \
echo "$$linkname -> ${.CURDIR}"; \
mkdir -p ${PORTSDIR}/${_CAT}; \
ln -s ${.CURDIR} $$linkname; \
fi
.endfor
unlink-categories:
.for _CAT in ${CATEGORIES}
@linkname=${PORTSDIR}/${_CAT}/`basename ${.CURDIR}`; \
if [ -L $$linkname ]; then \
echo "rm $$linkname"; \
rm $$linkname; \
if rmdir ${PORTSDIR}/${_CAT} 2>/dev/null; then \
echo "rmdir ${PORTSDIR}/${_CAT}"; \
fi; \
fi
.endfor
.PHONY: \
addsum all build build-depends checkpatch \
checksum clean clean-depends configure deinstall \
@ -2542,4 +2564,5 @@ tags:
readmes reinstall \
repackage run-depends tags uninstall fetch-all print-depends \
recurse-build-depends recurse-package-depends \
distpatch real-distpatch do-distpatch post-distpatch show
distpatch real-distpatch do-distpatch post-distpatch show \
link-categories unlink-categories

View File

@ -1,5 +1,5 @@
# from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
# $OpenBSD: bsd.port.subdir.mk,v 1.30 2000/07/26 12:47:16 espie Exp $
# $OpenBSD: bsd.port.subdir.mk,v 1.31 2000/12/16 15:49:13 espie Exp $
# FreeBSD Id: bsd.port.subdir.mk,v 1.20 1997/08/22 11:16:15 asami Exp
#
# The include file <bsd.port.subdir.mk> contains the default targets
@ -116,7 +116,7 @@ ${SUBDIR}::
build clean depend describe distclean deinstall \
reinstall tags checksum mirror-distfiles list-distfiles \
show obj fetch-makefile all-packages cdrom-packages \
ftp-packages packageinstall
ftp-packages packageinstall link-categories unlink-categories
.if !target(${__target})
${__target}: _SUBDIRUSE
@ -179,4 +179,5 @@ README.html:
describe distclean deinstall reinstall tags checksum mirror-distfiles \
list-distfiles obj show readmes readme \
beforeinstall afterinstall install realinstall fake \
all-packages cdrom-packages ftp-packages packageinstall
all-packages cdrom-packages ftp-packages packageinstall \
link-categories unlink-categories