116d86563SAlexander Pyhalov#
216d86563SAlexander Pyhalov# CDDL HEADER START
316d86563SAlexander Pyhalov#
416d86563SAlexander Pyhalov# The contents of this file are subject to the terms of the
516d86563SAlexander Pyhalov# Common Development and Distribution License (the "License").
616d86563SAlexander Pyhalov# You may not use this file except in compliance with the License.
716d86563SAlexander Pyhalov#
816d86563SAlexander Pyhalov# You can obtain a copy of the license at src/OPENSOLARIS.LICENSE
916d86563SAlexander Pyhalov# or http://www.opensolaris.org/os/licensing.
1016d86563SAlexander Pyhalov# See the License for the specific language governing permissions
1116d86563SAlexander Pyhalov# and limitations under the License.
1216d86563SAlexander Pyhalov#
1316d86563SAlexander Pyhalov# When distributing Covered Code, include this CDDL HEADER in each
1416d86563SAlexander Pyhalov# file and include the License file at src/OPENSOLARIS.LICENSE.
1516d86563SAlexander Pyhalov# If applicable, add the following below this CDDL HEADER, with the
1616d86563SAlexander Pyhalov# fields enclosed by brackets "[]" replaced with your own identifying
1716d86563SAlexander Pyhalov# information: Portions Copyright [yyyy] [name of copyright owner]
1816d86563SAlexander Pyhalov#
1916d86563SAlexander Pyhalov# CDDL HEADER END
2016d86563SAlexander Pyhalov#
2116d86563SAlexander Pyhalov#
2216d86563SAlexander Pyhalov# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
2316d86563SAlexander Pyhalov# Use is subject to license terms.
2416d86563SAlexander Pyhalov#
2516d86563SAlexander Pyhalov
2616d86563SAlexander Pyhalovinclude $(SRC)/Makefile.master
2716d86563SAlexander Pyhalov
2816d86563SAlexander PyhalovSUBDIRS =       $(MACH)
2916d86563SAlexander Pyhalov$(BUILD64)SUBDIRS += $(MACH64)
3016d86563SAlexander Pyhalov
31dfe6d73fSRichard LoweCODESETS	= IBM-037 \
32dfe6d73fSRichard Lowe		  IBM-273 IBM-277 IBM-278 IBM-280 IBM-284 IBM-285 IBM-297 \
33dfe6d73fSRichard Lowe		  IBM-420 IBM-424 IBM-500 \
34dfe6d73fSRichard Lowe		  IBM-850 IBM-852 IBM-855 IBM-856 IBM-857 IBM-862 IBM-864 \
35dfe6d73fSRichard Lowe		  IBM-866 IBM-869 \
36dfe6d73fSRichard Lowe		  IBM-870 IBM-871 IBM-875 \
37dfe6d73fSRichard Lowe		  IBM-921 IBM-922 IBM-1025 IBM-1026 IBM-1112 \
38dfe6d73fSRichard Lowe		  IBM-1122 \
39dfe6d73fSRichard Lowe		  IBM-1140 IBM-1141 IBM-1142 IBM-1143 IBM-1144 IBM-1145 \
40dfe6d73fSRichard Lowe		  IBM-1146 IBM-1147 IBM-1148 IBM-1149
41dfe6d73fSRichard Lowe
42dfe6d73fSRichard LoweINPUTFILES1	= $(CODESETS:%=%+UTF-8.src)
43dfe6d73fSRichard LoweINPUTFILES2	= $(CODESETS:%=UTF-8+%.src)
45dfe6d73fSRichard LoweBINARYTABLES	= $(INPUTFILES:%.src=%.bt)
46dfe6d73fSRichard LoweGENI_SRCS	= common/binarytables/srcs
47dfe6d73fSRichard LoweICONV_DIR	= $(ROOT)/usr/lib/iconv
48dfe6d73fSRichard LoweBTS_DIR		= $(ICONV_DIR)/geniconvtbl/binarytables
49dfe6d73fSRichard Lowe
50dfe6d73fSRichard Lowe
5116d86563SAlexander Pyhalovall :=          TARGET = all
5216d86563SAlexander Pyhalovclean :=        TARGET = clean
5316d86563SAlexander Pyhalovclobber :=      TARGET = clobber
5416d86563SAlexander Pyhalovinstall :=      TARGET = install
5516d86563SAlexander Pyhalovecho :=         TARGET = echo
5616d86563SAlexander Pyhalov
57dfe6d73fSRichard Lowe$(ICONV_DIR)/alias:=	FILEMODE=0444
58dfe6d73fSRichard Lowe
5916d86563SAlexander Pyhalov.KEEP_STATE:
6016d86563SAlexander Pyhalov
61dfe6d73fSRichard Lowe$(BTS_DIR):
62dfe6d73fSRichard Lowe	$(INS.dir)
63dfe6d73fSRichard Lowe
64dfe6d73fSRichard Lowe%.bt: $(GENI_SRCS)/%.src
65dfe6d73fSRichard Lowe	$(GENICONVTBL) -o $@ -f $<
66dfe6d73fSRichard Lowe
67dfe6d73fSRichard Lowe$(ICONV_DIR)/%: %
68dfe6d73fSRichard Lowe	$(INS.file)
69dfe6d73fSRichard Lowe
70dfe6d73fSRichard Loweall: $(BINARYTABLES)
71dfe6d73fSRichard Lowe
72dfe6d73fSRichard Lowe# There is no way to escape the make(1S) interpretation of '%' as a wildcard,
73dfe6d73fSRichard Lowe# as such we can't install these files using traditional make rules, given
74dfe6d73fSRichard Lowe# they contain a % which, while it would match a literal '%' and work
75dfe6d73fSRichard Lowe# somewhat, would also match anything else.
76dfe6d73fSRichard Lowe#
77dfe6d73fSRichard Lowe# We have to, rather unfortunately, loop.
78dfe6d73fSRichard Loweinstall: all $(BINARYTABLES) $(BTS_DIR) $(ICONV_DIR)/alias
79dfe6d73fSRichard Lowe	for f in  $(BINARYTABLES) ; do \
80dfe6d73fSRichard Lowe		fp=`echo $$f | $(TR) "+" "%"` ; \
81dfe6d73fSRichard Lowe		echo "installing $$f as $(BTS_DIR)/$$fp ..." ; \
82dfe6d73fSRichard Lowe		$(RM) $(BTS_DIR)/$$fp ; \
83dfe6d73fSRichard Lowe		$(CP) $$f $(BTS_DIR)/$$fp ; \
84dfe6d73fSRichard Lowe		$(CHMOD) 0444 $(BTS_DIR)/$$fp; \
85dfe6d73fSRichard Lowe	done
86dfe6d73fSRichard Lowe
87dfe6d73fSRichard Loweclean:
88dfe6d73fSRichard Lowe	$(RM) $(BINARYTABLES)
89dfe6d73fSRichard Lowe
90*241c90a0SRichard Loweall clean clobber install echo: $(SUBDIRS)
9116d86563SAlexander Pyhalov
92dfe6d73fSRichard Lowe.PARALLEL: $(SUBDIRS)
93dfe6d73fSRichard Lowe
9416d86563SAlexander Pyhalov$(SUBDIRS): FRC
9516d86563SAlexander Pyhalov	@cd $@; pwd; $(MAKE) $(TARGET)
9616d86563SAlexander Pyhalov
9716d86563SAlexander PyhalovFRC: