Home | History | Annotate | Line # | Download | only in mk
bsd.links.mk revision 1.10
      1 #	$NetBSD: bsd.links.mk,v 1.10 2000/01/24 06:54:27 mycroft Exp $
      2 
      3 .PHONY:		linksinstall
      4 realinstall:	linksinstall
      5 
      6 .if defined(SYMLINKS) && !empty(SYMLINKS)
      7 linksinstall::
      8 	@set ${SYMLINKS}; \
      9 	 echo ".include <bsd.own.mk>"; \
     10 	 while test $$# -ge 2; do \
     11 		l=$$1; \
     12 		shift; \
     13 		t=${DESTDIR}$$1; \
     14 		shift; \
     15 		echo "realall:: $$t"; \
     16 		echo ".PHONY: $$t"; \
     17 		echo "$$t:"; \
     18 		echo "	@echo \"$$t -> $$l\""; \
     19 		echo "	@rm -f $$t"; \
     20 		echo "	@ln -s $$l $$t"; \
     21 	done | ${MAKE} -f-
     22 .endif
     23 .if defined(LINKS) && !empty(LINKS)
     24 linksinstall::
     25 	@set ${LINKS}; \
     26 	 echo ".include <bsd.own.mk>"; \
     27 	 while test $$# -ge 2; do \
     28 		l=${DESTDIR}$$1; \
     29 		shift; \
     30 		t=${DESTDIR}$$1; \
     31 		shift; \
     32 		echo "realall:: $$t"; \
     33 		echo ".PHONY: $$t"; \
     34 		echo "$$t:"; \
     35 		echo "	@echo \"$$t -> $$l\""; \
     36 		echo "	@rm -f $$t"; \
     37 		echo "	@ln $$l $$t"; \
     38 	done | ${MAKE} -f-
     39 .endif
     40 
     41 .if !target(linksinstall)
     42 linksinstall:
     43 .endif
     44