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