summaryrefslogtreecommitdiff
path: root/usr/src/lib/iconv_modules/utf-8/Makefile
blob: cc14caf0c0d0baf53b0b88479f72118098150a2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#

include $(SRC)/Makefile.master

SUBDIRS =       $(MACH)
$(BUILD64)SUBDIRS += $(MACH64)

CODESETS	= IBM-037 \
		  IBM-273 IBM-277 IBM-278 IBM-280 IBM-284 IBM-285 IBM-297 \
		  IBM-420 IBM-424 IBM-500 \
		  IBM-850 IBM-852 IBM-855 IBM-856 IBM-857 IBM-862 IBM-864 \
		  IBM-866 IBM-869 \
		  IBM-870 IBM-871 IBM-875 \
		  IBM-921 IBM-922 IBM-1025 IBM-1026 IBM-1112 \
		  IBM-1122 \
		  IBM-1140 IBM-1141 IBM-1142 IBM-1143 IBM-1144 IBM-1145 \
		  IBM-1146 IBM-1147 IBM-1148 IBM-1149

INPUTFILES1	= $(CODESETS:%=%+UTF-8.src)
INPUTFILES2	= $(CODESETS:%=UTF-8+%.src)
INPUTFILES	= $(INPUTFILES1) $(INPUTFILES2)
BINARYTABLES	= $(INPUTFILES:%.src=%.bt)
GENI_SRCS	= common/binarytables/srcs
ICONV_DIR	= $(ROOT)/usr/lib/iconv
BTS_DIR		= $(ICONV_DIR)/geniconvtbl/binarytables


all :=          TARGET = all
clean :=        TARGET = clean
clobber :=      TARGET = clobber
install :=      TARGET = install
echo :=         TARGET = echo

$(ICONV_DIR)/alias:=	FILEMODE=0444

.KEEP_STATE:

$(BTS_DIR):
	$(INS.dir)

%.bt: $(GENI_SRCS)/%.src
	$(GENICONVTBL) -o $@ -f $<

$(ICONV_DIR)/%: %
	$(INS.file)

all: $(BINARYTABLES)

# There is no way to escape the make(1S) interpretation of '%' as a wildcard,
# as such we can't install these files using traditional make rules, given
# they contain a % which, while it would match a literal '%' and work
# somewhat, would also match anything else.
#
# We have to, rather unfortunately, loop.
install: all $(BINARYTABLES) $(BTS_DIR) $(ICONV_DIR)/alias
	for f in  $(BINARYTABLES) ; do \
		fp=`echo $$f | $(TR) "+" "%"` ; \
		echo "installing $$f as $(BTS_DIR)/$$fp ..." ; \
		$(RM) $(BTS_DIR)/$$fp ; \
		$(CP) $$f $(BTS_DIR)/$$fp ; \
		$(CHMOD) 0444 $(BTS_DIR)/$$fp; \
	done

clean:
	$(RM) $(BINARYTABLES)

all clean clobber install echo: $(SUBDIRS)

.PARALLEL: $(SUBDIRS)

$(SUBDIRS): FRC
	@cd $@; pwd; $(MAKE) $(TARGET)

FRC: