Home | History | Annotate | Line # | Download | only in mk
bsd.inc.mk revision 1.25
      1  1.25     lukem #	$NetBSD: bsd.inc.mk,v 1.25 2003/08/03 09:23:16 lukem Exp $
      2  1.24     lukem 
      3  1.24     lukem .include <bsd.init.mk>
      4   1.3   mycroft 
      5  1.20        tv ##### Basic targets
      6   1.9       cjs .PHONY:		incinstall
      7  1.25     lukem includes:	${INCS} incinstall inclinkinstall
      8  1.25     lukem 
      9  1.25     lukem ##### Default values
     10  1.25     lukem INCSYMLINKS?=
     11   1.1  christos 
     12  1.20        tv ##### Install rules
     13  1.20        tv incinstall::	# ensure existence
     14  1.14   mycroft 
     15  1.20        tv # -c is forced on here, in order to preserve modtimes for "make depend"
     16  1.16   mycroft __incinstall: .USE
     17   1.1  christos 	@cmp -s ${.ALLSRC} ${.TARGET} > /dev/null 2>&1 || \
     18  1.20        tv 	    (echo "${INSTALL_FILE:N-c} -c -o ${BINOWN} -g ${BINGRP} \
     19  1.23     perry 		-m ${NONBINMODE} ${SYSPKGTAG} ${.ALLSRC} ${.TARGET}" && \
     20  1.20        tv 	     ${INSTALL_FILE:N-c} -c -o ${BINOWN} -g ${BINGRP} \
     21  1.23     perry 		-m ${NONBINMODE} ${SYSPKGTAG} ${.ALLSRC} ${.TARGET})
     22  1.16   mycroft 
     23  1.20        tv .for F in ${INCS:O:u}
     24  1.20        tv _FDIR:=		${INCSDIR_${F:C,/,_,g}:U${INCSDIR}}	# dir override
     25  1.20        tv _FNAME:=	${INCSNAME_${F:C,/,_,g}:U${INCSNAME:U${F}}} # name override
     26  1.20        tv _F:=		${DESTDIR}${_FDIR}/${_FNAME}		# installed path
     27  1.20        tv 
     28  1.24     lukem .if ${MKUPDATE} == "no"
     29  1.22   mycroft ${_F}!		${F} __incinstall			# install rule
     30  1.22   mycroft .else
     31  1.20        tv ${_F}:		${F} __incinstall			# install rule
     32  1.22   mycroft .endif
     33  1.22   mycroft 
     34  1.20        tv incinstall::	${_F}
     35  1.20        tv .PRECIOUS:	${_F}					# keep if install fails
     36   1.1  christos .endfor
     37   1.5   mycroft 
     38  1.20        tv .undef _FDIR
     39  1.20        tv .undef _FNAME
     40  1.20        tv .undef _F
     41  1.25     lukem 
     42  1.25     lukem inclinkinstall::
     43  1.25     lukem .if !empty(INCSYMLINKS)
     44  1.25     lukem 	@(set ${INCSYMLINKS}; \
     45  1.25     lukem 	 while test $$# -ge 2; do \
     46  1.25     lukem 		l=$$1; shift; \
     47  1.25     lukem 		t=${DESTDIR}$$1; shift; \
     48  1.25     lukem 		if  ttarg=`${TOOL_STAT} -qf '%Y' $$t` && \
     49  1.25     lukem 		    [ "$$l" = "$$ttarg" ]; then \
     50  1.25     lukem 			continue ; \
     51  1.25     lukem 		fi ; \
     52  1.25     lukem 		echo "$$t -> $$l"; \
     53  1.25     lukem 		${INSTALL_SYMLINK} ${SYSPKGTAG} $$l $$t; \
     54  1.25     lukem 	 done; )
     55  1.25     lukem .endif
     56