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 PACKAGE = sun.nio
  33 PRODUCT = sun
  34 
  35 # This re-directs all the class files to a separate location
  36 CLASSDESTDIR = $(TEMPDIR)/classes
  37 
  38 OTHER_JAVACFLAGS += -Xlint:serial -Werror
  39 include $(BUILDDIR)/common/Defs.gmk
  40 
  41 #
  42 # Files
  43 #
  44 include FILES_java.gmk
  45 AUTO_FILES_JAVA_DIRS = sun/nio/cs/ext
  46 
  47 # For Cygwin, command line arguments that are paths must be converted to
  48 # windows style paths. These paths cannot be used as targets, however, because 
  49 # the ":" in them  will interfere with GNU Make rules, generating "multiple
  50 # target pattern" errors.
  51 
  52 # this define is for the rule:
  53 CHARSETS_JAR = $(LIBDIR)/charsets.jar
  54 
  55 # extcs
  56 FILES_genout_extcs = $(FILES_gen_extcs:%.java=$(GENSRCDIR)/%.java)
  57 
  58 #
  59 # Rules
  60 #
  61 include $(BUILDDIR)/common/Classes.gmk
  62 
  63 build: $(FILES_genout_extcs) $(CHARSETS_JAR)
  64 
  65 #
  66 # Extra rules to build character converters.
  67 
  68 SERVICE_DESCRIPTION = java.nio.charset.spi.CharsetProvider
  69 SERVICE_DESCRIPTION_PATH = META-INF/services/$(SERVICE_DESCRIPTION)
  70 
  71 GENCSDATASRC = $(BUILDDIR)/tools/CharsetMapping
  72 GENCSSRCDIR = $(BUILDDIR)/tools/src/build/tools/charsetmapping
  73 GENCSEXT = $(GENSRCDIR)/sun/nio/cs/ext
  74 
  75 FILES_MAP = $(GENCSDATASRC)/sjis0213.map
  76 FILES_DAT = $(CLASSDESTDIR)/sun/nio/cs/ext/sjis0213.dat
  77 CHARSETMAPPING_JARFILE = $(BUILDTOOLJARDIR)/charsetmapping.jar
  78 
  79 $(FILES_DAT): $(FILES_MAP)
  80         @$(prep-target)
  81         $(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) \
  82                 $(FILES_MAP) $(FILES_DAT) sjis0213
  83 
  84 
  85 $(FILES_genout_extcs): \
  86                 $(GENCSDATASRC)/SingleByte-X.java.template  \
  87                 $(GENCSDATASRC)/DoubleByte-X.java.template \
  88                 $(GENCSDATASRC)/extsbcs $(GENCSDATASRC)/dbcs
  89         @$(prep-target)
  90         $(RM) -r $(GENCSEXT)
  91         $(MKDIR) -p $(GENCSEXT)
  92         $(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) extsbcs
  93         $(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) euctw \
  94                 $(GENCSSRCDIR)/GenerateEUC_TW.java
  95         $(BOOT_JAVA_CMD) -jar $(CHARSETMAPPING_JARFILE) $(GENCSDATASRC) $(GENCSEXT) dbcs
  96 
  97 $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH): \
  98   $(SHARE_SRC)/classes/sun/nio/cs/ext/$(SERVICE_DESCRIPTION_PATH)
  99         $(install-file)
 100 
 101 $(CHARSETS_JAR): $(FILES_class) $(CLASSDESTDIR)/$(SERVICE_DESCRIPTION_PATH) $(FILES_DAT)
 102         $(BOOT_JAR_CMD) cf0 $(CHARSETS_JAR) \
 103               -C $(CLASSDESTDIR) sun \
 104               -C $(CLASSDESTDIR) $(SERVICE_DESCRIPTION_PATH)  \
 105               $(BOOT_JAR_JFLAGS)
 106         @$(java-vm-cleanup)
 107 
 108 clean::
 109         $(RM) -r $(CLASSDESTDIR)
 110         $(RM) $(CHARSETS_JAR)