pkgsrc/pkgtools/bootstrap-mk-files/files/bsd.links.mk
jlam c71e325c08 Import pkgtools/bootstrap-mk-files, which is the collection of bmake *.mk
files from the bootstrap kit.  This package is used during bootstrap to
properly register the installed *.mk files.

The bootstrap bmake(1) utility uses some customised .mk files in order
to pre-define certain definitions and targets, which guide the build
process.  This package provides those *.mk files for the bmake(1)
utility.
2006-07-14 23:13:00 +00:00

44 lines
904 B
Makefile

# $NetBSD: bsd.links.mk,v 1.1.1.1 2006/07/14 23:13:00 jlam Exp $
.PHONY: linksinstall
realinstall: linksinstall
.if defined(SYMLINKS) && !empty(SYMLINKS)
linksinstall::
@(set ${SYMLINKS}; \
while test $$# -ge 2; do \
l=$$1; \
shift; \
t=${DESTDIR}$$1; \
shift; \
if [ -h $$t ]; then \
cur=`ls -ld $$t | awk '{print $$NF}'` ; \
if [ "$$cur" = "$$l" ]; then \
continue ; \
fi; \
fi; \
echo "$$t -> $$l"; \
rm -rf $$t; ln -s $$l $$t; \
done; )
.endif
.if defined(LINKS) && !empty(LINKS)
linksinstall::
@(set ${LINKS}; \
echo ".include <bsd.own.mk>"; \
while test $$# -ge 2; do \
l=${DESTDIR}$$1; \
shift; \
t=${DESTDIR}$$1; \
shift; \
echo "realall: $$t"; \
echo ".PHONY: $$t"; \
echo "$$t:"; \
echo " @echo \"$$t -> $$l\""; \
echo " @rm -f $$t; ln $$l $$t"; \
done; \
) | ${MAKE} -f- all
.endif
.if !target(linksinstall)
linksinstall:
.endif