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