jdk/make/sun/nio/cs/Makefile
changeset 4665 d14dc3d9e1fa
child 5167 dbd299f8fdae
equal deleted inserted replaced
4664:0b0443cbc448 4665:d14dc3d9e1fa
       
     1 #
       
     2 # Copyright 1996-2008 Sun Microsystems, Inc.  All Rights Reserved.
       
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     4 #
       
     5 # This code is free software; you can redistribute it and/or modify it
       
     6 # under the terms of the GNU General Public License version 2 only, as
       
     7 # published by the Free Software Foundation.  Sun designates this
       
     8 # particular file as subject to the "Classpath" exception as provided
       
     9 # by Sun in the LICENSE file that accompanied this code.
       
    10 #
       
    11 # This code is distributed in the hope that it will be useful, but WITHOUT
       
    12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    14 # version 2 for more details (a copy is included in the LICENSE file that
       
    15 # accompanied this code).
       
    16 #
       
    17 # You should have received a copy of the GNU General Public License version
       
    18 # 2 along with this work; if not, write to the Free Software Foundation,
       
    19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    20 #
       
    21 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
       
    22 # CA 95054 USA or visit www.sun.com if you need additional information or
       
    23 # have any questions.
       
    24 #
       
    25 
       
    26 #
       
    27 # Makefile for character converters.
       
    28 #
       
    29 
       
    30 BUILDDIR = ../../..
       
    31 
       
    32 # charsets should be separated from nio module 
       
    33 MODULE  = charsets
       
    34 PACKAGE = sun.nio
       
    35 PRODUCT = sun
       
    36 
       
    37 # This re-directs all the class files to a separate location
       
    38 CLASSDESTDIR = $(TEMPDIR)/classes
       
    39 
       
    40 OTHER_JAVACFLAGS += -Xlint:serial -Werror
       
    41 include $(BUILDDIR)/common/Defs.gmk
       
    42 
       
    43 #
       
    44 # Files
       
    45 #
       
    46 include FILES_java.gmk
       
    47 AUTO_FILES_JAVA_DIRS = sun/nio/cs/ext
       
    48 
       
    49 # For Cygwin, command line arguments that are paths must be converted to
       
    50 # windows style paths. These paths cannot be used as targets, however, because 
       
    51 # the ":" in them  will interfere with GNU Make rules, generating "multiple
       
    52 # target pattern" errors.
       
    53 
       
    54 # this define is for the rule:
       
    55 CHARSETS_JAR = $(LIBDIR)/charsets.jar
       
    56 
       
    57 # extcs
       
    58 FILES_genout_extcs = $(FILES_gen_extcs:%.java=$(GENSRCDIR)/%.java)
       
    59 
       
    60 #
       
    61 # Rules
       
    62 #
       
    63 include $(BUILDDIR)/common/Classes.gmk
       
    64 
       
    65 build: $(FILES_genout_extcs) $(CHARSETS_JAR)
       
    66 
       
    67 #
       
    68 # Extra rules to build character converters.
       
    69 
       
    70 SERVICE_DESCRIPTION = java.nio.charset.spi.CharsetProvider
       
    71 SERVICE_DESCRIPTION_PATH = META-INF/services/$(SERVICE_DESCRIPTION)
       
    72 
       
    73 GENCSDATASRC = $(BUILDDIR)/tools/CharsetMapping
       
    74 GENCSSRCDIR = $(BUILDDIR)/tools/src/build/tools/charsetmapping
       
    75 GENCSEXT = $(GENSRCDIR)/sun/nio/cs/ext
       
    76 
       
    77 FILES_MAP = $(GENCSDATASRC)/sjis0213.map
       
    78 FILES_DAT = $(CLASSDESTDIR)/sun/nio/cs/ext/sjis0213.dat
       
    79 CHARSETMAPPING_JARFILE = $(BUILDTOOLJARDIR)/charsetmapping.jar
       
    80 
       
    81 $(FILES_DAT): $(FILES_MAP)
       
    82 	@$(prep-target)
       
    83 	$(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) \
       
    84 		$(FILES_MAP) $(FILES_DAT) sjis0213
       
    85 
       
    86 
       
    87 $(FILES_genout_extcs): \
       
    88                 $(GENCSDATASRC)/SingleByte-X.java.template  \
       
    89 		$(GENCSDATASRC)/DoubleByte-X.java.template \
       
    90 		$(GENCSDATASRC)/extsbcs $(GENCSDATASRC)/dbcs
       
    91 	@$(prep-target)
       
    92 	$(RM) -r $(GENCSEXT)
       
    93 	$(MKDIR) -p $(GENCSEXT)
       
    94 	$(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE)	$(GENCSDATASRC) $(GENCSEXT) extsbcs
       
    95 	$(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) euctw \
       
    96 		$(GENCSSRCDIR)/GenerateEUC_TW.java
       
    97 	$(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) dbcs
       
    98 
       
    99 $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH): \
       
   100   $(SHARE_SRC)/classes/sun/nio/cs/ext/$(SERVICE_DESCRIPTION_PATH)
       
   101 	$(install-file)
       
   102 
       
   103 $(CHARSETS_JAR): $(FILES_class) $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH) $(FILES_DAT)
       
   104 	$(BOOT_JAR_CMD) cf0 $(CHARSETS_JAR) \
       
   105 	      -C $(CLASSDESTDIR) sun \
       
   106 	      -C $(CLASSDESTDIR) $(SERVICE_DESCRIPTION_PATH)  \
       
   107 	      $(BOOT_JAR_JFLAGS)
       
   108 	@$(java-vm-cleanup)
       
   109 
       
   110 clean::
       
   111 	$(RM) -r $(CLASSDESTDIR)
       
   112 	$(RM) $(CHARSETS_JAR)