xref: /titanic_51/usr/src/cmd/localedef/Makefile (revision 5b72c2c78cdaab2439f613a7a9df81548c42c2ce)
16b5e5868SGarrett D'Amore#
26b5e5868SGarrett D'Amore# This file and its contents are supplied under the terms of the
36b5e5868SGarrett D'Amore# Common Development and Distribution License ("CDDL"), version 1.0.
45aec55ebSGarrett D'Amore# You may only use this file in accordance with the terms of version
55aec55ebSGarrett D'Amore# 1.0 of the CDDL.
66b5e5868SGarrett D'Amore#
76b5e5868SGarrett D'Amore# A full copy of the text of the CDDL should have accompanied this
86b5e5868SGarrett D'Amore# source.  A copy of the CDDL is also available via the Internet at
96b5e5868SGarrett D'Amore# http://www.illumos.org/license/CDDL.
106b5e5868SGarrett D'Amore#
116b5e5868SGarrett D'Amore
126b5e5868SGarrett D'Amore#
136b5e5868SGarrett D'Amore# Copyright 2010 Nexenta Systems, Inc.  All rights reserved.
146b5e5868SGarrett D'Amore#
156b5e5868SGarrett D'Amore
166b5e5868SGarrett D'AmorePROG=localedef
176b5e5868SGarrett D'Amore
186b5e5868SGarrett D'Amoreinclude ../Makefile.cmd
196b5e5868SGarrett D'Amore
206b5e5868SGarrett D'AmoreOBJS = 	charmap.o collate.o ctype.o messages.o monetary.o numeric.o time.o \
216b5e5868SGarrett D'Amore	scanner.o localedef.o wide.o parser.tab.o
226b5e5868SGarrett D'Amore
236b5e5868SGarrett D'AmoreHDRS	= localedef.h
246b5e5868SGarrett D'Amore
256b5e5868SGarrett D'AmoreSRCS	= $(OBJS:%.o=%.c)
266b5e5868SGarrett D'Amore
276b5e5868SGarrett D'AmoreCPPFLAGS	+= -I $(SRC)/lib/libc/port/locale
286b5e5868SGarrett D'AmoreLDLIBS		+= -lgen
296b5e5868SGarrett D'AmoreLDLIBS 		+= -lavl
306b5e5868SGarrett D'AmoreYFLAGS		= -d -b parser
316b5e5868SGarrett D'AmoreCLEANFILES	= $(OBJS) parser.tab.c parser.tab.h
326b5e5868SGarrett D'AmoreCLEANFILES	+= \
336b5e5868SGarrett D'Amore		UTF-8.cm \
346b5e5868SGarrett D'Amore		8859-1.cm 8859-2.cm 8859-3.cm 8859-4.cm \
356b5e5868SGarrett D'Amore		8859-5.cm 8859-5.cm 8859-6.cm 8859-7.cm \
366b5e5868SGarrett D'Amore		8859-8.cm 8859-9.cm 8859-9.cm 8859-10.cm \
376b5e5868SGarrett D'Amore		8859-11.cm 8859-13.cm 8859-14.cm 8859-15.cm \
386b5e5868SGarrett D'Amore		8859-16.cm \
396b5e5868SGarrett D'Amore		KOI8-R.cm
406b5e5868SGarrett D'AmoreCLOBBERFILES	= $(PROG) $(POFILE) $(DATA:%=locale/%)
416b5e5868SGarrett D'AmorePIFILES		= $(OBJS:%.o=%.i)
426b5e5868SGarrett D'AmorePOFILE		= localedef_cmd.po
436b5e5868SGarrett D'Amore
446b5e5868SGarrett D'AmoreISO8859_1_LOCALES	= \
456b5e5868SGarrett D'Amore		da_DK \
466b5e5868SGarrett D'Amore		de_CH \
476b5e5868SGarrett D'Amore		en_AU en_CA en_GB en_NZ en_US \
486b5e5868SGarrett D'Amore		es_AR es_BO es_CL es_CO es_EC es_GT es_MX es_NI es_PA \
496b5e5868SGarrett D'Amore		es_PE es_SV es_UY es_VE \
506b5e5868SGarrett D'Amore		fr_CA fr_CH \
516b5e5868SGarrett D'Amore		is_IS \
526b5e5868SGarrett D'Amore		it_CH \
536b5e5868SGarrett D'Amore		sv_SE
546b5e5868SGarrett D'Amore
556b5e5868SGarrett D'AmoreISO8859_2_LOCALES	= \
566b5e5868SGarrett D'Amore		cs_CZ \
576b5e5868SGarrett D'Amore		hr_HR \
586b5e5868SGarrett D'Amore		hu_HU \
596b5e5868SGarrett D'Amore		pl_PL \
606b5e5868SGarrett D'Amore		sq_AL
616b5e5868SGarrett D'Amore
626b5e5868SGarrett D'AmoreISO8859_5_LOCALES	= \
636b5e5868SGarrett D'Amore		bg_BG \
646b5e5868SGarrett D'Amore		mk_MK \
656b5e5868SGarrett D'Amore		ru_RU
666b5e5868SGarrett D'Amore
676b5e5868SGarrett D'AmoreISO8859_6_LOCALES	= \
686b5e5868SGarrett D'Amore		ar_EG
696b5e5868SGarrett D'Amore
706b5e5868SGarrett D'AmoreISO8859_7_LOCALES	= \
716b5e5868SGarrett D'Amore		el_GR
726b5e5868SGarrett D'Amore
736b5e5868SGarrett D'AmoreISO8859_9_LOCALES	= \
746b5e5868SGarrett D'Amore		tr_TR
756b5e5868SGarrett D'Amore
766b5e5868SGarrett D'AmoreISO8859_11_LOCALES	= \
776b5e5868SGarrett D'Amore		th_TH
786b5e5868SGarrett D'Amore
796b5e5868SGarrett D'AmoreISO8859_13_LOCALES	= \
806b5e5868SGarrett D'Amore		lt_LT \
816b5e5868SGarrett D'Amore		lv_LV
826b5e5868SGarrett D'Amore
836b5e5868SGarrett D'AmoreISO8859_15_LOCALES	= \
846b5e5868SGarrett D'Amore		ca_ES \
856b5e5868SGarrett D'Amore		da_DK \
866b5e5868SGarrett D'Amore		de_AT de_DE \
876b5e5868SGarrett D'Amore		en_GB en_IE en_US \
886b5e5868SGarrett D'Amore		es_ES \
896b5e5868SGarrett D'Amore		fi_FI \
906b5e5868SGarrett D'Amore		fr_BE fr_FR \
916b5e5868SGarrett D'Amore		it_IT \
926b5e5868SGarrett D'Amore		nl_BE nl_NL \
936b5e5868SGarrett D'Amore		pt_PT \
946b5e5868SGarrett D'Amore		sv_FI sv_SE
956b5e5868SGarrett D'Amore
966b5e5868SGarrett D'AmoreKOI8_R_LOCALES		= \
976b5e5868SGarrett D'Amore		ru_RU
986b5e5868SGarrett D'Amore
996b5e5868SGarrett D'Amore#
1006b5e5868SGarrett D'Amore# All new locales should be in UTF-8 form.
1016b5e5868SGarrett D'Amore#
1026b5e5868SGarrett D'AmoreUTF_8_LOCALES		= \
1036b5e5868SGarrett D'Amore		af_ZA \
1046b5e5868SGarrett D'Amore		ar_AE ar_BH ar_DZ ar_EG ar_IQ ar_JO ar_KW ar_LB ar_LY ar_MA \
1056b5e5868SGarrett D'Amore		ar_OM ar_QA ar_SA ar_TN ar_YE \
1066b5e5868SGarrett D'Amore		as_IN \
1076b5e5868SGarrett D'Amore		az_AZ \
1086b5e5868SGarrett D'Amore		be_BY \
1096b5e5868SGarrett D'Amore		bg_BG \
1106b5e5868SGarrett D'Amore		bn_BD bn_IN \
1116b5e5868SGarrett D'Amore		bo_CN bo_IN \
1126b5e5868SGarrett D'Amore		ca_ES \
1136b5e5868SGarrett D'Amore		cs_CZ \
1146b5e5868SGarrett D'Amore		da_DK \
1156b5e5868SGarrett D'Amore		de_AT de_BE de_CH de_DE de_LI de_LU \
1166b5e5868SGarrett D'Amore		el_CY el_GR \
1176b5e5868SGarrett D'Amore		en_AU en_BW en_BZ en_CA en_GB en_HK en_IE en_IN en_JM en_MH \
1186b5e5868SGarrett D'Amore		en_MT en_NA en_NZ en_PH en_PK en_SG en_TT en_US en_ZA en_ZW \
1196b5e5868SGarrett D'Amore		es_AR es_BO es_CL es_CO es_CR es_DO es_EC es_ES es_GQ es_GT \
1206b5e5868SGarrett D'Amore		es_HN es_MX es_NI es_PA es_PE es_PR es_PY es_SV es_US es_UY \
1216b5e5868SGarrett D'Amore		es_VE \
1226b5e5868SGarrett D'Amore		et_EE \
1236b5e5868SGarrett D'Amore		fi_FI \
1246b5e5868SGarrett D'Amore		fil_PH \
1256b5e5868SGarrett D'Amore		fr_BE fr_CA fr_CF fr_CH fr_FR fr_GN fr_LU fr_MC fr_MG fr_ML \
1266b5e5868SGarrett D'Amore		fr_NE fr_SN \
1276b5e5868SGarrett D'Amore		ga_IE \
1286b5e5868SGarrett D'Amore		gu_IN \
1296b5e5868SGarrett D'Amore		he_IL \
1306b5e5868SGarrett D'Amore		hi_IN \
1316b5e5868SGarrett D'Amore		hr_HR \
1326b5e5868SGarrett D'Amore		hu_HU \
1336b5e5868SGarrett D'Amore		hy_AM \
1346b5e5868SGarrett D'Amore		id_ID \
1356b5e5868SGarrett D'Amore		ii_CN \
1366b5e5868SGarrett D'Amore		is_IS \
1376b5e5868SGarrett D'Amore		it_CH it_IT \
1386b5e5868SGarrett D'Amore		ja_JP \
1396b5e5868SGarrett D'Amore		ka_GE \
1406b5e5868SGarrett D'Amore		kk_KZ \
1416b5e5868SGarrett D'Amore		kn_IN \
1426b5e5868SGarrett D'Amore		ko_KR \
1436b5e5868SGarrett D'Amore		kok_IN \
1446b5e5868SGarrett D'Amore		lt_LT \
1456b5e5868SGarrett D'Amore		lv_LV \
1466b5e5868SGarrett D'Amore		mk_MK \
1476b5e5868SGarrett D'Amore		ml_IN \
1486b5e5868SGarrett D'Amore		mn_CN mn_MN \
1496b5e5868SGarrett D'Amore		mr_IN \
150*5b72c2c7SShampavman		ms_MY \
1516b5e5868SGarrett D'Amore		mt_MT \
1526b5e5868SGarrett D'Amore		ne_IN ne_NP \
1536b5e5868SGarrett D'Amore		nl_BE nl_NL \
1546b5e5868SGarrett D'Amore		nb_NO \
1556b5e5868SGarrett D'Amore		nn_NO \
1566b5e5868SGarrett D'Amore		or_IN \
1576b5e5868SGarrett D'Amore		pa_IN pa_PK \
1586b5e5868SGarrett D'Amore		pl_PL \
1596b5e5868SGarrett D'Amore		pt_BR pt_GW pt_MZ pt_PT \
1606b5e5868SGarrett D'Amore		ro_MD ro_RO \
1616b5e5868SGarrett D'Amore		ru_MD ru_RU ru_UA \
1626b5e5868SGarrett D'Amore		sa_IN \
1636b5e5868SGarrett D'Amore		si_LK \
1646b5e5868SGarrett D'Amore		sk_SK \
1656b5e5868SGarrett D'Amore		sq_AL \
1666b5e5868SGarrett D'Amore		sv_FI sv_SE \
1676b5e5868SGarrett D'Amore		ta_IN ta_LK \
1686b5e5868SGarrett D'Amore		te_IN \
1696b5e5868SGarrett D'Amore		th_TH \
1706b5e5868SGarrett D'Amore		tr_TR \
1716b5e5868SGarrett D'Amore		uk_UA \
1726b5e5868SGarrett D'Amore		ug_CN \
1736b5e5868SGarrett D'Amore		ur_IN ur_PK \
1746b5e5868SGarrett D'Amore		vi_VN \
1756b5e5868SGarrett D'Amore		zh_CN zh_HK zh_MO zh_SG zh_TW
1766b5e5868SGarrett D'Amore
1776b5e5868SGarrett D'AmoreLOCNAMES	= \
1786b5e5868SGarrett D'Amore		$(ISO8859_1_LOCALES:%=%.ISO8859-1) \
1796b5e5868SGarrett D'Amore		$(ISO8859_2_LOCALES:%=%.ISO8859-2) \
1806b5e5868SGarrett D'Amore		$(ISO8859_5_LOCALES:%=%.ISO8859-5) \
1816b5e5868SGarrett D'Amore		$(ISO8859_6_LOCALES:%=%.ISO8859-6) \
1826b5e5868SGarrett D'Amore		$(ISO8859_7_LOCALES:%=%.ISO8859-7) \
1836b5e5868SGarrett D'Amore		$(ISO8859_9_LOCALES:%=%.ISO8859-9) \
1846b5e5868SGarrett D'Amore		$(ISO8859_11_LOCALES:%=%.ISO8859-11) \
1856b5e5868SGarrett D'Amore		$(ISO8859_13_LOCALES:%=%.ISO8859-13) \
1866b5e5868SGarrett D'Amore		$(ISO8859_15_LOCALES:%=%.ISO8859-15) \
1876b5e5868SGarrett D'Amore		$(KOI8_R_LOCALES:%=%.KOI8-R) \
1886b5e5868SGarrett D'Amore		$(UTF_8_LOCALES:%=%.UTF-8)
1896b5e5868SGarrett D'Amore
1906b5e5868SGarrett D'AmoreLOCDIRS		= $(LOCNAMES:%=locale/%)
1916b5e5868SGarrett D'Amore
1926b5e5868SGarrett D'AmoreSTAMPFILES	= $(LOCDIRS:%=%/stamp)
1936b5e5868SGarrett D'Amore
1946b5e5868SGarrett D'AmoreCATDIRS		= \
1956b5e5868SGarrett D'Amore		$(LOCDIRS:%=%/LC_COLLATE) \
1966b5e5868SGarrett D'Amore		$(LOCDIRS:%=%/LC_CTYPE) \
1976b5e5868SGarrett D'Amore		$(LOCDIRS:%=%/LC_MESSAGES) \
1986b5e5868SGarrett D'Amore		$(LOCDIRS:%=%/LC_MONETARY) \
1996b5e5868SGarrett D'Amore		$(LOCDIRS:%=%/LC_NUMERIC) \
2006b5e5868SGarrett D'Amore		$(LOCDIRS:%=%/LC_TIME)
2016b5e5868SGarrett D'Amore
2026b5e5868SGarrett D'AmoreDATA		= $(CATDIRS:%=%/LCL_DATA)
2036b5e5868SGarrett D'Amore
2046b5e5868SGarrett D'AmoreDCOLL		= LC_COLLATE/LCL_DATA
2056b5e5868SGarrett D'AmoreDCTYPE		= LC_CTYPE/LCL_DATA
2066b5e5868SGarrett D'AmoreDMSGS		= LC_MESSAGES/LCL_DATA
2076b5e5868SGarrett D'AmoreDMON		= LC_MONETARY/LCL_DATA
2086b5e5868SGarrett D'AmoreDNUM		= LC_NUMERIC/LCL_DATA
2096b5e5868SGarrett D'AmoreDTIME		= LC_TIME/LCL_DATA
2106b5e5868SGarrett D'Amore
2116b5e5868SGarrett D'AmoreROOTLOCDIRS	= $(LOCDIRS:%=$(ROOTLIB)/%)
2126b5e5868SGarrett D'AmoreROOTCATDIRS	= $(CATDIRS:%=$(ROOTLIB)/%)
2136b5e5868SGarrett D'AmoreROOTDATA	= $(DATA:%=$(ROOTLIB)/%)
2146b5e5868SGarrett D'Amore
2156b5e5868SGarrett D'Amore$(ROOTDATA)	:= FILEMODE=0444
2166b5e5868SGarrett D'Amore
2176b5e5868SGarrett D'Amoreall: $(PROG) $(DATA)
2186b5e5868SGarrett D'Amore
2196b5e5868SGarrett D'Amoreinstall: all $(ROOTPROG) $(ROOTDATA)
2206b5e5868SGarrett D'Amore
2216b5e5868SGarrett D'Amore$(PROG): $(OBJS)
2226b5e5868SGarrett D'Amore	$(LINK.c) $(OBJS) -o $@ $(LDLIBS)
2236b5e5868SGarrett D'Amore	$(POST_PROCESS)
2246b5e5868SGarrett D'Amore
2256b5e5868SGarrett D'Amore$(OBJS):	parser.tab.h
2266b5e5868SGarrett D'Amore
2276b5e5868SGarrett D'Amoreparser.tab.c parser.tab.h: parser.y $(HDRS)
2286b5e5868SGarrett D'Amore	$(YACC) $(YFLAGS) parser.y
2296b5e5868SGarrett D'Amore
2306b5e5868SGarrett D'Amorelint:	$(SRCS)
2316b5e5868SGarrett D'Amore	$(LINT.c) $(CPPFLAGS) $(SRCS)
2326b5e5868SGarrett D'Amore
2336b5e5868SGarrett D'Amoreclean:
2346b5e5868SGarrett D'Amore	$(RM) $(CLEANFILES)
2356b5e5868SGarrett D'Amore	$(RM) $(STAMPFILES)
2366b5e5868SGarrett D'Amore
2376b5e5868SGarrett D'Amore$(POFILE):	$(PIFILES)
2386b5e5868SGarrett D'Amore	$(RM) $@
2396b5e5868SGarrett D'Amore	$(RM) messages.po
2406b5e5868SGarrett D'Amore	$(XGETTEXT) -s $(PIFILES)
2416b5e5868SGarrett D'Amore	$(SED) -e '/domain/d' messages.po > $@
2426b5e5868SGarrett D'Amore	$(RM) $(PIFILES) messages.po
2436b5e5868SGarrett D'Amore
2446b5e5868SGarrett D'Amorelocale $(ROOTLOCDIRS) $(ROOTCATDIRS):
2456b5e5868SGarrett D'Amore	$(INS.dir)
2466b5e5868SGarrett D'Amore
2476b5e5868SGarrett D'Amoreinclude ../Makefile.targ
2486b5e5868SGarrett D'Amore
2496b5e5868SGarrett D'Amorelocale/%.UTF-8/stamp:		data/%.UTF-8.src UTF-8.cm locale $(PROG)
2506b5e5868SGarrett D'Amore	./$(PROG) -U -i $< -f UTF-8.cm $(@D)
2516b5e5868SGarrett D'Amore	$(TOUCH) $@
2526b5e5868SGarrett D'Amorelocale/%.ISO8859-1/stamp:	data/%.UTF-8.src 8859-1.cm locale $(PROG)
2536b5e5868SGarrett D'Amore	./$(PROG) -U -i $< -f 8859-1.cm $(@D)
2546b5e5868SGarrett D'Amore	$(TOUCH) $@
2556b5e5868SGarrett D'Amorelocale/%.ISO8859-2/stamp:	data/%.UTF-8.src 8859-2.cm locale $(PROG)
2566b5e5868SGarrett D'Amore	./$(PROG) -U -i $< -f 8859-2.cm $(@D)
2576b5e5868SGarrett D'Amore	$(TOUCH) $@
2586b5e5868SGarrett D'Amorelocale/%.ISO8859-5/stamp:	data/%.UTF-8.src 8859-5.cm locale $(PROG)
2596b5e5868SGarrett D'Amore	./$(PROG) -U -i $< -f 8859-5.cm $(@D)
2606b5e5868SGarrett D'Amore	$(TOUCH) $@
2616b5e5868SGarrett D'Amorelocale/%.ISO8859-7/stamp:	data/%.UTF-8.src 8859-7.cm locale $(PROG)
2626b5e5868SGarrett D'Amore	./$(PROG) -U -i $< -f 8859-7.cm $(@D)
2636b5e5868SGarrett D'Amore	$(TOUCH) $@
2646b5e5868SGarrett D'Amorelocale/%.ISO8859-6/stamp:	data/%.UTF-8.src 8859-6.cm locale $(PROG)
2656b5e5868SGarrett D'Amore	./$(PROG) -U -i $< -f 8859-6.cm $(@D)
2666b5e5868SGarrett D'Amore	$(TOUCH) $@
2676b5e5868SGarrett D'Amorelocale/%.ISO8859-9/stamp:	data/%.UTF-8.src 8859-9.cm locale $(PROG)
2686b5e5868SGarrett D'Amore	./$(PROG) -U -i $< -f 8859-9.cm $(@D)
2696b5e5868SGarrett D'Amore	$(TOUCH) $@
2706b5e5868SGarrett D'Amorelocale/%.ISO8859-11/stamp:	data/%.UTF-8.src 8859-11.cm locale $(PROG)
2716b5e5868SGarrett D'Amore	./$(PROG) -U -i $< -f 8859-11.cm $(@D)
2726b5e5868SGarrett D'Amore	$(TOUCH) $@
2736b5e5868SGarrett D'Amorelocale/%.ISO8859-13/stamp:	data/%.UTF-8.src 8859-13.cm locale $(PROG)
2746b5e5868SGarrett D'Amore	./$(PROG) -U -i $< -f 8859-13.cm $(@D)
2756b5e5868SGarrett D'Amore	$(TOUCH) $@
2766b5e5868SGarrett D'Amorelocale/%.ISO8859-15/stamp:	data/%.UTF-8.src 8859-15.cm locale $(PROG)
2776b5e5868SGarrett D'Amore	./$(PROG) -U -i $< -f 8859-15.cm $(@D)
2786b5e5868SGarrett D'Amore	$(TOUCH) $@
2796b5e5868SGarrett D'Amorelocale/%.KOI8-R/stamp:		data/%.UTF-8.src KOI8-R.cm locale $(PROG)
2806b5e5868SGarrett D'Amore	./$(PROG) -U -i $< -f KOI8-R.cm $(@D)
2816b5e5868SGarrett D'Amore	$(TOUCH) $@
2826b5e5868SGarrett D'Amore
2836b5e5868SGarrett D'Amorelocale/%/$(DCOLL):	locale/%/stamp
2846b5e5868SGarrett D'Amorelocale/%/$(DCTYPE):	locale/%/stamp
2856b5e5868SGarrett D'Amorelocale/%/$(DMSGS):	locale/%/stamp
2866b5e5868SGarrett D'Amorelocale/%/$(DMON):	locale/%/stamp
2876b5e5868SGarrett D'Amorelocale/%/$(DNUM):	locale/%/stamp
2886b5e5868SGarrett D'Amorelocale/%/$(DTIME):	locale/%/stamp
2896b5e5868SGarrett D'Amore
2906b5e5868SGarrett D'AmoreUTF-8.cm: data/UTF-8.cm
2916b5e5868SGarrett D'Amore	$(LN) -sf data/UTF-8.cm  $@
2926b5e5868SGarrett D'Amore
2936b5e5868SGarrett D'Amore%.cm: data/%.TXT UTF-8.cm
2946b5e5868SGarrett D'Amore	$(RM) $@
2956b5e5868SGarrett D'Amore	$(PERL) data/convert_map.pl $< > $@
2966b5e5868SGarrett D'Amore
2976b5e5868SGarrett D'Amore$(ROOTDATA):	$(ROOTLOCDIRS) $(ROOTCATDIRS) $(DATA)
2986b5e5868SGarrett D'Amore	$(RM) $@
2996b5e5868SGarrett D'Amore	$(CP) $(@:$(ROOTLIB)/%=%) $@
3006b5e5868SGarrett D'Amore	$(CHMOD) 0444 $@
301