Home | History | Annotate | Line # | Download | only in mk
bsd.links.mk revision 1.32.28.1.2.1
      1  1.32.28.1.2.1      matt #	$NetBSD: bsd.links.mk,v 1.32.28.1.2.1 2010/04/21 05:26:47 matt Exp $
      2           1.23     lukem 
      3           1.23     lukem .include <bsd.init.mk>
      4            1.3   mycroft 
      5           1.15        tv ##### Basic targets
      6           1.18        pk install:	linksinstall
      7            1.1  christos 
      8           1.15        tv ##### Default values
      9           1.15        tv LINKS?=
     10           1.15        tv SYMLINKS?=
     11      1.32.28.1    bouyer LINKSOWN?=	${BINOWN}
     12      1.32.28.1    bouyer LINKSGRP?=	${BINGRP}
     13      1.32.28.1    bouyer LINKSMODE?=	${NONBINMODE}
     14           1.15        tv 
     15           1.32       dbj __linkinstall: .USE
     16           1.32       dbj 	${_MKSHMSG_INSTALL} ${.TARGET}; \
     17      1.32.28.1    bouyer 	${_MKSHECHO} "${INSTALL_LINK} \
     18      1.32.28.1    bouyer 	    -o ${LINKSOWN_${.ALLSRC:T}:U${LINKSOWN}} \
     19      1.32.28.1    bouyer 	    -g ${LINKSGRP_${.ALLSRC:T}:U${LINKSGRP}} \
     20      1.32.28.1    bouyer 	    -m ${LINKSMODE_${.ALLSRC:T}:U${LINKSMODE}} \
     21      1.32.28.1    bouyer 	    ${.ALLSRC} ${.TARGET}" && \
     22      1.32.28.1    bouyer 	${INSTALL_LINK} \
     23      1.32.28.1    bouyer 	    -o ${LINKSOWN_${.ALLSRC:T}:U${LINKSOWN}} \
     24      1.32.28.1    bouyer 	    -g ${LINKSGRP_${.ALLSRC:T}:U${LINKSGRP}} \
     25      1.32.28.1    bouyer 	    -m ${LINKSMODE_${.ALLSRC:T}:U${LINKSMODE}} \
     26      1.32.28.1    bouyer 	    ${.ALLSRC} ${.TARGET}
     27           1.32       dbj 
     28           1.15        tv ##### Install rules
     29           1.26     lukem .PHONY:		linksinstall
     30           1.19  sommerfe linksinstall::	realinstall
     31           1.15        tv .if !empty(SYMLINKS)
     32           1.11  drochner 	@(set ${SYMLINKS}; \
     33            1.1  christos 	 while test $$# -ge 2; do \
     34           1.15        tv 		l=$$1; shift; \
     35           1.15        tv 		t=${DESTDIR}$$1; shift; \
     36           1.22     lukem 		if  ttarg=`${TOOL_STAT} -qf '%Y' $$t` && \
     37           1.22     lukem 		    [ "$$l" = "$$ttarg" ]; then \
     38           1.22     lukem 			continue ; \
     39           1.22     lukem 		fi ; \
     40           1.25     lukem 		${_MKSHMSG_INSTALL} $$t; \
     41           1.31     jwise 		${_MKSHECHO} ${INSTALL_SYMLINK} $$l $$t; \
     42           1.31     jwise 		${INSTALL_SYMLINK} $$l $$t; \
     43           1.13    simonb 	 done; )
     44            1.1  christos .endif
     45           1.32       dbj 
     46           1.32       dbj .for _src _dst in ${LINKS}
     47           1.32       dbj _l:=${DESTDIR}${_src}
     48           1.32       dbj _t:=${DESTDIR}${_dst}
     49           1.32       dbj 
     50           1.32       dbj # Handle case conflicts carefully, when _dst occurs
     51           1.32       dbj # more than once after case flattening
     52           1.32       dbj .if ${MKUPDATE} == "no" || ${LINKS:tl:M${_dst:tl:Q}:[\#]} > 1
     53           1.32       dbj ${_t}!		${_l} __linkinstall
     54           1.32       dbj .else
     55           1.32       dbj ${_t}:		${_l} __linkinstall
     56            1.1  christos .endif
     57           1.24     lukem 
     58           1.32       dbj linksinstall::	${_t}
     59           1.32       dbj .PRECIOUS:	${_t}
     60           1.32       dbj .endfor
     61           1.27     lukem 
     62           1.27     lukem configinstall:		configlinksinstall
     63           1.30     lukem .PHONY:			configlinksinstall
     64           1.30     lukem configlinksinstall::	configfilesinstall
     65           1.28     lukem .if defined(CONFIGSYMLINKS)
     66           1.27     lukem 	@(set ${CONFIGSYMLINKS}; \
     67           1.27     lukem 	 while test $$# -ge 2; do \
     68           1.27     lukem 		l=$$1; shift; \
     69           1.27     lukem 		t=${DESTDIR}$$1; shift; \
     70           1.27     lukem 		if  ttarg=`${TOOL_STAT} -qf '%Y' $$t` && \
     71           1.27     lukem 		    [ "$$l" = "$$ttarg" ]; then \
     72           1.27     lukem 			continue ; \
     73           1.27     lukem 		fi ; \
     74           1.27     lukem 		${_MKSHMSG_INSTALL} $$t; \
     75           1.31     jwise 		${_MKSHECHO} ${INSTALL_SYMLINK} $$l $$t; \
     76           1.31     jwise 		${INSTALL_SYMLINK} $$l $$t; \
     77           1.27     lukem 	 done; )
     78           1.27     lukem .endif
     79           1.32       dbj 
     80           1.32       dbj .for _src _dst in ${CONFIGLINKS}
     81           1.32       dbj _l:=${DESTDIR}${_src}
     82           1.32       dbj _t:=${DESTDIR}${_dst}
     83           1.32       dbj 
     84           1.32       dbj # Handle case conflicts carefully, when _dst occurs
     85           1.32       dbj # more than once after case flattening
     86           1.32       dbj .if ${MKUPDATE} == "no" || ${CONFIGLINKS:tl:M${_dst:tl:Q}:[\#]} > 1
     87           1.32       dbj ${_t}!		${_l} __linkinstall
     88           1.32       dbj .else
     89           1.32       dbj ${_t}:		${_l} __linkinstall
     90           1.28     lukem .endif
     91           1.27     lukem 
     92           1.32       dbj configlinksinstall::	${_t}
     93           1.32       dbj .PRECIOUS:	${_t}
     94           1.32       dbj .endfor
     95           1.32       dbj 
     96           1.24     lukem .include <bsd.sys.mk>
     97