NetBSD/share/mk/bsd.links.mk
drochner 72db33dc5a fix link creation:
-put "echo"s for the daughter Makefile into a subshell to get them all
 into the Makefile (instead of stdout - should fix PR misc/9336 by
 Bernd Ernesti)
-change operator for "realall" back to ":" - rules are supposed to
 accumulate, and "::" clashes with the definition in <bsd.own.mk>
-call sub-make with the "all" target to make sure we don't get just
 the first rule
2000-02-10 18:18:01 +00:00

46 lines
934 B
Makefile

# $NetBSD: bsd.links.mk,v 1.11 2000/02/10 18:18:02 drochner Exp $
.PHONY: linksinstall
realinstall: linksinstall
.if defined(SYMLINKS) && !empty(SYMLINKS)
linksinstall::
@(set ${SYMLINKS}; \
echo ".include <bsd.own.mk>"; \
while test $$# -ge 2; do \
l=$$1; \
shift; \
t=${DESTDIR}$$1; \
shift; \
echo "realall: $$t"; \
echo ".PHONY: $$t"; \
echo "$$t:"; \
echo " @echo \"$$t -> $$l\""; \
echo " @rm -f $$t"; \
echo " @ln -s $$l $$t"; \
done; \
) | ${MAKE} -f- all
.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"; \
echo " @ln $$l $$t"; \
done; \
) | ${MAKE} -f- all
.endif
.if !target(linksinstall)
linksinstall:
.endif