xref: /illumos-gate/usr/src/lib/iconv_modules/utf-8/Makefile (revision 6a817834d81cc75ce12d0d393320837b1fec1e85)
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
56echo :=         TARGET = echo
57
58$(ICONV_DIR)/alias:=	FILEMODE=0444
59
60.KEEP_STATE:
61
62$(BTS_DIR):
63	$(INS.dir)
64
65%.bt: $(GENI_SRCS)/%.src
66	$(GENICONVTBL) -o $@ -f $<
67
68$(ICONV_DIR)/%: %
69	$(INS.file)
70
71all: $(BINARYTABLES)
72
73# There is no way to escape the make(1S) interpretation of '%' as a wildcard,
74# as such we can't install these files using traditional make rules, given
75# they contain a % which, while it would match a literal '%' and work
76# somewhat, would also match anything else.
77#
78# We have to, rather unfortunately, loop.
79install: all $(BINARYTABLES) $(BTS_DIR) $(ICONV_DIR)/alias
80	for f in  $(BINARYTABLES) ; do \
81		fp=`echo $$f | $(TR) "+" "%"` ; \
82		echo "installing $$f as $(BTS_DIR)/$$fp ..." ; \
83		$(RM) $(BTS_DIR)/$$fp ; \
84		$(CP) $$f $(BTS_DIR)/$$fp ; \
85		$(CHMOD) 0444 $(BTS_DIR)/$$fp; \
86	done
87
88clean:
89	$(RM) $(BINARYTABLES)
90
91all clean clobber install echo: $(SUBDIRS)
92
93.PARALLEL: $(SUBDIRS)
94
95$(SUBDIRS): FRC
96	@cd $@; pwd; $(MAKE) $(TARGET)
97
98FRC:
99