Home | History | Annotate | Line # | Download | only in mk
bsd.nls.mk revision 1.36
      1 #	$NetBSD: bsd.nls.mk,v 1.36 2002/01/03 19:11:17 tv Exp $
      2 
      3 .include <bsd.init.mk>
      4 
      5 ##### Basic targets
      6 .PHONY:		cleannls nlsinstall
      7 cleandir:	cleannls
      8 realinstall:	nlsinstall
      9 
     10 ##### Default values
     11 GENCAT?=	gencat
     12 NLSNAME?=	${PROG:Ulib${LIB}}
     13 
     14 NLS?=
     15 
     16 ##### Build rules
     17 .if ${MKNLS} != "no"
     18 
     19 NLSALL=		${NLS:.msg=.cat}
     20 
     21 realall:	${NLSALL}
     22 .NOPATH:	${NLSALL}
     23 
     24 .SUFFIXES: .cat .msg
     25 
     26 .msg.cat:
     27 	@rm -f ${.TARGET}
     28 	${GENCAT} ${.TARGET} ${.IMPSRC}
     29 
     30 .endif # ${MKNLS} != "no"
     31 
     32 ##### Install rules
     33 nlsinstall::	# ensure existence
     34 .if ${MKNLS} != "no"
     35 
     36 __nlsinstall: .USE
     37 	${INSTALL_FILE} -o ${NLSOWN} -g ${NLSGRP} -m ${NLSMODE} \
     38 		${.ALLSRC} ${.TARGET}
     39 
     40 .for F in ${NLSALL:O:u}
     41 _F:=		${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat # installed path
     42 
     43 ${_F}:		${F} __nlsinstall			# install rule
     44 nlsinstall::	${_F}
     45 .PRECIOUS:	${_F}					# keep if install fails
     46 .PHONY:		${UPDATE:D:U${_F}}			# noclobber install
     47 .if !defined(BUILD) && !make(all) && !make(${F})
     48 ${_F}:		.MADE					# no build at install
     49 .endif
     50 .endfor
     51 
     52 .undef _F
     53 .endif # ${MKNLS} != "no"
     54 
     55 ##### Clean rules
     56 cleannls:
     57 .if ${MKNLS} != "no" && !empty(NLS)
     58 	rm -f ${NLSALL}
     59 .endif
     60