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