Home | History | Annotate | Line # | Download | only in mk
bsd.nls.mk revision 1.44
      1 #	$NetBSD: bsd.nls.mk,v 1.44 2003/10/21 10:01:21 lukem 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 NLSNAME?=	${PROG:Ulib${LIB}}
     12 
     13 NLS?=
     14 
     15 ##### Build rules
     16 .if ${MKNLS} != "no"
     17 
     18 NLSALL=		${NLS:.msg=.cat}
     19 
     20 realall:	${NLSALL}
     21 .NOPATH:	${NLSALL}
     22 
     23 .SUFFIXES: .cat .msg
     24 
     25 .msg.cat:
     26 	@rm -f ${.TARGET}
     27 	${_MKTARGET_CREATE}
     28 	${TOOL_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 	${_MKTARGET_INSTALL}
     38 	${INSTALL_FILE} -o ${NLSOWN} -g ${NLSGRP} -m ${NLSMODE} \
     39 		${SYSPKGTAG} ${.ALLSRC} ${.TARGET}
     40 
     41 .for F in ${NLSALL:O:u}
     42 _F:=		${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat # installed path
     43 
     44 .if ${MKUPDATE} == "no"
     45 ${_F}!		${F} __nlsinstall			# install rule
     46 .if !defined(BUILD) && !make(all) && !make(${F})
     47 ${_F}!		.MADE					# no build at install
     48 .endif
     49 .else
     50 ${_F}:		${F} __nlsinstall			# install rule
     51 .if !defined(BUILD) && !make(all) && !make(${F})
     52 ${_F}:		.MADE					# no build at install
     53 .endif
     54 .endif
     55 
     56 nlsinstall::	${_F}
     57 .PRECIOUS:	${_F}					# keep if install fails
     58 .endfor
     59 
     60 .undef _F
     61 .endif # ${MKNLS} != "no"
     62 
     63 ##### Clean rules
     64 cleannls:
     65 .if ${MKNLS} != "no" && !empty(NLS)
     66 	rm -f ${NLSALL}
     67 .endif
     68 
     69 ##### Pull in related .mk logic
     70 .include <bsd.obj.mk>
     71 .include <bsd.sys.mk>
     72