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