1 #
   2 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. 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.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 # Copy icu and _dict files used by the text break iterator
  27 
  28 COPY_PATTERNS = .icu _dict
  29 
  30 # Copy config files for com.sun.org.apache.xml.internal.security
  31 
  32 XMLSECURITY_RESOURCEDIR = $(JDK_TOPDIR)/src/share/classes/com/sun/org/apache/xml/internal/security/resource
  33 COPY_FILES += \
  34     $(XMLSECURITY_RESOURCEDIR)/config.dtd \
  35     $(XMLSECURITY_RESOURCEDIR)/config.xml
  36 
  37 # Copy sun/tools related files into the classes directory.
  38 
  39 # Extra jstat files
  40 JSTAT_RESOURCEDIR = $(JDK_TOPDIR)/src/share/classes/sun/tools/jstat/resources
  41 COPY_FILES += \
  42     $(JSTAT_RESOURCEDIR)/jstat_options \
  43     $(JSTAT_RESOURCEDIR)/jstat_unsupported_options
  44 
  45 # Extra jhat files
  46 JHAT_RESOURCEDIR = $(JDK_TOPDIR)/src/share/classes/com/sun/tools/hat/resources
  47 COPY_FILES += \
  48     $(JHAT_RESOURCEDIR)/hat.js \
  49     $(JHAT_RESOURCEDIR)/oqlhelp.html \
  50     $(JHAT_RESOURCEDIR)/platform_names.txt
  51 
  52 # Extra jrunscript files
  53 JRUNSCRIPT_RESOURCEDIR = $(JDK_TOPDIR)/src/share/classes/com/sun/tools/script/shell
  54 COPY_FILES += \
  55     $(JRUNSCRIPT_RESOURCEDIR)/init.js \
  56     $(JRUNSCRIPT_RESOURCEDIR)/messages.properties
  57 
  58 # Extra jvmstat files
  59 COPY_FILES += \
  60     $(JDK_TOPDIR)/src/share/classes/sun/jvmstat/perfdata/resources/aliasmap
  61 
  62 # JConsole resources
  63 JCONSOLE_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/resources
  64 COPY_FILES += \
  65     $(wildcard $(JCONSOLE_RESOURCES_DIR)/*.png) \
  66     $(wildcard $(JCONSOLE_RESOURCES_DIR)/*.gif)
  67 
  68 # Print resources
  69 PRINT_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/sun/print/resources
  70 COPY_FILES += \
  71     $(wildcard $(PRINT_RESOURCES_DIR)/*.png)
  72 
  73 # IDN resources
  74 COPY_FILES += \
  75     $(JDK_TOPDIR)/src/share/classes/sun/net/idn/uidna.spp
  76 
  77 #
  78 # Swing plaf resources
  79 #
  80 SWING_PLAF_WINDOWS_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/windows
  81 COPY_FILES += \
  82     $(wildcard $(SWING_PLAF_WINDOWS_RESOURCES_DIR)/icons/*.gif) \
  83     $(wildcard $(SWING_PLAF_WINDOWS_RESOURCES_DIR)/icons/*.png)
  84 
  85 ifndef OPENJDK
  86   SWING_PLAF_WINDOWS_RESOURCES_DIR_CLOSED = $(JDK_TOPDIR)/src/closed/share/classes/com/sun/java/swing/plaf/windows
  87   # Filter out JavaCup32.png from OpenJDK
  88   COPY_FILES := $(filter-out $(SWING_PLAF_WINDOWS_RESOURCES_DIR)/icons/JavaCup32.png, $(COPY_FILES))
  89   # Alter JavaCup32.png from ClosedJDK
  90   COPY_FILES += \
  91       $(SWING_PLAF_WINDOWS_RESOURCES_DIR_CLOSED)/icons/JavaCup32.png
  92 endif
  93 
  94 SWING_PLAF_BASIC_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/basic
  95 COPY_FILES += \
  96     $(wildcard $(SWING_PLAF_BASIC_RESOURCES_DIR)/icons/*.png)
  97 
  98 ifndef OPENJDK
  99   SWING_PLAF_BASIC_RESOURCES_DIR_CLOSED = $(JDK_TOPDIR)/src/closed/share/classes/javax/swing/plaf/basic
 100   # Filter out JavaCup16.png from OpenJDK
 101   COPY_FILES := $(filter-out $(SWING_PLAF_BASIC_RESOURCES_DIR)/icons/JavaCup16.png, $(COPY_FILES))
 102   # Alter JavaCup16.png from ClosedJDK
 103   COPY_FILES += \
 104       $(SWING_PLAF_BASIC_RESOURCES_DIR_CLOSED)/icons/JavaCup16.png
 105 endif
 106 
 107 ifdef OPENJDK
 108   SWING_PLAF_MOTIF_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/motif
 109   COPY_FILES += \
 110       $(wildcard $(SWING_PLAF_MOTIF_RESOURCES_DIR)/icons/*.gif) \
 111       $(wildcard $(SWING_PLAF_MOTIF_RESOURCES_DIR)/icons/*.png)
 112 else
 113   SWING_PLAF_MOTIF_RESOURCES_DIR_CLOSED = $(JDK_TOPDIR)/src/closed/share/classes/com/sun/java/swing/plaf/motif
 114   COPY_FILES += \
 115       $(wildcard $(SWING_PLAF_MOTIF_RESOURCES_DIR_CLOSED)/icons/*.gif) \
 116       $(wildcard $(SWING_PLAF_MOTIF_RESOURCES_DIR_CLOSED)/icons/*.png)
 117 endif
 118 
 119 SWING_PLAF_METAL_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/metal
 120 COPY_FILES += \
 121     $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/icons/*.gif) \
 122     $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/icons/*.png) \
 123     $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/icons/ocean/*.gif) \
 124     $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/icons/ocean/*.png) \
 125     $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/sounds/*.wav)
 126 
 127 ifneq ($(OPENJDK_TARGET_OS), windows)
 128   # Only copy GTK resources on Solaris/Linux
 129   SWING_PLAF_GTK_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/gtk
 130   COPY_FILES += \
 131       $(wildcard $(SWING_PLAF_GTK_RESOURCES_DIR)/icons/*.gif) \
 132       $(wildcard $(SWING_PLAF_GTK_RESOURCES_DIR)/icons/*.png) \
 133       $(wildcard $(SWING_PLAF_GTK_RESOURCES_DIR)/resources/metacity/SwingFallbackTheme/metacity-1/*.xml)
 134 endif
 135 # END: Swing plaf resources
 136 
 137 SWING_BEANINFO_RESOURCES_SRC_DIR = $(JDK_TOPDIR)/make/data/swingbeaninfo/images
 138 SWING_BEANINFO_RESOURCES_SRC = $(wildcard $(SWING_BEANINFO_RESOURCES_SRC_DIR)/*.gif)
 139 OUT_BEANINFO_RESOURCES = $(patsubst $(SWING_BEANINFO_RESOURCES_SRC_DIR)%, \
 140     $(JDK_OUTPUTDIR)/classes/javax/swing/beaninfo/images/%, \
 141     $(SWING_BEANINFO_RESOURCES_SRC))
 142 
 143 COPY_EXTRA += $(OUT_BEANINFO_RESOURCES)
 144 # END: Swing beaninfo resources
 145 
 146 # Swing text resources
 147 SWING_TEXT_RESOURCEDIR = $(JDK_TOPDIR)/src/share/classes/javax/swing/text
 148 COPY_FILES += \
 149     $(SWING_TEXT_RESOURCEDIR)/html/default.css \
 150     $(wildcard $(SWING_TEXT_RESOURCEDIR)/rtf/charsets/*.txt)
 151 
 152 ##########################################################################################
 153 #
 154 # Copy the META-INF/services configuration files that are scattered around the source tree
 155 # into classes/META-INF/services. Be aware that META-INF directories that are located at a
 156 # source root (.../classes/META-INF) are automatically copied verbatim by the
 157 # SetupJavaCompilation macro.
 158 #
 159 # Any other META-INF/services configuration file is found here and platform specific comments
 160 # are uncommented and the configuration file is stored in the output META-INF directory.
 161 
 162 # Make sure the output directory is created.
 163 $(eval $(call MakeDir, $(JDK_OUTPUTDIR)/classes/META-INF/services))
 164 # Find all META-INF/services/* files
 165 ALL_META-INF_DIRS_share := $(shell $(FIND) $(JDK_TOPDIR)/src/share/classes -type d -a -name META-INF)
 166 ALL_META-INF_DIRS_targetapi := $(shell $(FIND) $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes -type d -a -name META-INF)
 167 # Platform specific overrides shared
 168 ifneq ($(ALL_META-INF_DIRS_targetapi), )
 169   ALL_META-INF_DIRS := $(ALL_META-INF_DIRS_targetapi) \
 170       $(filter-out %$(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes%,%,$(ALL_META-INF_DIRS_targetapi)), \
 171       $(ALL_META-INF_DIRS_share))
 172 else
 173   ALL_META-INF_DIRS := $(ALL_META-INF_DIRS_share)
 174 endif
 175 
 176 SRC_SERVICES_FILES := $(wildcard $(addsuffix /services/*, $(ALL_META-INF_DIRS)))
 177 
 178 ifdef OPENJDK
 179   SRC_SERVICES_FILES := $(filter-out %sun/dc/META-INF/services/sun.java2d.pipe.RenderingEngine, $(SRC_SERVICES_FILES))
 180 else
 181   SRC_SERVICES_FILES := $(filter-out %sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine, $(SRC_SERVICES_FILES))
 182 endif
 183 
 184 # The number of services files are relatively few. If the increase in numbers, then
 185 # we have to use ListPathsSafelyNow here.
 186 # Change $(JDK_TOPDIR)/src/.../META-INF/services/yyyy into $(JDK_OUTPUTDIR)/classes/META-INF/services/yyyy
 187 # The \n in the printf command is needed to make sed work on Solaris.
 188 OUT_SERVICES_FILES := $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/, \
 189     $(shell $(PRINTF) "$(SRC_SERVICES_FILES)\n" | $(SED) -e 's|/[^ ]*/META-INF/services/||g'))
 190 OUT_SERVICES_FILES_COLON := $(addsuffix :, $(OUT_SERVICES_FILES))
 191 # Exception handling for print services with no META-INF directory
 192 SRC_SERVICES_FILES_PRINT = $(wildcard $(JDK_TOPDIR)/src/share/classes/sun/print/services/*)
 193 OUT_SERVICES_FILES_PRINT = $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/, \
 194     $(patsubst $(JDK_TOPDIR)/src/share/classes/sun/print/services/%, %, \
 195     $(SRC_SERVICES_FILES_PRINT)))
 196 OUT_SERVICES_FILES_PRINT_COLON = $(addsuffix :, $(OUT_SERVICES_FILES_PRINT))
 197 RULES_SERVICES_PRINT = $(join $(OUT_SERVICES_FILES_PRINT_COLON), $(SRC_SERVICES_FILES_PRINT))
 198 
 199 # Now setup the dependency rules to generate a META-INF/services/... from the correct source.
 200 META-INF_RULES_SERVICES := $(RULES_SERVICES_PRINT) $(join $(OUT_SERVICES_FILES_COLON), $(SRC_SERVICES_FILES))
 201 # Eval the newly created rules to incorporate them into the make tree.
 202 define addto_meta-inf_services
 203   $1
 204         echo $(LOG_INFO) Installing META-INF/services/$$(@F)
 205         $(CAT) $$< | $(SED) -e "s/^#\[$(OPENJDK_TARGET_OS)\]//" > $$@
 206 endef
 207 $(foreach i, $(META-INF_RULES_SERVICES), $(eval $(call addto_meta-inf_services, $i)))
 208 # Here is the generic rule, whose receipt the above rules will trigger.
 209 
 210 COPY_EXTRA += $(OUT_SERVICES_FILES)
 211 COPY_EXTRA += $(OUT_SERVICES_FILES_PRINT)
 212 
 213 ###
 214 
 215 $(JDK_OUTPUTDIR)/classes/sun/nio/cs/ext/sjis0213.dat: $(JDK_OUTPUTDIR)/gensrc/sun/nio/cs/ext/sjis0213.dat
 216         $(call install-file)
 217 
 218 COPY_EXTRA += $(JDK_OUTPUTDIR)/classes/sun/nio/cs/ext/sjis0213.dat
 219 
 220 ###
 221 
 222 JAVAX_SOUND_SRC := $(JDK_TOPDIR)/src/share/classes/com/sun/media/sound/services
 223 
 224 JAVAX_SOUND_SRC_FILES := \
 225     javax.sound.midi.spi.MidiDeviceProvider \
 226     javax.sound.midi.spi.MidiFileReader \
 227     javax.sound.midi.spi.MidiFileWriter \
 228     javax.sound.midi.spi.SoundbankReader \
 229     javax.sound.sampled.spi.AudioFileReader \
 230     javax.sound.sampled.spi.AudioFileWriter \
 231     javax.sound.sampled.spi.FormatConversionProvider \
 232     javax.sound.sampled.spi.MixerProvider
 233 
 234 COPY_EXTRA += $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/, $(JAVAX_SOUND_SRC_FILES))
 235 
 236 JAVAX_SOUND_RULES := $(foreach F, $(JAVAX_SOUND_SRC_FILES), $(JDK_OUTPUTDIR)/classes/META-INF/services/$(notdir $F):$(JAVAX_SOUND_SRC)/$F)
 237 
 238 $(foreach R, $(JAVAX_SOUND_RULES), $(eval $(call addto_meta-inf_services, $R)))