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