No empty .Rs/.Re
[netbsd-mini2440.git] / share / mk / bsd.nls.mk
blob2ab8e0919a314326e368f8afdb78bfbd0b6d67d9
1 # $NetBSD: bsd.nls.mk,v 1.45 2004/01/29 01:48:45 lukem Exp $
3 .include <bsd.init.mk>
5 ##### Basic targets
6 cleandir: cleannls
7 realinstall: nlsinstall
9 ##### Default values
10 NLSNAME?= ${PROG:Ulib${LIB}}
12 NLS?=
14 ##### Build rules
15 .if ${MKNLS} != "no"
17 NLSALL= ${NLS:.msg=.cat}
19 realall: ${NLSALL}
20 .NOPATH: ${NLSALL}
22 .SUFFIXES: .cat .msg
24 .msg.cat:
25 @rm -f ${.TARGET}
26 ${_MKTARGET_CREATE}
27 ${TOOL_GENCAT} ${.TARGET} ${.IMPSRC}
29 .endif # ${MKNLS} != "no"
31 ##### Install rules
32 nlsinstall:: # ensure existence
33 .PHONY: nlsinstall
35 .if ${MKNLS} != "no"
37 __nlsinstall: .USE
38 ${_MKTARGET_INSTALL}
39 ${INSTALL_FILE} -o ${NLSOWN} -g ${NLSGRP} -m ${NLSMODE} \
40 ${.ALLSRC} ${.TARGET}
42 .for F in ${NLSALL:O:u}
43 _F:= ${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat # installed path
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
57 nlsinstall:: ${_F}
58 .PRECIOUS: ${_F} # keep if install fails
59 .endfor
61 .undef _F
62 .endif # ${MKNLS} != "no"
64 ##### Clean rules
65 cleannls: .PHONY
66 .if ${MKNLS} != "no" && !empty(NLS)
67 rm -f ${NLSALL}
68 .endif
70 ##### Pull in related .mk logic
71 .include <bsd.obj.mk>
72 .include <bsd.sys.mk>