CopyIntoClasses.gmk 10.6 KB
Newer Older
1
#
2
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
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
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.  Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

# Copy icu and _dict files used by the text break iterator

COPY_PATTERNS = .icu _dict

# Copy config files for com.sun.org.apache.xml.internal.security

XMLSECURITY_RESOURCEDIR = $(JDK_TOPDIR)/src/share/classes/com/sun/org/apache/xml/internal/security/resource
COPY_FILES += \
34 35
    $(XMLSECURITY_RESOURCEDIR)/config.dtd \
    $(XMLSECURITY_RESOURCEDIR)/config.xml
36 37 38 39 40 41

# Copy sun/tools related files into the classes directory.

# Extra jstat files
JSTAT_RESOURCEDIR = $(JDK_TOPDIR)/src/share/classes/sun/tools/jstat/resources
COPY_FILES += \
42 43
    $(JSTAT_RESOURCEDIR)/jstat_options \
    $(JSTAT_RESOURCEDIR)/jstat_unsupported_options
44

S
sla 已提交
45
# Extra jhat files
46 47
JHAT_RESOURCEDIR = $(JDK_TOPDIR)/src/share/classes/com/sun/tools/hat/resources
COPY_FILES += \
48 49 50
    $(JHAT_RESOURCEDIR)/hat.js \
    $(JHAT_RESOURCEDIR)/oqlhelp.html \
    $(JHAT_RESOURCEDIR)/platform_names.txt
51 52 53 54

# Extra jrunscript files
JRUNSCRIPT_RESOURCEDIR = $(JDK_TOPDIR)/src/share/classes/com/sun/tools/script/shell
COPY_FILES += \
55 56
    $(JRUNSCRIPT_RESOURCEDIR)/init.js \
    $(JRUNSCRIPT_RESOURCEDIR)/messages.properties
57 58 59

# Extra jvmstat files
COPY_FILES += \
60
    $(JDK_TOPDIR)/src/share/classes/sun/jvmstat/perfdata/resources/aliasmap
61 62 63 64

