1*be9962e2SThomas Veerman# $NetBSD: bsd.nls.mk,v 1.47 2011/09/10 16:57:35 apb Exp $ 2*be9962e2SThomas Veerman 3*be9962e2SThomas Veerman.include <bsd.init.mk> 4*be9962e2SThomas Veerman 5*be9962e2SThomas Veerman##### Basic targets 6*be9962e2SThomas Veermanrealinstall: nlsinstall 7*be9962e2SThomas Veerman 8*be9962e2SThomas Veerman##### Default values 9*be9962e2SThomas VeermanNLSNAME?= ${PROG:Ulib${LIB}} 10*be9962e2SThomas Veerman 11*be9962e2SThomas VeermanNLS?= 12*be9962e2SThomas Veerman 13*be9962e2SThomas Veerman##### Build rules 14*be9962e2SThomas Veerman.if ${MKNLS} != "no" 15*be9962e2SThomas Veerman 16*be9962e2SThomas VeermanNLSALL= ${NLS:.msg=.cat} 17*be9962e2SThomas Veerman 18*be9962e2SThomas Veermanrealall: ${NLSALL} 19*be9962e2SThomas Veerman.NOPATH: ${NLSALL} 20*be9962e2SThomas Veerman 21*be9962e2SThomas Veerman.SUFFIXES: .cat .msg 22*be9962e2SThomas Veerman 23*be9962e2SThomas Veerman.msg.cat: 24*be9962e2SThomas Veerman @rm -f ${.TARGET} 25*be9962e2SThomas Veerman ${_MKTARGET_CREATE} 26*be9962e2SThomas Veerman ${TOOL_GENCAT} ${.TARGET} ${.IMPSRC} 27*be9962e2SThomas Veerman 28*be9962e2SThomas Veerman.endif # ${MKNLS} != "no" 29*be9962e2SThomas Veerman 30*be9962e2SThomas Veerman##### Install rules 31*be9962e2SThomas Veermannlsinstall:: # ensure existence 32*be9962e2SThomas Veerman.PHONY: nlsinstall 33*be9962e2SThomas Veerman 34*be9962e2SThomas Veerman.if ${MKNLS} != "no" 35*be9962e2SThomas Veerman 36*be9962e2SThomas Veerman__nlsinstall: .USE 37*be9962e2SThomas Veerman ${_MKTARGET_INSTALL} 38*be9962e2SThomas Veerman ${INSTALL_FILE} -o ${NLSOWN} -g ${NLSGRP} -m ${NLSMODE} \ 39*be9962e2SThomas Veerman ${.ALLSRC} ${.TARGET} 40*be9962e2SThomas Veerman 41*be9962e2SThomas Veerman.for F in ${NLSALL:O:u} 42*be9962e2SThomas Veerman_F:= ${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat # installed path 43*be9962e2SThomas Veerman 44*be9962e2SThomas Veerman.if ${MKUPDATE} == "no" 45*be9962e2SThomas Veerman${_F}! ${F} __nlsinstall # install rule 46*be9962e2SThomas Veerman.if !defined(BUILD) && !make(all) && !make(${F}) 47*be9962e2SThomas Veerman${_F}! .MADE # no build at install 48*be9962e2SThomas Veerman.endif 49*be9962e2SThomas Veerman.else 50*be9962e2SThomas Veerman${_F}: ${F} __nlsinstall # install rule 51*be9962e2SThomas Veerman.if !defined(BUILD) && !make(all) && !make(${F}) 52*be9962e2SThomas Veerman${_F}: .MADE # no build at install 53*be9962e2SThomas Veerman.endif 54*be9962e2SThomas Veerman.endif 55*be9962e2SThomas Veerman 56*be9962e2SThomas Veermannlsinstall:: ${_F} 57*be9962e2SThomas Veerman.PRECIOUS: ${_F} # keep if install fails 58*be9962e2SThomas Veerman.endfor 59*be9962e2SThomas Veerman 60*be9962e2SThomas Veerman.undef _F 61*be9962e2SThomas Veerman.endif # ${MKNLS} != "no" 62*be9962e2SThomas Veerman 63*be9962e2SThomas Veerman##### Clean rules 64*be9962e2SThomas Veerman.if ${MKNLS} != "no" && !empty(NLS) 65*be9962e2SThomas VeermanCLEANDIRFILES+= ${NLSALL} 66*be9962e2SThomas Veerman.endif 67*be9962e2SThomas Veerman 68*be9962e2SThomas Veerman##### Pull in related .mk logic 69*be9962e2SThomas Veerman.include <bsd.obj.mk> 70*be9962e2SThomas Veerman.include <bsd.sys.mk> 71*be9962e2SThomas Veerman.include <bsd.clean.mk> 72