1# 2# CDDL HEADER START 3# 4# The contents of this file are subject to the terms of the 5# Common Development and Distribution License (the "License"). 6# You may not use this file except in compliance with the License. 7# 8# You can obtain a copy of the license at src/OPENSOLARIS.LICENSE 9# or http://www.opensolaris.org/os/licensing. 10# See the License for the specific language governing permissions 11# and limitations under the License. 12# 13# When distributing Covered Code, include this CDDL HEADER in each 14# file and include the License file at src/OPENSOLARIS.LICENSE. 15# If applicable, add the following below this CDDL HEADER, with the 16# fields enclosed by brackets "[]" replaced with your own identifying 17# information: Portions Copyright [yyyy] [name of copyright owner] 18# 19# CDDL HEADER END 20# 21# 22# Copyright 2006 Sun Microsystems, Inc. All rights reserved. 23# Use is subject to license terms. 24# 25# Copyright (c) 2018, Joyent, Inc. 26 27 28include $(SRC)/lib/iconv_modules/Makefile.iconv 29 30install := TARGET = install 31all := TARGET = all 32lint := TARGET = lint 33clean := TARGET = clean 34clobber := TARGET = clobber 35 36dummy: all 37 38COMMON = ../common/ 39ICONV_COMMON = ../../common/ 40 41SRCS = byte_to_comb.c comb_to_byte.c \ 42 euc_to_iso2022-7.c iso2022-7_to_euc.c \ 43 euc_to_johap92.c johap92_to_euc.c \ 44 euc_to_johap.c johap_to_euc.c \ 45 euc_to_nbyte.c nbyte_to_euc.c \ 46 uhang_to_utf_sub.c uhang_to_utf_main.c \ 47 utf_to_uhang_sub.c utf_to_uhang_main.c \ 48 unihan_to_UCS_sub.c unihan_to_UCS_main.c \ 49 ucs_to_unihan.c \ 50 \ 51 euc_to_utf_main.c \ 52 utf_to_euc_main.c \ 53 njh_to_utf_main.c \ 54 utf_to_njh_main.c \ 55 ojh_to_utf_main.c \ 56 utf_to_ojh_main.c \ 57 iso_to_utf_main.c \ 58 utf_to_iso_main.c 59 60 61E2I = ko_KR-euc%ko_KR-iso2022-7.so 62I2E = ko_KR-iso2022-7%ko_KR-euc.so 63E2J92 = ko_KR-euc%ko_KR-johap92.so 64J922E = ko_KR-johap92%ko_KR-euc.so 65E2J = ko_KR-euc%ko_KR-johap.so 66J2E = ko_KR-johap%ko_KR-euc.so 67E2NB = ko_KR-euc%ko_KR-nbyte.so 68NB2E = ko_KR-nbyte%ko_KR-euc.so 69U2UH = ko_KR-UTF-8%ko_KR-cp949.so 70UH2U = ko_KR-cp949%ko_KR-UTF-8.so 71 72UCS2LE2UH = UCS-2LE%ko_KR-cp949.so 73UH2UCS2LE = ko_KR-cp949%UCS-2LE.so 74UCS2BE2UH = UCS-2BE%ko_KR-cp949.so 75UH2UCS2BE = ko_KR-cp949%UCS-2BE.so 76 77E2U = ko_KR-euc%ko_KR-UTF-8.so 78U2E = ko_KR-UTF-8%ko_KR-euc.so 79N2U = ko_KR-johap92%ko_KR-UTF-8.so 80U2N = ko_KR-UTF-8%ko_KR-johap92.so 81O2U = ko_KR-johap%ko_KR-UTF-8.so 82U2O = ko_KR-UTF-8%ko_KR-johap.so 83I2U = ko_KR-iso2022-7%ko_KR-UTF-8.so 84U2I = ko_KR-UTF-8%ko_KR-iso2022-7.so 85 86C9332U = ko_KR-cp933%ko_KR-UTF-8.so 87U2C933 = ko_KR-UTF-8%ko_KR-cp933.so 88 89ALL_SOS = $(E2I) $(I2E) $(E2J92) $(J922E) $(E2J) $(J2E) $(E2NB) $(NB2E) \ 90 $(U2UH) $(UH2U) $(UH2UCS2LE) $(UCS2LE2UH) $(UH2UCS2BE) $(UCS2BE2UH) \ 91 $(U2E) $(E2U) $(N2U) $(U2N) $(O2U) $(U2O) $(I2U) $(U2I) \ 92 $(C9332U) $(U2C933) 93 94LDFLAGS = $(DYNFLAGS) $(LDLIBS) $(CFLAG_OPT) 95CPPFLAGS += -I$(ICONV_COMMON) -I../inc 96 97# needs work 98SMATCH=off 99 100LINK_TARGETS = $(U2UH) $(C9332U) $(UH2U) $(E2U) $(I2U) $(O2U) $(N2U) \ 101 $(E2I) $(E2J) $(E2J92) $(E2NB) $(I2E) $(J2E) $(J922E) $(NVBE) \ 102 $(UCS2BE2UH) $(U2LE2UH) $(U2C933) $(U2E) $(U2I) $(U2O) $(U2N) \ 103 $(UH2UCS2BE) $(UH2UCS2LE) 104 105all: $(ALL_SOS) 106 107# 108# libraries 109# 110$(E2I): euc_to_iso2022-7.o 111 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ euc_to_iso2022-7.o 112 $(POST_PROCESS_SO) 113 114$(I2E): iso2022-7_to_euc.o 115 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ iso2022-7_to_euc.o 116 $(POST_PROCESS_SO) 117 118$(E2J92): euc_to_johap92.o ktable.o comp_to_pack.o c2p.o 119 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ comp_to_pack.o c2p.o euc_to_johap92.o ktable.o 120 $(POST_PROCESS_SO) 121 122$(J922E): johap92_to_euc.o ktable.o 123 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ johap92_to_euc.o ktable.o 124 $(POST_PROCESS_SO) 125 126$(E2J): euc_to_johap.o ktable.o comp_to_pack.o c2p.o 127 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ euc_to_johap.o ktable.o comp_to_pack.o c2p.o 128 $(POST_PROCESS_SO) 129 130$(J2E): johap_to_euc.o ktable.o pack_to_comp.o 131 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ johap_to_euc.o ktable.o pack_to_comp.o 132 $(POST_PROCESS_SO) 133 134$(E2NB): euc_to_nbyte.o comb_to_byte.o 135 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ euc_to_nbyte.o comb_to_byte.o c2p.o ktable.o 136 $(POST_PROCESS_SO) 137 138$(NB2E): nbyte_to_euc.o byte_to_comb.o 139 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ nbyte_to_euc.o byte_to_comb.o c2p.o ktable.o pack_to_comp.o 140 $(POST_PROCESS_SO) 141 142$(U2UH): utf_to_uhang_main.o utf_to_uhang_sub.o common_utf.o common_utf8.o $(COMMON)common_def.h 143 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ utf_to_uhang_main.o utf_to_uhang_sub.o common_utf.o common_utf8.o 144 $(POST_PROCESS_SO) 145 146$(UH2U): uhang_to_utf_main.o uhang_to_utf_sub.o common_utf.o $(COMMON)common_def.h 147 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ uhang_to_utf_main.o uhang_to_utf_sub.o common_utf.o 148 $(POST_PROCESS_SO) 149 150$(UH2UCS2LE) : unihan_to_UCS_sub.o unihan_to_UCS-2LE_main.o common_utf.o 151 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ unihan_to_UCS_sub.o unihan_to_UCS-2LE_main.o common_utf.o 152 $(POST_PROCESS_SO) 153 154$(UCS2LE2UH) : ucs_LE_to_unihan.o utf_to_uhang_sub.o common_utf.o 155 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ ucs_LE_to_unihan.o utf_to_uhang_sub.o common_utf.o 156 $(POST_PROCESS_SO) 157 158$(UH2UCS2BE) : unihan_to_UCS_sub.o unihan_to_UCS-2BE_main.o common_utf.o 159 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ unihan_to_UCS_sub.o unihan_to_UCS-2BE_main.o common_utf.o 160 $(POST_PROCESS_SO) 161 162$(UCS2BE2UH) : ucs_BE_to_unihan.o utf_to_uhang_sub.o common_utf.o 163 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ ucs_BE_to_unihan.o utf_to_uhang_sub.o common_utf.o 164 $(POST_PROCESS_SO) 165 166$(E2U): euc_to_utf_main.o euc_to_utf_sub.o common_utf.o $(COMMON)common_def.h 167 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ euc_to_utf_main.o euc_to_utf_sub.o common_utf.o 168 $(POST_PROCESS_SO) 169 170$(U2E): utf_to_euc_main.o utf_to_euc_sub.o common_utf.o common_utf8.o $(COMMON)common_def.h 171 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ utf_to_euc_main.o utf_to_euc_sub.o common_utf.o common_utf8.o 172 $(POST_PROCESS_SO) 173 174$(N2U): njh_to_utf_main.o njh_to_utf_sub.o common_utf.o $(COMMON)common_def.h 175 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ njh_to_utf_main.o njh_to_utf_sub.o common_utf.o 176 $(POST_PROCESS_SO) 177 178$(U2N): utf_to_njh_main.o utf_to_njh_sub.o common_utf.o common_utf8.o $(COMMON)common_def.h 179 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ utf_to_njh_main.o utf_to_njh_sub.o common_utf.o common_utf8.o 180 $(POST_PROCESS_SO) 181 182$(O2U): ojh_to_utf_main.o ojh_to_utf_sub.o common_utf.o $(COMMON)common_def.h 183 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ ojh_to_utf_main.o ojh_to_utf_sub.o common_utf.o 184 $(POST_PROCESS_SO) 185 186$(U2O): utf_to_ojh_main.o utf_to_ojh_sub.o common_utf.o common_utf8.o $(COMMON)common_def.h 187 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ utf_to_ojh_main.o utf_to_ojh_sub.o common_utf.o common_utf8.o 188 $(POST_PROCESS_SO) 189 190$(I2U): iso_to_utf_main.o euc_to_utf_sub.o common_utf.o $(COMMON)common_def.h 191 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ iso_to_utf_main.o euc_to_utf_sub.o common_utf.o 192 $(POST_PROCESS_SO) 193 194$(U2I): utf_to_iso_main.o utf_to_euc_sub.o common_utf.o common_utf8.o $(COMMON)common_def.h 195 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ utf_to_iso_main.o utf_to_euc_sub.o common_utf.o common_utf8.o 196 $(POST_PROCESS_SO) 197 198$(U2C933): UTF8_to_Cp933.o utf8%ibm.o tab_lookup.o $(ICONV_COMMON)tab_lookup.h 199 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ UTF8_to_Cp933.o utf8%ibm.o tab_lookup.o 200 $(POST_PROCESS_SO) 201 202$(C9332U): Cp933_to_UTF8.o ibm%utf8.o tab_lookup.o $(ICONV_COMMON)tab_lookup.h 203 $(CC) $(LDFLAGS) $(CFLAGS) -o $@ Cp933_to_UTF8.o ibm%utf8.o tab_lookup.o 204 $(POST_PROCESS_SO) 205 206# 207# objs 208# 209common_utf8.o: $(ICONV_COMMON)common_utf8.c $(COMMON)common_def.h 210 $(CC) $(CPPFLAGS) -c $(CFLAGS) $(ICONV_COMMON)common_utf8.c -o $@ 211 $(POST_PROCESS_O) 212 213ucs_LE_to_unihan.o : $(COMMON)ucs_to_unihan.c 214 $(CC) $(CPPFLAGS) -c $(CFLAGS) -DUCS_2LE $(COMMON)ucs_to_unihan.c -o $@ 215 $(POST_PROCESS_O) 216 217ucs_BE_to_unihan.o : $(COMMON)ucs_to_unihan.c 218 $(CC) $(CPPFLAGS) -c $(CFLAGS) -DUCS_2BE $(COMMON)ucs_to_unihan.c -o $@ 219 $(POST_PROCESS_O) 220 221unihan_to_UCS-2BE_main.o : $(COMMON)unihan_to_UCS_main.c 222 $(CC) $(CPPFLAGS) -c $(CFLAGS) -DUCS_2BE $(COMMON)unihan_to_UCS_main.c -o $@ 223 $(POST_PROCESS_O) 224 225unihan_to_UCS-2LE_main.o : $(COMMON)unihan_to_UCS_main.c 226 $(CC) $(CPPFLAGS) -c $(CFLAGS) -DUCS_2LE $(COMMON)unihan_to_UCS_main.c -o $@ 227 $(POST_PROCESS_O) 228 229ibm%utf8.o : $(ICONV_COMMON)ibm%utf8.c $(COMMON)common_def.h 230 $(CC) $(CPPFLAGS) -c $(CFLAGS) $(ICONV_COMMON)ibm%utf8.c -o $@ 231 $(POST_PROCESS_O) 232 233utf8%ibm.o: $(ICONV_COMMON)utf8%ibm.c $(COMMON)common_def.h 234 $(CC) $(CPPFLAGS) -c $(CFLAGS) $(ICONV_COMMON)utf8%ibm.c -o $@ 235 $(POST_PROCESS_O) 236 237cnv_utf8ibm.o: $(ICONV_COMMON)cnv_utf8ibm.c $(ICONV_COMMON)tab_lookup.h 238 $(CC) $(CPPFLAGS) -c $(CFLAGS) $(ICONV_COMMON)cnv_utf8ibm.c -o $@ 239 $(POST_PROCESS_O) 240 241cnv_ibmutf8.o: $(ICONV_COMMON)cnv_ibmutf8.c $(ICONV_COMMON)tab_lookup.h 242 $(CC) $(CPPFLAGS) -c $(CFLAGS) $(ICONV_COMMON)cnv_ibmutf8.c -o $@ 243 $(POST_PROCESS_O) 244 245tab_lookup.o: $(ICONV_COMMON)tab_lookup.c $(ICONV_COMMON)tab_lookup.h 246 $(CC) $(CPPFLAGS) -c $(CFLAGS) $(ICONV_COMMON)tab_lookup.c -o $@ 247 $(POST_PROCESS_O) 248 249Cp933_to_UTF8.o: $(COMMON)Cp933_to_UTF8.c $(ICONV_COMMON)tab_lookup.h $(COMMON)cp933_ucs2.h 250 $(CC) $(CPPFLAGS) -c $(CFLAGS) $(COMMON)Cp933_to_UTF8.c -o $@ 251 $(POST_PROCESS_O) 252 253UTF8_to_Cp933.o: $(COMMON)UTF8_to_Cp933.c $(ICONV_COMMON)tab_lookup.h $(COMMON)ucs2_cp933.h 254 $(CC) $(CPPFLAGS) -c $(CFLAGS) $(COMMON)UTF8_to_Cp933.c -o $@ 255 $(POST_PROCESS_O) 256 257# 258# Proto area symlinks 259# 260$(CREATE_LINKS): $(ICONV_LINK_TARGETS) 261 $(SYMLINK) -f ko_KR-UTF-8%ko_KR-cp949.so $(ICONV_DIR)/ko_KR-UTF-8%UnifiedHangul.so 262 $(SYMLINK) -f ko_KR-cp933%ko_KR-UTF-8.so $(ICONV_DIR)/ko_KR-cp933%UTF-8.so 263 $(SYMLINK) -f ko_KR-cp949%ko_KR-UTF-8.so $(ICONV_DIR)/ko_KR-cp949%UTF-8.so 264 $(SYMLINK) -f ko_KR-euc%ko_KR-UTF-8.so $(ICONV_DIR)/ko_KR-euc%UTF-8.so 265 $(SYMLINK) -f ko_KR-iso2022-7%ko_KR-UTF-8.so $(ICONV_DIR)/ko_KR-iso2022-7%UTF-8.so 266 $(SYMLINK) -f ko_KR-johap%ko_KR-UTF-8.so $(ICONV_DIR)/ko_KR-johap%UTF-8.so 267 $(SYMLINK) -f ko_KR-johap92%ko_KR-UTF-8.so $(ICONV_DIR)/ko_KR-johap92%UTF-8.so 268 $(SYMLINK) -f ko_KR-euc%ko_KR-UTF-8.so $(ICONV_DIR)/ko_KR.EUC%UTF-8.so 269 $(SYMLINK) -f ko_KR-cp933%ko_KR-UTF-8.so $(ICONV_DIR)/ko_KR.cp933%UTF-8.so 270 $(SYMLINK) -f ko_KR-cp949%ko_KR-UTF-8.so $(ICONV_DIR)/ko_KR.cp949%UTF-8.so 271 $(SYMLINK) -f ko_KR-euc%ko_KR-UTF-8.so $(ICONV_DIR)/ko_KR.euc%UTF-8.so 272 $(SYMLINK) -f ko_KR-euc%ko_KR-iso2022-7.so $(ICONV_DIR)/ko_KR.euc%ko_KR.iso2022-7.so 273 $(SYMLINK) -f ko_KR-euc%ko_KR-johap.so $(ICONV_DIR)/ko_KR.euc%ko_KR.johap.so 274 $(SYMLINK) -f ko_KR-euc%ko_KR-johap92.so $(ICONV_DIR)/ko_KR.euc%ko_KR.johap92.so 275 $(SYMLINK) -f ko_KR-euc%ko_KR-nbyte.so $(ICONV_DIR)/ko_KR.euc%ko_KR.nbyte.so 276 $(SYMLINK) -f ko_KR-iso2022-7%ko_KR-UTF-8.so $(ICONV_DIR)/ko_KR.iso2022-7%UTF-8.so 277 $(SYMLINK) -f ko_KR-iso2022-7%ko_KR-euc.so $(ICONV_DIR)/ko_KR.iso2022-7%ko_KR.euc.so 278 $(SYMLINK) -f ko_KR-johap%ko_KR-UTF-8.so $(ICONV_DIR)/ko_KR.johap%UTF-8.so 279 $(SYMLINK) -f ko_KR-johap%ko_KR-euc.so $(ICONV_DIR)/ko_KR.johap%ko_KR.euc.so 280 $(SYMLINK) -f ko_KR-johap92%ko_KR-UTF-8.so $(ICONV_DIR)/ko_KR.johap92%UTF-8.so 281 $(SYMLINK) -f ko_KR-johap92%ko_KR-euc.so $(ICONV_DIR)/ko_KR.johap92%ko_KR.euc.so 282 $(SYMLINK) -f ko_KR-nbyte%ko_KR-euc.so $(ICONV_DIR)/ko_KR.nbyte%ko_KR.euc.so 283 $(SYMLINK) -f ko_KR-cp949%UCS-2BE.so $(ICONV_DIR)/5601%UCS-2BE.so 284 $(SYMLINK) -f ko_KR-cp949%UCS-2LE.so $(ICONV_DIR)/5601%UCS-2LE.so 285 $(SYMLINK) -f ko_KR-euc%ko_KR-UTF-8.so $(ICONV_DIR)/5601%UTF-8.so 286 $(SYMLINK) -f ko_KR-euc%ko_KR-UTF-8.so $(ICONV_DIR)/EUC-KR%UTF-8.so 287 $(SYMLINK) -f ko_KR-iso2022-7%ko_KR-UTF-8.so $(ICONV_DIR)/ISO-2022-KR%UTF-8.so 288 $(SYMLINK) -f ko_KR-euc%ko_KR-UTF-8.so $(ICONV_DIR)/KSC5601%UTF-8.so 289 $(SYMLINK) -f ko_KR-euc%ko_KR-UTF-8.so $(ICONV_DIR)/KSX1001%UTF-8.so 290 $(SYMLINK) -f UCS-2BE%ko_KR-cp949.so $(ICONV_DIR)/UCS-2BE%5601.so 291 $(SYMLINK) -f UCS-2LE%ko_KR-cp949.so $(ICONV_DIR)/UCS-2LE%5601.so 292 $(SYMLINK) -f ko_KR-UTF-8%ko_KR-euc.so $(ICONV_DIR)/UTF-8%5601.so 293 $(SYMLINK) -f ko_KR-UTF-8%ko_KR-euc.so $(ICONV_DIR)/UTF-8%EUC-KR.so 294 $(SYMLINK) -f ko_KR-UTF-8%ko_KR-iso2022-7.so $(ICONV_DIR)/UTF-8%ISO-2022-KR.so 295 $(SYMLINK) -f ko_KR-UTF-8%ko_KR-euc.so $(ICONV_DIR)/UTF-8%KSC5601.so 296 $(SYMLINK) -f ko_KR-UTF-8%ko_KR-euc.so $(ICONV_DIR)/UTF-8%KSX1001.so 297 $(SYMLINK) -f ko_KR-UTF-8%ko_KR-cp933.so $(ICONV_DIR)/UTF-8%ko_KR-cp933.so 298 $(SYMLINK) -f ko_KR-UTF-8%ko_KR-cp949.so $(ICONV_DIR)/UTF-8%ko_KR-cp949.so 299 $(SYMLINK) -f ko_KR-UTF-8%ko_KR-euc.so $(ICONV_DIR)/UTF-8%ko_KR-euc.so 300 $(SYMLINK) -f ko_KR-UTF-8%ko_KR-iso2022-7.so $(ICONV_DIR)/UTF-8%ko_KR-iso2022-7.so 301 $(SYMLINK) -f ko_KR-UTF-8%ko_KR-johap.so $(ICONV_DIR)/UTF-8%ko_KR-johap.so 302 $(SYMLINK) -f ko_KR-UTF-8%ko_KR-johap92.so $(ICONV_DIR)/UTF-8%ko_KR-johap92.so 303 $(SYMLINK) -f ko_KR-UTF-8%ko_KR-euc.so $(ICONV_DIR)/UTF-8%ko_KR.EUC.so 304 $(SYMLINK) -f ko_KR-UTF-8%ko_KR-cp933.so $(ICONV_DIR)/UTF-8%ko_KR.cp933.so 305 $(SYMLINK) -f ko_KR-UTF-8%ko_KR-cp949.so $(ICONV_DIR)/UTF-8%ko_KR.cp949.so 306 $(SYMLINK) -f ko_KR-UTF-8%ko_KR-euc.so $(ICONV_DIR)/UTF-8%ko_KR.euc.so 307 $(SYMLINK) -f ko_KR-UTF-8%ko_KR-iso2022-7.so $(ICONV_DIR)/UTF-8%ko_KR.iso2022-7.so 308 $(SYMLINK) -f ko_KR-UTF-8%ko_KR-johap.so $(ICONV_DIR)/UTF-8%ko_KR.johap.so 309 $(SYMLINK) -f ko_KR-UTF-8%ko_KR-johap92.so $(ICONV_DIR)/UTF-8%ko_KR.johap92.so 310 $(SYMLINK) -f ko_KR-cp949%ko_KR-UTF-8.so $(ICONV_DIR)/UnifiedHangul%ko_KR-UTF-8.so 311 $(TOUCH) $@ 312FRC: 313