# JConsole resources
JCONSOLE_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/resources
COPY_FILES += \
65 66
    $(wildcard $(JCONSOLE_RESOURCES_DIR)/*.png) \
    $(wildcard $(JCONSOLE_RESOURCES_DIR)/*.gif)
67 68 69 70

# Print resources
PRINT_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/sun/print/resources
COPY_FILES += \
71
    $(wildcard $(PRINT_RESOURCES_DIR)/*.png)
72 73 74

# IDN resources
COPY_FILES += \
75
    $(JDK_TOPDIR)/src/share/classes/sun/net/idn/uidna.spp
76

77 78 79 80 81
#
# Swing plaf resources
#
SWING_PLAF_WINDOWS_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/windows
COPY_FILES += \
82 83
    $(wildcard $(SWING_PLAF_WINDOWS_RESOURCES_DIR)/icons/*.gif) \
    $(wildcard $(SWING_PLAF_WINDOWS_RESOURCES_DIR)/icons/*.png)
84 85 86 87 88 89 90

ifndef OPENJDK
  SWING_PLAF_WINDOWS_RESOURCES_DIR_CLOSED = $(JDK_TOPDIR)/src/closed/share/classes/com/sun/java/swing/plaf/windows
  # Filter out JavaCup32.png from OpenJDK
  COPY_FILES := $(filter-out $(SWING_PLAF_WINDOWS_RESOURCES_DIR)/icons/JavaCup32.png, $(COPY_FILES))
  # Alter JavaCup32.png from ClosedJDK
  COPY_FILES += \
91
      $(SWING_PLAF_WINDOWS_RESOURCES_DIR_CLOSED)/icons/JavaCup32.png
92 93
endif

94
ifeq ($(ENABLE_JFR), true)
S
sla 已提交
95 96
  JFR_CONFIGURATION_DIR_CLOSED = $(JDK_TOPDIR)/src/closed/share/classes/oracle/jrockit/jfr/settings
  COPY_FILES += \
97
      $(JFR_CONFIGURATION_DIR_CLOSED)/jfc.xsd
S
sla 已提交
98 99
endif

100 101
SWING_PLAF_BASIC_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/basic
COPY_FILES += \
102
    $(wildcard $(SWING_PLAF_BASIC_RESOURCES_DIR)/icons/*.png)
103 104 105 106 107 108 109

ifndef OPENJDK
  SWING_PLAF_BASIC_RESOURCES_DIR_CLOSED = $(JDK_TOPDIR)/src/closed/share/classes/javax/swing/plaf/basic
  # Filter out JavaCup16.png from OpenJDK
  COPY_FILES := $(filter-out $(SWING_PLAF_BASIC_RESOURCES_DIR)/icons/JavaCup16.png, $(COPY_FILES))
  # Alter JavaCup16.png from ClosedJDK
  COPY_FILES += \
110
      $(SWING_PLAF_BASIC_RESOURCES_DIR_CLOSED)/icons/JavaCup16.png
111 112 113 114 115
endif

ifdef OPENJDK
  SWING_PLAF_MOTIF_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/motif
  COPY_FILES += \
116 117
      $(wildcard $(SWING_PLAF_MOTIF_RESOURCES_DIR)/icons/*.gif) \
      $(wildcard $(SWING_PLAF_MOTIF_RESOURCES_DIR)/icons/*.png)
118 119 120
else
  SWING_PLAF_MOTIF_RESOURCES_DIR_CLOSED = $(JDK_TOPDIR)/src/closed/share/classes/com/sun/java/swing/plaf/motif
  COPY_FILES += \
121 122
      $(wildcard $(SWING_PLAF_MOTIF_RESOURCES_DIR_CLOSED)/icons/*.gif) \
      $(wildcard $(SWING_PLAF_MOTIF_RESOURCES_DIR_CLOSED)/icons/*.png)
123 124 125 126
endif

SWING_PLAF_METAL_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/metal
COPY_FILES += \
127 128 129 130 131
    $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/icons/*.gif) \
    $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/icons/*.png) \
    $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/icons/ocean/*.gif) \
    $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/icons/ocean/*.png) \
    $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/sounds/*.wav)
132

133
ifneq ($(OPENJDK_TARGET_OS), windows)
134 135 136
  # Only copy GTK resources on Solaris/Linux
  SWING_PLAF_GTK_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/gtk
  COPY_FILES += \
137 138 139
      $(wildcard $(SWING_PLAF_GTK_RESOURCES_DIR)/icons/*.gif) \
      $(wildcard $(SWING_PLAF_GTK_RESOURCES_DIR)/icons/*.png) \
      $(wildcard $(SWING_PLAF_GTK_RESOURCES_DIR)/resources/metacity/SwingFallbackTheme/metacity-1/*.xml)
140 141 142
endif
# END: Swing plaf resources

I
ihse 已提交
143
SWING_BEANINFO_RESOURCES_SRC_DIR = $(JDK_TOPDIR)/make/data/swingbeaninfo/images
144
SWING_BEANINFO_RESOURCES_SRC = $(wildcard $(SWING_BEANINFO_RESOURCES_SRC_DIR)/*.gif)
145 146 147
OUT_BEANINFO_RESOURCES = $(patsubst $(SWING_BEANINFO_RESOURCES_SRC_DIR)%, \
    $(JDK_OUTPUTDIR)/classes/javax/swing/beaninfo/images/%, \
    $(SWING_BEANINFO_RESOURCES_SRC))
148 149 150 151 152 153 154

COPY_EXTRA += $(OUT_BEANINFO_RESOURCES)
# END: Swing beaninfo resources

# Swing text resources
SWING_TEXT_RESOURCEDIR = $(JDK_TOPDIR)/src/share/classes/javax/swing/text
COPY_FILES += \
155 156
    $(SWING_TEXT_RESOURCEDIR)/html/default.css \
    $(wildcard $(SWING_TEXT_RESOURCEDIR)/rtf/charsets/*.txt)
157

158 159 160 161 162
##########################################################################################
#
# Copy the META-INF/services configuration files that are scattered around the source tree
# into classes/META-INF/services. Be aware that META-INF directories that are located at a
# source root (.../classes/META-INF) are automatically copied verbatim by the
S
sla 已提交
163
# SetupJavaCompilation macro.
164 165 166 167 168
#
# Any other META-INF/services configuration file is found here and platform specific comments
# are uncommented and the configuration file is stored in the output META-INF directory.

# Make sure the output directory is created.
169
$(eval $(call MakeDir, $(JDK_OUTPUTDIR)/classes/META-INF/services))
170
# Find all META-INF/services/* files
171 172
ALL_META-INF_DIRS_share := $(shell $(FIND) $(JDK_TOPDIR)/src/share/classes -type d -a -name META-INF)
ALL_META-INF_DIRS_targetapi := $(shell $(FIND) $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes -type d -a -name META-INF)
173
# Platform specific overrides shared
174 175 176 177
ifneq ($(ALL_META-INF_DIRS_targetapi), )
  ALL_META-INF_DIRS := $(ALL_META-INF_DIRS_targetapi) \
      $(filter-out %$(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes%,%,$(ALL_META-INF_DIRS_targetapi)), \
      $(ALL_META-INF_DIRS_share))
178
else
179
  ALL_META-INF_DIRS := $(ALL_META-INF_DIRS_share)
180 181
endif

182
SRC_SERVICES_FILES := $(wildcard $(addsuffix /services/*, $(ALL_META-INF_DIRS)))
183

184
ifdef OPENJDK
185
  SRC_SERVICES_FILES := $(filter-out %sun/dc/META-INF/services/sun.java2d.pipe.RenderingEngine, $(SRC_SERVICES_FILES))
186
else
187
  SRC_SERVICES_FILES := $(filter-out %sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine, $(SRC_SERVICES_FILES))
188
endif
189

190 191
# The number of services files are relatively few. If the increase in numbers, then
# we have to use ListPathsSafelyNow here.
192
# Change $(JDK_TOPDIR)/src/.../META-INF/services/yyyy into $(JDK_OUTPUTDIR)/classes/META-INF/services/yyyy
193
# The \n in the printf command is needed to make sed work on Solaris.
194 195 196
OUT_SERVICES_FILES := $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/, \
    $(shell $(PRINTF) "$(SRC_SERVICES_FILES)\n" | $(SED) -e 's|/[^ ]*/META-INF/services/||g'))
OUT_SERVICES_FILES_COLON := $(addsuffix :, $(OUT_SERVICES_FILES))
197
# Exception handling for print services with no META-INF directory
198
SRC_SERVICES_FILES_PRINT = $(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/sun/print/services/*)
199 200 201 202 203
OUT_SERVICES_FILES_PRINT = $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/, \
    $(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/sun/print/services/%, %, \
    $(SRC_SERVICES_FILES_PRINT)))
OUT_SERVICES_FILES_PRINT_COLON = $(addsuffix :, $(OUT_SERVICES_FILES_PRINT))
RULES_SERVICES_PRINT = $(join $(OUT_SERVICES_FILES_PRINT_COLON), $(SRC_SERVICES_FILES_PRINT))
204 205

# Now setup the dependency rules to generate a META-INF/services/... from the correct source.
206
META-INF_RULES_SERVICES := $(RULES_SERVICES_PRINT) $(join $(OUT_SERVICES_FILES_COLON), $(SRC_SERVICES_FILES))
207 208
# Eval the newly created rules to incorporate them into the make tree.
define addto_meta-inf_services
209
  $1
S
sla 已提交
210
	echo $(LOG_INFO) Installing META-INF/services/$$(@F)
211
	$(CAT) $$< | $(SED) -e "s/^#\[$(OPENJDK_TARGET_OS)\]//" > $$@
212
endef
213
$(foreach i, $(META-INF_RULES_SERVICES), $(eval $(call addto_meta-inf_services, $i)))
214 215 216 217
# Here is the generic rule, whose receipt the above rules will trigger.

COPY_EXTRA += $(OUT_SERVICES_FILES)
COPY_EXTRA += $(OUT_SERVICES_FILES_PRINT)
218 219 220

###

221
$(JDK_OUTPUTDIR)/classes/sun/nio/cs/ext/sjis0213.dat: $(JDK_OUTPUTDIR)/gensrc/sun/nio/cs/ext/sjis0213.dat
222
	$(call install-file)
223 224 225 226 227 228 229 230

COPY_EXTRA += $(JDK_OUTPUTDIR)/classes/sun/nio/cs/ext/sjis0213.dat

###

JAVAX_SOUND_SRC := $(JDK_TOPDIR)/src/share/classes/com/sun/media/sound/services

JAVAX_SOUND_SRC_FILES := \
231 232 233 234 235 236 237 238
    javax.sound.midi.spi.MidiDeviceProvider \
    javax.sound.midi.spi.MidiFileReader \
    javax.sound.midi.spi.MidiFileWriter \
    javax.sound.midi.spi.SoundbankReader \
    javax.sound.sampled.spi.AudioFileReader \
    javax.sound.sampled.spi.AudioFileWriter \
    javax.sound.sampled.spi.FormatConversionProvider \
    javax.sound.sampled.spi.MixerProvider
239

240
COPY_EXTRA += $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/, $(JAVAX_SOUND_SRC_FILES))
241

242
JAVAX_SOUND_RULES := $(foreach F, $(JAVAX_SOUND_SRC_FILES), $(JDK_OUTPUTDIR)/classes/META-INF/services/$(notdir $F):$(JAVAX_SOUND_SRC)/$F)
243

244
$(foreach R, $(JAVAX_SOUND_RULES), $(eval $(call addto_meta-inf_services, $R)))