Error out if no volumes are specified instead of core-dumping.
[dragonfly.git] / share / mk / bsd.nls.mk
blob3f626888a092e12dd56e95cf4e33d09cafb280ec
1 # $FreeBSD: src/share/mk/bsd.nls.mk,v 1.11 2005/02/27 16:36:54 phantom Exp $
2 # $DragonFly: src/share/mk/bsd.nls.mk,v 1.3 2005/04/21 16:36:35 joerg Exp $
4 # This include file <bsd.nls.mk> handles building and installing Native
5 # Language Support (NLS) catalogs
7 # +++ variables +++
9 # GENCAT A program for converting .msg files into compiled NLS
10 # .cat files. [gencat]
12 # NLS Source or intermediate .msg files. [set in Makefile]
14 # NLSDIR Base path for National Language Support files
15 # installation. [${SHAREDIR}/nls]
17 # NLSGRP National Language Support files group. [${SHAREGRP}]
19 # NLSMODE National Language Support files mode. [${NOBINMODE}]
21 # NLSOWN National Language Support files owner. [${SHAREOWN}]
23 # NO_NLS Do not make or install NLS files. [not set]
25 .if !target(__<bsd.init.mk>__)
26 .error bsd.nls.mk cannot be included directly.
27 .endif
29 GENCAT?= gencat
31 .SUFFIXES: .cat .msg
33 .msg.cat:
34 ${GENCAT} ${.TARGET} ${.IMPSRC}
36 .if defined(NLS) && !empty(NLS) && !defined(NO_NLS)
39 # .msg file pre-build rules
41 NLSSRCDIR?= ${.CURDIR}
42 .for file in ${NLS}
43 .if defined(NLSSRCFILES)
44 NLSSRCFILES_${file}?= ${NLSSRCFILES}
45 .endif
46 .if defined(NLSSRCFILES_${file})
47 NLSSRCDIR_${file}?= ${NLSSRCDIR}
48 ${file}.msg: ${NLSSRCFILES_${file}:S/^/${NLSSRCDIR_${file}}\//}
49 @rm -f ${.TARGET}
50 cat ${.ALLSRC} > ${.TARGET}
51 CLEANFILES+= ${file}.msg
52 .endif
53 .endfor
56 # .cat file build rules
58 NLS:= ${NLS:=.cat}
59 CLEANFILES+= ${NLS}
60 FILESGROUPS?= FILES
61 FILESGROUPS+= NLS
64 # installation rules
66 .for file in ${NLS}
67 NLSNAME_${file:T}= ${file:T:R}/${NLSNAME}.cat
68 .if defined(NLSLINKS_${file:R}) && !empty(NLSLINKS_${file:R})
69 NLSLINKS+= ${file:R}
70 .endif
71 .for dst in ${NLSLINKS_${file:R}}
72 SYMLINKS+= ../${file:R}/${NLSNAME}.cat ${NLSDIR}/${dst}/${NLSNAME}.cat
73 .endfor
74 .endfor
76 .endif # defined(NLS) && !empty(NLS) && !defined(NO_NLS)