ohair | 92de566 | 2012-04-10 08:22:03 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (c) 2011, 2012, 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 | # Servicetag resources |
| 63 | SERVICETAG_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/com/sun/servicetag/resources |
| 64 | COPY_FILES += \ |
| 65 | $(SERVICETAG_RESOURCES_DIR)/product_registration.xsd \ |
| 66 | $(SERVICETAG_RESOURCES_DIR)/register.html \ |
| 67 | $(SERVICETAG_RESOURCES_DIR)/register_ja.html \ |
| 68 | $(SERVICETAG_RESOURCES_DIR)/register_zh_CN.html \ |
| 69 | $(wildcard $(SERVICETAG_RESOURCES_DIR)/javase_*.properties) |
| 70 | |
| 71 | # JConsole resources |
| 72 | JCONSOLE_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/resources |
| 73 | COPY_FILES += \ |
| 74 | $(wildcard $(JCONSOLE_RESOURCES_DIR)/*.png) \ |
| 75 | $(wildcard $(JCONSOLE_RESOURCES_DIR)/*.gif) |
| 76 | |
| 77 | # Print resources |
| 78 | PRINT_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/sun/print/resources |
| 79 | COPY_FILES += \ |
| 80 | $(wildcard $(PRINT_RESOURCES_DIR)/*.png) |
| 81 | |
| 82 | # IDN resources |
| 83 | COPY_FILES += \ |
| 84 | $(JDK_TOPDIR)/src/share/classes/sun/net/idn/uidna.spp |
| 85 | |
erikj | e78df74 | 2012-06-07 20:40:50 -0700 | [diff] [blame] | 86 | # |
| 87 | # Swing plaf resources |
| 88 | # |
| 89 | SWING_PLAF_WINDOWS_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/windows |
| 90 | COPY_FILES += \ |
| 91 | $(wildcard $(SWING_PLAF_WINDOWS_RESOURCES_DIR)/icons/*.gif) \ |
| 92 | $(wildcard $(SWING_PLAF_WINDOWS_RESOURCES_DIR)/icons/*.png) |
| 93 | |
| 94 | ifndef OPENJDK |
| 95 | SWING_PLAF_WINDOWS_RESOURCES_DIR_CLOSED = $(JDK_TOPDIR)/src/closed/share/classes/com/sun/java/swing/plaf/windows |
| 96 | # Filter out JavaCup32.png from OpenJDK |
| 97 | COPY_FILES := $(filter-out $(SWING_PLAF_WINDOWS_RESOURCES_DIR)/icons/JavaCup32.png, $(COPY_FILES)) |
| 98 | # Alter JavaCup32.png from ClosedJDK |
| 99 | COPY_FILES += \ |
| 100 | $(SWING_PLAF_WINDOWS_RESOURCES_DIR_CLOSED)/icons/JavaCup32.png |
| 101 | endif |
| 102 | |
| 103 | SWING_PLAF_BASIC_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/basic |
| 104 | COPY_FILES += \ |
| 105 | $(wildcard $(SWING_PLAF_BASIC_RESOURCES_DIR)/icons/*.png) |
| 106 | |
| 107 | ifndef OPENJDK |
| 108 | SWING_PLAF_BASIC_RESOURCES_DIR_CLOSED = $(JDK_TOPDIR)/src/closed/share/classes/javax/swing/plaf/basic |
| 109 | # Filter out JavaCup16.png from OpenJDK |
| 110 | COPY_FILES := $(filter-out $(SWING_PLAF_BASIC_RESOURCES_DIR)/icons/JavaCup16.png, $(COPY_FILES)) |
| 111 | # Alter JavaCup16.png from ClosedJDK |
| 112 | COPY_FILES += \ |
| 113 | $(SWING_PLAF_BASIC_RESOURCES_DIR_CLOSED)/icons/JavaCup16.png |
| 114 | endif |
| 115 | |
| 116 | ifdef OPENJDK |
| 117 | SWING_PLAF_MOTIF_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/motif |
| 118 | COPY_FILES += \ |
| 119 | $(wildcard $(SWING_PLAF_MOTIF_RESOURCES_DIR)/icons/*.gif) \ |
| 120 | $(wildcard $(SWING_PLAF_MOTIF_RESOURCES_DIR)/icons/*.png) |
| 121 | else |
| 122 | SWING_PLAF_MOTIF_RESOURCES_DIR_CLOSED = $(JDK_TOPDIR)/src/closed/share/classes/com/sun/java/swing/plaf/motif |
| 123 | COPY_FILES += \ |
| 124 | $(wildcard $(SWING_PLAF_MOTIF_RESOURCES_DIR_CLOSED)/icons/*.gif) \ |
| 125 | $(wildcard $(SWING_PLAF_MOTIF_RESOURCES_DIR_CLOSED)/icons/*.png) |
| 126 | endif |
| 127 | |
| 128 | SWING_PLAF_METAL_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/metal |
| 129 | COPY_FILES += \ |
| 130 | $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/icons/*.gif) \ |
| 131 | $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/icons/*.png) \ |
| 132 | $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/icons/ocean/*.gif) \ |
| 133 | $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/icons/ocean/*.png) \ |
| 134 | $(wildcard $(SWING_PLAF_METAL_RESOURCES_DIR)/sounds/*.wav) |
| 135 | |
erikj | af85fc4 | 2012-07-03 16:10:44 -0700 | [diff] [blame] | 136 | ifneq ($(OPENJDK_TARGET_OS), windows) |
erikj | e78df74 | 2012-06-07 20:40:50 -0700 | [diff] [blame] | 137 | # Only copy GTK resources on Solaris/Linux |
| 138 | SWING_PLAF_GTK_RESOURCES_DIR = $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/gtk |
| 139 | COPY_FILES += \ |
| 140 | $(wildcard $(SWING_PLAF_GTK_RESOURCES_DIR)/icons/*.gif) \ |
| 141 | $(wildcard $(SWING_PLAF_GTK_RESOURCES_DIR)/icons/*.png) \ |
| 142 | $(wildcard $(SWING_PLAF_GTK_RESOURCES_DIR)/resources/metacity/SwingFallbackTheme/metacity-1/*.xml) |
| 143 | endif |
| 144 | # END: Swing plaf resources |
| 145 | |
| 146 | # The exception handling of swing beaninfo |
| 147 | # These resources violates the convention of having code and resources together under |
| 148 | # $(JDK_TOPDIR)/src/.../classes directories |
| 149 | SWING_BEANINFO_RESOURCES_SRC_DIR = $(JDK_TOPDIR)/make/tools/swing-beans/beaninfo/images |
| 150 | SWING_BEANINFO_RESOURCES_SRC = $(wildcard $(SWING_BEANINFO_RESOURCES_SRC_DIR)/*.gif) |
| 151 | OUT_BEANINFO_RESOURCES = $(addprefix $(JDK_OUTPUTDIR)/classes/javax/swing/beaninfo/images/,\ |
| 152 | $(shell $(PRINTF) "$(SWING_BEANINFO_RESOURCES_SRC)\n" | $(SED) -e 's|/[^ ]*/beaninfo/images/||g')) |
| 153 | |
| 154 | COPY_EXTRA += $(OUT_BEANINFO_RESOURCES) |
| 155 | # END: Swing beaninfo resources |
| 156 | |
| 157 | # Swing text resources |
| 158 | SWING_TEXT_RESOURCEDIR = $(JDK_TOPDIR)/src/share/classes/javax/swing/text |
| 159 | COPY_FILES += \ |
| 160 | $(SWING_TEXT_RESOURCEDIR)/html/default.css \ |
| 161 | $(wildcard $(SWING_TEXT_RESOURCEDIR)/rtf/charsets/*.txt) |
| 162 | |
ohair | 92de566 | 2012-04-10 08:22:03 -0700 | [diff] [blame] | 163 | ########################################################################################## |
| 164 | # |
| 165 | # Copy the META-INF/services configuration files that are scattered around the source tree |
| 166 | # into classes/META-INF/services. Be aware that META-INF directories that are located at a |
| 167 | # source root (.../classes/META-INF) are automatically copied verbatim by the |
| 168 | # SetupJavaCompilation macro. |
| 169 | # |
| 170 | # Any other META-INF/services configuration file is found here and platform specific comments |
| 171 | # are uncommented and the configuration file is stored in the output META-INF directory. |
| 172 | |
| 173 | # Make sure the output directory is created. |
erikj | e78df74 | 2012-06-07 20:40:50 -0700 | [diff] [blame] | 174 | $(shell $(MKDIR) -p $(JDK_OUTPUTDIR)/classes/META-INF/services) |
ohair | 92de566 | 2012-04-10 08:22:03 -0700 | [diff] [blame] | 175 | # Find all META-INF/services/* files |
| 176 | ALL_META-INF_DIRS_share:=$(shell $(FIND) $(JDK_TOPDIR)/src/share/classes -type d -a -name META-INF) |
ohair | 46fcac9 | 2012-09-18 11:29:24 -0700 | [diff] [blame] | 177 | ALL_META-INF_DIRS_targetapi:=$(shell $(FIND) $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes -type d -a -name META-INF) |
ohair | 92de566 | 2012-04-10 08:22:03 -0700 | [diff] [blame] | 178 | # Platform specific overrides shared |
erikj | af85fc4 | 2012-07-03 16:10:44 -0700 | [diff] [blame] | 179 | ifneq ($(ALL_META-INF_DIRS_targetapi),) |
| 180 | ALL_META-INF_DIRS:=$(ALL_META-INF_DIRS_targetapi) \ |
ohair | 46fcac9 | 2012-09-18 11:29:24 -0700 | [diff] [blame] | 181 | $(filter-out %$(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes%,%,$(ALL_META-INF_DIRS_targetapi)),\ |
ohair | 92de566 | 2012-04-10 08:22:03 -0700 | [diff] [blame] | 182 | $(ALL_META-INF_DIRS_share)) |
| 183 | else |
| 184 | ALL_META-INF_DIRS:=$(ALL_META-INF_DIRS_share) |
| 185 | endif |
| 186 | # Filter out META-INF dirs that shouldn't be included |
ohair | 92de566 | 2012-04-10 08:22:03 -0700 | [diff] [blame] | 187 | ifdef OPENJDK |
| 188 | ALL_META-INF_DIRS:=$(filter-out %com/sun/script/javascript/META-INF,$(ALL_META-INF_DIRS)) |
| 189 | endif |
| 190 | |
erikj | e78df74 | 2012-06-07 20:40:50 -0700 | [diff] [blame] | 191 | ifndef OPENJDK |
erikj | af85fc4 | 2012-07-03 16:10:44 -0700 | [diff] [blame] | 192 | ifneq ($(OPENJDK_TARGET_OS), macosx) |
erikj | e78df74 | 2012-06-07 20:40:50 -0700 | [diff] [blame] | 193 | ALL_META-INF_DIRS += $(JDK_TOPDIR)/src/closed/share/classes/sun/jdbc/odbc/META-INF |
| 194 | endif |
| 195 | endif |
| 196 | |
| 197 | ifndef OPENJDK |
| 198 | ALL_META-INF_DIRS += $(JDK_TOPDIR)/src/closed/share/classes/sun/java2d/cmm/kcms/META-INF |
| 199 | endif |
| 200 | |
ohair | 92de566 | 2012-04-10 08:22:03 -0700 | [diff] [blame] | 201 | SRC_SERVICES_FILES:=$(wildcard $(addsuffix /services/*,$(ALL_META-INF_DIRS))) |
erikj | e78df74 | 2012-06-07 20:40:50 -0700 | [diff] [blame] | 202 | |
ohair | 92de566 | 2012-04-10 08:22:03 -0700 | [diff] [blame] | 203 | ifdef OPENJDK |
| 204 | SRC_SERVICES_FILES:=$(filter-out %sun/dc/META-INF/services/sun.java2d.pipe.RenderingEngine,$(SRC_SERVICES_FILES)) |
| 205 | SRC_SERVICES_FILES:=$(filter-out %sun/java2d/cmm/kcms/META-INF/services/sun.java2d.cmm.PCMM,$(SRC_SERVICES_FILES)) |
| 206 | else |
| 207 | SRC_SERVICES_FILES:=$(filter-out %sun/java2d/pisces/META-INF/services/sun.java2d.pipe.RenderingEngine,$(SRC_SERVICES_FILES)) |
| 208 | SRC_SERVICES_FILES:=$(filter-out %sun/java2d/cmm/lcms/META-INF/services/sun.java2d.cmm.PCMM,$(SRC_SERVICES_FILES)) |
| 209 | endif |
erikj | e78df74 | 2012-06-07 20:40:50 -0700 | [diff] [blame] | 210 | |
ohair | 92de566 | 2012-04-10 08:22:03 -0700 | [diff] [blame] | 211 | # The number of services files are relatively few. If the increase in numbers, then |
| 212 | # we have to use ListPathsSafelyNow here. |
erikj | e78df74 | 2012-06-07 20:40:50 -0700 | [diff] [blame] | 213 | # Change $(JDK_TOPDIR)/src/.../META-INF/services/yyyy into $(JDK_OUTPUTDIR)/classes/META-INF/services/yyyy |
ohair | 92de566 | 2012-04-10 08:22:03 -0700 | [diff] [blame] | 214 | # The \n in the printf command is needed to make sed work on Solaris. |
erikj | e78df74 | 2012-06-07 20:40:50 -0700 | [diff] [blame] | 215 | OUT_SERVICES_FILES:=$(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/,\ |
ohair | 92de566 | 2012-04-10 08:22:03 -0700 | [diff] [blame] | 216 | $(shell $(PRINTF) "$(SRC_SERVICES_FILES)\n" | $(SED) -e 's|/[^ ]*/META-INF/services/||g')) |
| 217 | OUT_SERVICES_FILES_COLON:=$(addsuffix :,$(OUT_SERVICES_FILES)) |
| 218 | # Exception handling for print services with no META-INF directory |
ohair | 46fcac9 | 2012-09-18 11:29:24 -0700 | [diff] [blame] | 219 | SRC_SERVICES_FILES_PRINT = $(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/sun/print/services/*) |
erikj | e78df74 | 2012-06-07 20:40:50 -0700 | [diff] [blame] | 220 | OUT_SERVICES_FILES_PRINT = $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/,\ |
ohair | 46fcac9 | 2012-09-18 11:29:24 -0700 | [diff] [blame] | 221 | $(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/sun/print/services/%,%,\ |
ohair | 92de566 | 2012-04-10 08:22:03 -0700 | [diff] [blame] | 222 | $(SRC_SERVICES_FILES_PRINT))) |
| 223 | OUT_SERVICES_FILES_PRINT_COLON = $(addsuffix :,$(OUT_SERVICES_FILES_PRINT)) |
| 224 | RULES_SERVICES_PRINT = $(join $(OUT_SERVICES_FILES_PRINT_COLON),$(SRC_SERVICES_FILES_PRINT)) |
| 225 | |
| 226 | # Now setup the dependency rules to generate a META-INF/services/... from the correct source. |
| 227 | META-INF_RULES_SERVICES:=$(RULES_SERVICES_PRINT) $(join $(OUT_SERVICES_FILES_COLON),$(SRC_SERVICES_FILES)) |
| 228 | # Eval the newly created rules to incorporate them into the make tree. |
| 229 | define addto_meta-inf_services |
| 230 | $1 |
| 231 | echo Installing META-INF/services/$$(@F) |
erikj | af85fc4 | 2012-07-03 16:10:44 -0700 | [diff] [blame] | 232 | $(CAT) $$< | $(SED) -e "s/^#\[$(OPENJDK_TARGET_OS)\]//" > $$@ |
ohair | 92de566 | 2012-04-10 08:22:03 -0700 | [diff] [blame] | 233 | endef |
| 234 | $(foreach i,$(META-INF_RULES_SERVICES),$(eval $(call addto_meta-inf_services,$i))) |
| 235 | # Here is the generic rule, whose receipt the above rules will trigger. |
| 236 | |
| 237 | COPY_EXTRA += $(OUT_SERVICES_FILES) |
| 238 | COPY_EXTRA += $(OUT_SERVICES_FILES_PRINT) |
erikj | e78df74 | 2012-06-07 20:40:50 -0700 | [diff] [blame] | 239 | |
| 240 | ### |
| 241 | |
| 242 | $(JDK_OUTPUTDIR)/classes/sun/nio/cs/ext/sjis0213.dat : $(JDK_OUTPUTDIR)/gensrc/sun/nio/cs/ext/sjis0213.dat |
| 243 | $(MKDIR) -p $(@D) |
| 244 | $(RM) $@ |
| 245 | $(CP) $< $(@) |
| 246 | |
| 247 | COPY_EXTRA += $(JDK_OUTPUTDIR)/classes/sun/nio/cs/ext/sjis0213.dat |
| 248 | |
| 249 | ### |
| 250 | |
| 251 | JAVAX_SOUND_SRC := $(JDK_TOPDIR)/src/share/classes/com/sun/media/sound/services |
| 252 | |
| 253 | JAVAX_SOUND_SRC_FILES := \ |
| 254 | javax.sound.midi.spi.MidiDeviceProvider \ |
| 255 | javax.sound.midi.spi.MidiFileReader \ |
| 256 | javax.sound.midi.spi.MidiFileWriter \ |
| 257 | javax.sound.midi.spi.SoundbankReader \ |
| 258 | javax.sound.sampled.spi.AudioFileReader \ |
| 259 | javax.sound.sampled.spi.AudioFileWriter \ |
ohair | 46fcac9 | 2012-09-18 11:29:24 -0700 | [diff] [blame] | 260 | javax.sound.sampled.spi.FormatConversionProvider \ |
| 261 | javax.sound.sampled.spi.MixerProvider |
erikj | e78df74 | 2012-06-07 20:40:50 -0700 | [diff] [blame] | 262 | |
ohair | 46fcac9 | 2012-09-18 11:29:24 -0700 | [diff] [blame] | 263 | COPY_EXTRA += $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/,$(JAVAX_SOUND_SRC_FILES)) |
erikj | e78df74 | 2012-06-07 20:40:50 -0700 | [diff] [blame] | 264 | |
| 265 | JAVAX_SOUND_RULES := $(foreach F,$(JAVAX_SOUND_SRC_FILES),$(JDK_OUTPUTDIR)/classes/META-INF/services/$(notdir $F):$(JAVAX_SOUND_SRC)/$F) |
| 266 | |
| 267 | $(foreach R,$(JAVAX_SOUND_RULES),$(eval $(call addto_meta-inf_services,$R))) |