Home | History | Annotate | Line # | Download | only in mk
bsd.nls.mk revision 1.41
      1 #	$NetBSD: bsd.nls.mk,v 1.41 2003/07/18 08:26:08 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 	${TOOL_GENCAT} ${.TARGET} ${.IMPSRC}
     28 
     29 .endif # ${MKNLS} != "no"
     30 
     31 ##### Install rules
     32 nlsinstall::	# ensure existence
     33 .if ${MKNLS} != "no"
     34 
     35 __nlsinstall: .USE
     36 	${INSTALL_FILE} -o ${NLSOWN} -g ${NLSGRP} -m ${NLSMODE} \
     37 		${SYSPKGTAG} ${.ALLSRC} ${.TARGET}
     38 
     39 .for F in ${NLSALL:O:u}
     40 _F:=		${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat # installed path
     41 
     42 .if ${MKUPDATE} == "no"
     43 ${_F}!		${F} __nlsinstall			# install rule
     44 .if !defined(BUILD) && !make(all) && !make(${F})
     45 ${_F}!		.MADE					# no build at install
     46 .endif
     47 .else
     48 ${_F}:		${F} __nlsinstall			# install rule
     49 .if !defined(BUILD) && !make(all) && !make(${F})
     50 ${_F}:		.MADE					# no build at install
     51 .endif
     52 .endif
     53 
     54 nlsinstall::	${_F}
     55 .PRECIOUS:	${_F}					# keep if install fails
     56 .endfor
     57 
     58 .undef _F
     59 .endif # ${MKNLS} != "no"
     60 
     61 ##### Clean rules
     62 cleannls:
     63 .if ${MKNLS} != "no" && !empty(NLS)
     64 	rm -f ${NLSALL}
     65 .endif
     66 
     67 ##### Pull in related .mk logic
     68 .include <bsd.obj.mk>
     69 .include <bsd.sys.mk>
     70