xref: /illumos-gate/usr/src/lib/iconv_modules/utf-8/Makefile (revision 5328fc53d11d7151861fa272e4fb0248b8f0e145)
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
26include $(SRC)/Makefile.master
27
28SUBDIRS =       $(MACH)
29$(BUILD64)SUBDIRS += $(MACH64)
30
31CODESETS	= IBM-037 \
32		  IBM-273 IBM-277 IBM-278 IBM-280 IBM-284 IBM-285 IBM-297 \
33		  IBM-420 IBM-424 IBM-500 \
34		  IBM-850 IBM-852 IBM-855 IBM-856 IBM-857 IBM-862 IBM-864 \
35		  IBM-866 IBM-869 \
36		  IBM-870 IBM-871 IBM-875 \
37		  IBM-921 IBM-922 IBM-1025 IBM-1026 IBM-1112 \
38		  IBM-1122 \
39		  IBM-1140 IBM-1141 IBM-1142 IBM-1143 IBM-1144 IBM-1145 \
40		  IBM-1146 IBM-1147 IBM-1148 IBM-1149
41
42INPUTFILES1	= $(CODESETS:%=%+UTF-8.src)
43INPUTFILES2	= $(CODESETS:%=UTF-8+%.src)
44INPUTFILES	= $(INPUTFILES1) $(INPUTFILES2)
45BINARYTABLES	= $(INPUTFILES:%.src=%.bt)
46GENICONVTBL	= /usr/bin/geniconvtbl
47GENI_SRCS	= common/binarytables/srcs
48ICONV_DIR	= $(ROOT)/usr/lib/iconv
49BTS_DIR		= $(ICONV_DIR)/geniconvtbl/binarytables
50
51
52all :=          TARGET = all
53clean :=        TARGET = clean
54clobber :=      TARGET = clobber
55install :=      TARGET = install
56lint :=         TARGET = lint
57echo :=         TARGET = echo
58
59$(ICONV_DIR)/alias:=	FILEMODE=0444
60
61.KEEP_STATE:
62
63$(BTS_DIR):
64	$(INS.dir)
65
66%.bt: $(GENI_SRCS)/%.src
67	$(GENICONVTBL) -o $@ -f $<
68
69$(ICONV_DIR)/%: %
70	$(INS.file)
71
72all: $(BINARYTABLES)
73
74# There is no way to escape the make(1S) interpretation of '%' as a wildcard,
75# as such we can't install these files using traditional make rules, given
76# they contain a % which, while it would match a literal '%' and work
77# somewhat, would also match anything else.
78#
79# We have to, rather unfortunately, loop.
80install: all $(BINARYTABLES) $(BTS_DIR) $(ICONV_DIR)/alias
81	for f in  $(BINARYTABLES) ; do \
82		fp=`echo $$f | $(TR) "+" "%"` ; \
83		echo "installing $$f as $(BTS_DIR)/$$fp ..." ; \
84		$(RM) $(BTS_DIR)/$$fp ; \
85		$(CP) $$f $(BTS_DIR)/$$fp ; \
86		$(CHMOD) 0444 $(BTS_DIR)/$$fp; \
87	done
88
89clean:
90	$(RM) $(BINARYTABLES)
91
92all clean clobber install lint echo: $(SUBDIRS)
93
94.PARALLEL: $(SUBDIRS)
95
96$(SUBDIRS): FRC
97	@cd $@; pwd; $(MAKE) $(TARGET)
98
99FRC:
100