1 #-------------------------------------------------------------------------
3 # Makefile for src/backend/utils/mb/Unicode
5 # Copyright (c) 2001-2022, PostgreSQL Global Development Group
7 # src/backend/utils/mb/Unicode/Makefile
9 #-------------------------------------------------------------------------
11 subdir
= src
/backend
/utils
/mb
/Unicode
12 top_builddir
= ..
/..
/..
/..
/..
13 include $(top_builddir
)/src
/Makefile.global
16 # Define a rule to create the map files from downloaded text input
17 # files using a script. Arguments:
19 # 1: encoding name used in output files (lower case)
22 # 4: argument to pass to script (optional)
24 # We also collect all the input and output files in variables to
25 # define the build and clean rules below.
27 # Note that while each script call produces two output files, to be
28 # parallel-make safe we need to split this into two rules. (See for
29 # example gram.y for more explanation.)
32 MAPS
+= $(1)_to_utf8.map utf8_to_
$(1).map
35 $(1)_to_utf8.map
: $(2) $(3)
36 $(PERL
) -I
$$(srcdir) $$< $(4)
38 utf8_to_
$(1).map
: $(1)_to_utf8.map
42 $(foreach n
,2 3 4 5 6 7 8 9 10 13 14 15 16,$(eval
$(call map_rule
,iso8859_
$(n
),UCS_to_most.pl
,8859-$(n
).TXT
,ISO8859_
$(n
))))
44 $(foreach n
,866 874 1250 1251 1252 1253 1254 1255 1256 1257 1258,$(eval
$(call map_rule
,win
$(n
),UCS_to_most.pl
,CP
$(n
).TXT
,WIN
$(n
))))
46 $(eval
$(call map_rule
,koi8r
,UCS_to_most.pl
,KOI8-R.TXT
,KOI8R
))
47 $(eval
$(call map_rule
,koi8u
,UCS_to_most.pl
,KOI8-U.TXT
,KOI8U
))
48 $(eval
$(call map_rule
,gbk
,UCS_to_most.pl
,CP936.TXT
,GBK
))
50 $(eval
$(call map_rule
,johab
,UCS_to_JOHAB.pl
,JOHAB.TXT
))
51 $(eval
$(call map_rule
,uhc
,UCS_to_UHC.pl
,windows-949-2000.xml
))
52 $(eval
$(call map_rule
,euc_jp
,UCS_to_EUC_JP.pl
,CP932.TXT JIS0212.TXT
))
53 $(eval
$(call map_rule
,euc_cn
,UCS_to_EUC_CN.pl
,gb-18030-2000.xml
))
54 $(eval
$(call map_rule
,euc_kr
,UCS_to_EUC_KR.pl
,KSX1001.TXT
))
55 $(eval
$(call map_rule
,euc_tw
,UCS_to_EUC_TW.pl
,CNS11643.TXT
))
56 $(eval
$(call map_rule
,sjis
,UCS_to_SJIS.pl
,CP932.TXT
))
57 $(eval
$(call map_rule
,gb18030
,UCS_to_GB18030.pl
,gb-18030-2000.xml
))
58 $(eval
$(call map_rule
,big5
,UCS_to_BIG5.pl
,CP950.TXT BIG5.TXT CP950.TXT
))
59 $(eval
$(call map_rule
,euc_jis_2004
,UCS_to_EUC_JIS_2004.pl
,euc-jis-2004-std.txt
))
60 $(eval
$(call map_rule
,shift_jis_2004
,UCS_to_SHIFT_JIS_2004.pl
,sjis-0213-2004-std.txt
))
63 TEXTS
= $(sort $(ALL_TEXTS
))
70 maintainer-clean
: distclean
74 BIG5.TXT CNS11643.TXT
:
75 $(DOWNLOAD
) https
://www.unicode.org
/Public
/MAPPINGS
/OBSOLETE
/EASTASIA
/OTHER
/$(@F
)
77 euc-jis-2004-std.txt sjis-0213-2004-std.txt
:
78 $(DOWNLOAD
) http
://x0213.org
/codetable
/$(@F
)
80 gb-18030-2000.xml windows-949-2000.xml
:
81 $(DOWNLOAD
) https
://raw.githubusercontent.com
/unicode-org
/icu-data
/master
/charset
/data
/xml
/$(@F
)
84 $(DOWNLOAD
) 'http://trac.greenstone.org/browser/trunk/gsdl/unicode/MAPPINGS/EASTASIA/GB/GB2312.TXT?rev=1842&format=txt'
87 $(DOWNLOAD
) https
://www.unicode.org
/Public
/MAPPINGS
/OBSOLETE
/EASTASIA
/JIS
/$(@F
)
89 JOHAB.TXT KSX1001.TXT
:
90 $(DOWNLOAD
) https
://www.unicode.org
/Public
/MAPPINGS
/OBSOLETE
/EASTASIA
/KSC
/$(@F
)
92 KOI8-R.TXT KOI8-U.TXT
:
93 $(DOWNLOAD
) https
://www.unicode.org
/Public
/MAPPINGS
/VENDORS
/MISC
/$(@F
)
95 $(filter 8859-%.TXT
,$(TEXTS
)):
96 $(DOWNLOAD
) https
://www.unicode.org
/Public
/MAPPINGS
/ISO8859
/$(@F
)
98 $(filter CP9
%.TXT CP12
%.TXT
,$(TEXTS
)):
99 $(DOWNLOAD
) https
://www.unicode.org
/Public
/MAPPINGS
/VENDORS
/MICSFT
/WINDOWS
/$(@F
)
101 $(filter CP8
%.TXT
,$(TEXTS
)):
102 $(DOWNLOAD
) https
://www.unicode.org
/Public
/MAPPINGS
/VENDORS
/MICSFT
/PC
/$(@F
)