]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/mk/bsd.nls.mk
This commit was generated by cvs2svn to compensate for changes in r155290,
[FreeBSD/FreeBSD.git] / share / mk / bsd.nls.mk
1 # $FreeBSD$
2 #
3 # This include file <bsd.nls.mk> handles building and installing Native
4 # Language Support (NLS) catalogs
5 #
6 # +++ variables +++
7 #
8 # GENCAT        A program for converting .msg files into compiled NLS
9 #               .cat files. [gencat]
10 #
11 # NLS           Source or intermediate .msg files. [set in Makefile]
12 #
13 # NLSDIR        Base path for National Language Support files
14 #               installation. [${SHAREDIR}/nls]
15 #
16 # NLSGRP        National Language Support files group. [${SHAREGRP}]
17 #
18 # NLSMODE       National Language Support files mode. [${NOBINMODE}]
19 #
20 # NLSOWN        National Language Support files owner. [${SHAREOWN}]
21 #
22 # NO_NLS        Do not make or install NLS files. [not set]
23
24 .if !target(__<bsd.init.mk>__)
25 .error bsd.nls.mk cannot be included directly.
26 .endif
27
28 GENCAT?=        gencat
29
30 .SUFFIXES: .cat .msg
31
32 .msg.cat:
33         ${GENCAT} ${.TARGET} ${.IMPSRC}
34
35 .if defined(NLS) && !empty(NLS) && !defined(NO_NLS)
36
37 #
38 # .msg file pre-build rules
39 #
40 NLSSRCDIR?=     ${.CURDIR}
41 .for file in ${NLS}
42 .if defined(NLSSRCFILES)
43 NLSSRCFILES_${file}?= ${NLSSRCFILES}
44 .endif
45 .if defined(NLSSRCFILES_${file})
46 NLSSRCDIR_${file}?= ${NLSSRCDIR}
47 ${file}.msg: ${NLSSRCFILES_${file}:S/^/${NLSSRCDIR_${file}}\//}
48         @rm -f ${.TARGET}
49         cat ${.ALLSRC} > ${.TARGET}
50 CLEANFILES+= ${file}.msg
51 .endif
52 .endfor
53
54 #
55 # .cat file build rules
56 #
57 NLS:=           ${NLS:=.cat}
58 CLEANFILES+=    ${NLS}
59 FILESGROUPS?=   FILES
60 FILESGROUPS+=   NLS
61 NLSDIR?=        ${SHAREDIR}/nls
62
63 #
64 # installation rules
65 #
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
75
76 .endif # defined(NLS) && !empty(NLS) && !defined(NO_NLS)