1# 2# This file and its contents are supplied under the terms of the 3# Common Development and Distribution License ("CDDL"), version 1.0. 4# You may only use this file in accordance with the terms of version 5# 1.0 of the CDDL. 6# 7# A full copy of the text of the CDDL should have accompanied this 8# source. A copy of the CDDL is also available via the Internet at 9# http://www.illumos.org/license/CDDL. 10# 11 12# 13# Copyright 2011 Nexenta Systems, Inc. All rights reserved. 14# Copyright 2011 EveryCity Ltd. All rights reserved. 15# 16 17PROG=localedef 18 19include ../Makefile.cmd 20 21OBJS = charmap.o collate.o ctype.o messages.o monetary.o numeric.o time.o \ 22 scanner.o localedef.o wide.o parser.tab.o 23 24HDRS = localedef.h 25 26SRCS = $(OBJS:%.o=%.c) 27 28CPPFLAGS += -I $(SRC)/lib/libc/port/locale 29LDLIBS += -lgen 30LDLIBS += -lavl 31YFLAGS = -d -b parser 32CLEANFILES = $(OBJS) parser.tab.c parser.tab.h 33CLEANFILES += \ 34 UTF-8.cm \ 35 8859-1.cm 8859-2.cm 8859-3.cm 8859-4.cm \ 36 8859-5.cm 8859-5.cm 8859-6.cm 8859-7.cm \ 37 8859-8.cm 8859-9.cm 8859-9.cm 8859-10.cm \ 38 8859-11.cm 8859-13.cm 8859-14.cm 8859-15.cm \ 39 8859-16.cm \ 40 KOI8-R.cm 41CLOBBERFILES = $(PROG) $(POFILE) $(DATA:%=locale/%) 42PIFILES = $(OBJS:%.o=%.i) 43POFILE = localedef_cmd.po 44 45ISO8859_1_LOCALES = \ 46 da_DK \ 47 de_CH \ 48 en_AU en_CA en_GB en_NZ en_US \ 49 es_AR es_BO es_CL es_CO es_EC es_GT es_MX es_NI es_PA \ 50 es_PE es_SV es_UY es_VE \ 51 fr_CA fr_CH \ 52 is_IS \ 53 it_CH \ 54 sv_SE 55 56ISO8859_2_LOCALES = \ 57 cs_CZ \ 58 hr_HR \ 59 hu_HU \ 60 pl_PL \ 61 sq_AL 62 63ISO8859_5_LOCALES = \ 64 bg_BG \ 65 mk_MK \ 66 ru_RU 67 68ISO8859_6_LOCALES = \ 69 ar_EG 70 71ISO8859_7_LOCALES = \ 72 el_GR 73 74ISO8859_9_LOCALES = \ 75 tr_TR 76 77ISO8859_11_LOCALES = \ 78 th_TH 79 80ISO8859_13_LOCALES = \ 81 lt_LT \ 82 lv_LV 83 84ISO8859_15_LOCALES = \ 85 ca_ES \ 86 da_DK \ 87 de_AT de_DE \ 88 en_GB en_IE en_US \ 89 es_ES \ 90 fi_FI \ 91 fr_BE fr_FR \ 92 it_IT \ 93 nl_BE nl_NL \ 94 pt_PT \ 95 sv_FI sv_SE 96 97KOI8_R_LOCALES = \ 98 ru_RU 99 100# 101# All new locales should be in UTF-8 form. 102# 103UTF_8_LOCALES = \ 104 af_ZA \ 105 ar_AE ar_BH ar_DZ ar_EG ar_IQ ar_JO ar_KW ar_LB ar_LY ar_MA \ 106 ar_OM ar_QA ar_SA ar_TN ar_YE \ 107 as_IN \ 108 az_AZ \ 109 be_BY \ 110 bg_BG \ 111 bn_BD bn_IN \ 112 bo_CN bo_IN \ 113 bs_BA \ 114 ca_ES \ 115 cs_CZ \ 116 da_DK \ 117 de_AT de_BE de_CH de_DE de_LI de_LU \ 118 el_CY el_GR \ 119 en_AU en_BW en_BZ en_CA en_GB en_HK en_IE en_IN en_JM en_MH \ 120 en_MT en_NA en_NZ en_PH en_PK en_SG en_TT en_US en_ZA en_ZW \ 121 es_AR es_BO es_CL es_CO es_CR es_DO es_EC es_ES es_GQ es_GT \ 122 es_HN es_MX es_NI es_PA es_PE es_PR es_PY es_SV es_US es_UY \ 123 es_VE \ 124 et_EE \ 125 fi_FI \ 126 fil_PH \ 127 fr_BE fr_CA fr_CF fr_CH fr_FR fr_GN fr_LU fr_MC fr_MG fr_ML \ 128 fr_NE fr_SN \ 129 ga_IE \ 130 gu_IN \ 131 he_IL \ 132 hi_IN \ 133 hr_HR \ 134 hu_HU \ 135 hy_AM \ 136 id_ID \ 137 ii_CN \ 138 is_IS \ 139 it_CH it_IT \ 140 ja_JP \ 141 ka_GE \ 142 kk_KZ \ 143 kn_IN \ 144 ko_KR \ 145 kok_IN \ 146 lt_LT \ 147 lv_LV \ 148 mk_MK \ 149 ml_IN \ 150 mn_CN mn_MN \ 151 mr_IN \ 152 ms_MY \ 153 mt_MT \ 154 ne_IN ne_NP \ 155 nl_BE nl_NL \ 156 nb_NO \ 157 nn_NO \ 158 or_IN \ 159 pa_IN pa_PK \ 160 pl_PL \ 161 pt_BR pt_GW pt_MZ pt_PT \ 162 ro_MD ro_RO \ 163 ru_MD ru_RU ru_UA \ 164 sa_IN \ 165 si_LK \ 166 sk_SK \ 167 sl_SI \ 168 sq_AL \ 169 sr_BA sr_ME sr_RS \ 170 sv_FI sv_SE \ 171 ta_IN ta_LK \ 172 te_IN \ 173 th_TH \ 174 tr_TR \ 175 uk_UA \ 176 ug_CN \ 177 ur_IN ur_PK \ 178 vi_VN \ 179 zh_CN zh_HK zh_MO zh_SG zh_TW 180 181LOCNAMES = \ 182 $(ISO8859_1_LOCALES:%=%.ISO8859-1) \ 183 $(ISO8859_2_LOCALES:%=%.ISO8859-2) \ 184 $(ISO8859_5_LOCALES:%=%.ISO8859-5) \ 185 $(ISO8859_6_LOCALES:%=%.ISO8859-6) \ 186 $(ISO8859_7_LOCALES:%=%.ISO8859-7) \ 187 $(ISO8859_9_LOCALES:%=%.ISO8859-9) \ 188 $(ISO8859_11_LOCALES:%=%.ISO8859-11) \ 189 $(ISO8859_13_LOCALES:%=%.ISO8859-13) \ 190 $(ISO8859_15_LOCALES:%=%.ISO8859-15) \ 191 $(KOI8_R_LOCALES:%=%.KOI8-R) \ 192 $(UTF_8_LOCALES:%=%.UTF-8) 193 194LOCDIRS = $(LOCNAMES:%=locale/%) 195 196STAMPFILES = $(LOCDIRS:%=%/stamp) 197 198CATDIRS = \ 199 $(LOCDIRS:%=%/LC_COLLATE) \ 200 $(LOCDIRS:%=%/LC_CTYPE) \ 201 $(LOCDIRS:%=%/LC_MESSAGES) \ 202 $(LOCDIRS:%=%/LC_MONETARY) \ 203 $(LOCDIRS:%=%/LC_NUMERIC) \ 204 $(LOCDIRS:%=%/LC_TIME) 205 206DATA = $(CATDIRS:%=%/LCL_DATA) 207 208DCOLL = LC_COLLATE/LCL_DATA 209DCTYPE = LC_CTYPE/LCL_DATA 210DMSGS = LC_MESSAGES/LCL_DATA 211DMON = LC_MONETARY/LCL_DATA 212DNUM = LC_NUMERIC/LCL_DATA 213DTIME = LC_TIME/LCL_DATA 214 215ROOTLOCDIRS = $(LOCDIRS:%=$(ROOTLIB)/%) 216ROOTCATDIRS = $(CATDIRS:%=$(ROOTLIB)/%) 217ROOTDATA = $(DATA:%=$(ROOTLIB)/%) 218 219$(ROOTDATA) := FILEMODE=0444 220 221all: $(PROG) $(DATA) 222 223install: all $(ROOTPROG) $(ROOTDATA) 224 225$(PROG): $(OBJS) 226 $(LINK.c) $(OBJS) -o $@ $(LDLIBS) 227 $(POST_PROCESS) 228 229$(OBJS): parser.tab.h 230 231parser.tab.c parser.tab.h: parser.y $(HDRS) 232 $(YACC) $(YFLAGS) parser.y 233 234lint: $(SRCS) 235 $(LINT.c) $(CPPFLAGS) $(SRCS) 236 237clean: 238 $(RM) $(CLEANFILES) 239 $(RM) $(STAMPFILES) 240 241$(POFILE): $(PIFILES) 242 $(RM) $@ 243 $(RM) messages.po 244 $(XGETTEXT) -s $(PIFILES) 245 $(SED) -e '/domain/d' messages.po > $@ 246 $(RM) $(PIFILES) messages.po 247 248locale $(ROOTLOCDIRS) $(ROOTCATDIRS): 249 $(INS.dir) 250 251include ../Makefile.targ 252 253locale/%.UTF-8/stamp: data/%.UTF-8.src UTF-8.cm locale $(PROG) 254 ./$(PROG) -U -i $< -f UTF-8.cm $(@D) 255 $(TOUCH) $@ 256locale/%.ISO8859-1/stamp: data/%.UTF-8.src 8859-1.cm locale $(PROG) 257 ./$(PROG) -U -i $< -f 8859-1.cm $(@D) 258 $(TOUCH) $@ 259locale/%.ISO8859-2/stamp: data/%.UTF-8.src 8859-2.cm locale $(PROG) 260 ./$(PROG) -U -i $< -f 8859-2.cm $(@D) 261 $(TOUCH) $@ 262locale/%.ISO8859-5/stamp: data/%.UTF-8.src 8859-5.cm locale $(PROG) 263 ./$(PROG) -U -i $< -f 8859-5.cm $(@D) 264 $(TOUCH) $@ 265locale/%.ISO8859-7/stamp: data/%.UTF-8.src 8859-7.cm locale $(PROG) 266 ./$(PROG) -U -i $< -f 8859-7.cm $(@D) 267 $(TOUCH) $@ 268locale/%.ISO8859-6/stamp: data/%.UTF-8.src 8859-6.cm locale $(PROG) 269 ./$(PROG) -U -i $< -f 8859-6.cm $(@D) 270 $(TOUCH) $@ 271locale/%.ISO8859-9/stamp: data/%.UTF-8.src 8859-9.cm locale $(PROG) 272 ./$(PROG) -U -i $< -f 8859-9.cm $(@D) 273 $(TOUCH) $@ 274locale/%.ISO8859-11/stamp: data/%.UTF-8.src 8859-11.cm locale $(PROG) 275 ./$(PROG) -U -i $< -f 8859-11.cm $(@D) 276 $(TOUCH) $@ 277locale/%.ISO8859-13/stamp: data/%.UTF-8.src 8859-13.cm locale $(PROG) 278 ./$(PROG) -U -i $< -f 8859-13.cm $(@D) 279 $(TOUCH) $@ 280locale/%.ISO8859-15/stamp: data/%.UTF-8.src 8859-15.cm locale $(PROG) 281 ./$(PROG) -U -i $< -f 8859-15.cm $(@D) 282 $(TOUCH) $@ 283locale/%.KOI8-R/stamp: data/%.UTF-8.src KOI8-R.cm locale $(PROG) 284 ./$(PROG) -U -i $< -f KOI8-R.cm $(@D) 285 $(TOUCH) $@ 286 287locale/%/$(DCOLL): locale/%/stamp 288locale/%/$(DCTYPE): locale/%/stamp 289locale/%/$(DMSGS): locale/%/stamp 290locale/%/$(DMON): locale/%/stamp 291locale/%/$(DNUM): locale/%/stamp 292locale/%/$(DTIME): locale/%/stamp 293 294UTF-8.cm: data/UTF-8.cm 295 $(LN) -sf data/UTF-8.cm $@ 296 297%.cm: data/%.TXT UTF-8.cm 298 $(RM) $@ 299 $(PERL) data/convert_map.pl $< > $@ 300 301$(ROOTDATA): $(ROOTLOCDIRS) $(ROOTCATDIRS) $(DATA) 302 $(RM) $@ 303 $(CP) $(@:$(ROOTLIB)/%=%) $@ 304 $(CHMOD) 0444 $@ 305