2 # See https://wiki.freebsd.org/LocaleNewApproach
3 # Taken from FreeBSD svn [base]/user/edwin/locale/cldr
8 # Modified by John Marino to suit DragonFly needs
10 .if ${.CURDIR} == ${.OBJDIR}
11 .error Do make obj first.
14 LOCALESRCDIR?= ${DESTDIR}/usr/src/share
18 ETCDIR= ${BASEDIR}/etc
19 TOOLSDIR= ${BASEDIR}/tools
20 PATCHDIR= ${BASEDIR}/patch
21 UNIDIR= ${.OBJDIR:tA}/unicode
32 KNOWN= monetdef numericdef msgdef colldef ctypedef # timedef
44 sr_Latn_RS ISO8859-2 \
45 sr_Cyrl_RS ISO8859-5 \
55 .for area enc in ${COLLATION_SPECIAL}
56 COLLATIONS_SPECIAL_ENV+= ${area}.${enc}
61 COLLATIONS_SPECIAL="${COLLATIONS_SPECIAL_ENV}" \
63 BASEDIR="${BASEDIR}" \
64 TOOLSDIR="${TOOLSDIR}" \
67 all: posix build afterbuild
68 .ORDER: posix build afterbuild
77 .ORDER: build-${t} afterbuild
86 -/usr/bin/diff -ruN -x Makefile -x Makefile.depend \
87 ${LOCALESRCDIR}/${t} ${t}
96 cd ${LOCALESRCDIR}/${t} && \
97 rm -f Makefile *.src && \
98 install -c ${t}/* ${LOCALESRCDIR}/${t}
105 cd ${LOCALSRCDIR}/${t} && \
106 make && make install && make clean
111 CLEANDIRS+= ${t} ${t}.draft
113 mkdir -p ${t} ${t}.draft && \
114 perl -I ${TOOLSDIR} ${TOOLSDIR}/cldr2def.pl \
115 --unidir=${UNIDIR:tA} \
120 ${SETENV} OUTBASEDIR="${.OBJDIR}/${t}" ${TOOLSDIR}/finalize ${t}
123 static-colldef: colldef
124 build-colldef: static-colldef
127 .for area enc in ${COLLATION_SPECIAL}
128 colldef.draft/${area}.${enc}.src: posix/${area}.${enc}.src
129 awk -f ${TOOLSDIR}/extract-colldef.awk \
130 ${.ALLSRC} > ${.TARGET} || (rm -f ${.TARGET} && false)
133 BASE_LOCALES_OF_INTEREST?= \
134 af_ZA am_ET ar_AE ar_EG ar_JO ar_MA ar_QA ar_SA \
135 be_BY bg_BG ca_AD ca_ES ca_FR ca_IT \
136 cs_CZ da_DK de_AT de_CH de_DE el_GR en_AU en_CA \
137 en_GB en_HK en_IE en_NZ en_PH en_SG en_US en_ZA \
138 es_AR es_CR es_ES es_MX et_EE eu_ES fi_FI fr_BE \
139 fr_CA fr_CH fr_FR ga_IE he_IL hi_IN hr_HR hu_HU hy_AM \
140 is_IS it_CH it_IT ja_JP ko_KR lt_LT lv_LV \
141 nb_NO nl_BE nl_NL nn_NO pl_PL pt_BR pt_PT ro_RO \
142 ru_RU se_FI se_NO sk_SK sl_SI sv_FI sv_SE tr_TR \
144 kk_KZ mn_MN sr_Cyrl_RS sr_Latn_RS \
145 zh_Hans_CN zh_Hant_HK zh_Hant_TW \
146 bn_IN gu_IN or_IN ta_IN te_IN kn_IN ml_IN si_LK \
147 th_TH lo_LA bo_IN my_MM pa_Guru_IN ka_GE chr_US \
148 km_KH shi_Tfng_MA ii_CN vai_Vaii_LR vi_VN
174 CLDRFILES_CORE= https://unicode.org/Public/cldr/35/core.zip
175 CLDRFILES_KEY= https://unicode.org/Public/cldr/35/keyboards.zip
176 CLDRFILES_TOOLS=https://unicode.org/Public/cldr/35/tools.zip
177 CLDRFILES_UCD= http://www.unicode.org/Public/zipped/latest/UCD.zip
179 # fetch and extract targets
182 .for N in CORE KEY TOOLS UCD
184 fetch ${CLDRFILES_${N}}
185 fetch: ${CLDRFILES_${N}:T}
186 extract-${CLDRFILES_${N}:T}:: ${CLDRFILES_${N}:T} ${UNIDIR}
187 cd ${UNIDIR} && unzip -o ../${CLDRFILES_${N}:T}
188 extract: extract-${CLDRFILES_${N}:T}
191 .if exists(${PATCHDIR})
192 cd ${UNIDIR} && cat ${PATCHDIR}/patch-* | patch
195 .if !exists(${UNIDIR}/tools/java/cldr.jar)
196 .ORDER: extract patch
197 build-tools: extract patch tools-test ${UNIDIR}
198 cd ${UNIDIR}/tools/java && ${SETENV} ant all jar
201 @echo cldr.jar is ready.
204 JAVA_CLDR= java -DCLDR_DIR=${UNIDIR:Q} -jar ${UNIDIR}/tools/java/cldr.jar
206 posix: posixcm post-posixcm posixsrc posixcol
207 .ORDER: posixcm post-posixcm posixsrc posixcol
209 ln -s -f ../posix ${.TARGET}
211 rm -rf posix ${UNIDIR}/posix
212 post-posixcm: ${UNIDIR}/posix
213 perl -I ${TOOLSDIR} ${TOOLSDIR}/utf8-rollup.pl \
215 .for enc in ${ENCODINGS}
216 posixcm: build-tools posix/${enc}.cm
217 .ORDER: build-tools posix/${enc}.cm
220 ${JAVA_CLDR} org.unicode.cldr.posix.GenerateCharmap \
223 .for area in ${BASE_LOCALES_OF_INTEREST}
224 posixsrc: build-tools posix/${area}.UTF-8.src
225 .ORDER: build-tools posix/${area}.UTF-8.src
226 posix/${area}.UTF-8.src:
228 ${JAVA_CLDR} org.unicode.cldr.posix.GeneratePOSIX \
229 -d posix -m ${area} -c UTF-8
231 .for area encoding in ${COLLATION_SPECIAL}
232 posixcol: build-tools posix/${area}.${encoding}.src
233 .ORDER: build-tools posix/${area}.${encoding}.src
234 posix/${area}.${encoding}.src:
236 ${JAVA_CLDR} org.unicode.cldr.posix.GeneratePOSIX \
237 -d posix -m ${area} -c ${encoding}
240 .include <bsd.obj.mk>