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