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