1 # 2 # Copyright (c) 2011, 2013, 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 .dat _options .js aliasmap .spp .wav .css \ 29 .png .gif .xml .dtd .txt oqlhelp.html content-types.properties 30 31 # These directories should not be copied at all 32 EXCLUDES += \ 33 com/sun/org/apache/xml/internal/security/resource/schema \ 34 java/awt/doc-files \ 35 java/lang/doc-files \ 36 javax/swing/doc-files \ 37 javax/swing/text/doc-files \ 38 javax/swing/plaf/synth/doc-files \ 39 javax/swing/undo/doc-files \ 40 sun/awt/X11/doc-files \ 41 sun/util/cldr/resources \ 42 # 43 44 # These files should never be included 45 EXFILES += build.xml README.txt version.txt 46 47 # These icons are handled in GensrcIcons.gmk 48 EXFILES += \ 49 sun/awt/X11/java-icon16.png \ 50 sun/awt/X11/java-icon24.png \ 51 sun/awt/X11/java-icon32.png \ 52 sun/awt/X11/java-icon48.png \ 53 $(wildcard $(JDK_TOPDIR)/src/share/classes/sun/awt/resources/*.png) \ 54 # 55 56 ifndef OPENJDK 57 # Theses icons have closed replacements 58 SWING_PLAF_MOTIF_RESOURCES_DIR := $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/motif 59 EXFILES += \ 60 $(JDK_TOPDIR)/src/share/classes/com/sun/java/swing/plaf/windows/icons/JavaCup32.png \ 61 $(JDK_TOPDIR)/src/share/classes/javax/swing/plaf/basic/icons/JavaCup16.png \ 62 $(wildcard $(SWING_PLAF_MOTIF_RESOURCES_DIR)/icons/*.gif) \ 63 $(wildcard $(SWING_PLAF_MOTIF_RESOURCES_DIR)/icons/*.png) \ 64 # 65 66 EXFILES += mib_core.txt 67 endif 68 69 ifeq ($(ENABLE_JFR), true) 70 JFR_CONFIGURATION_DIR_CLOSED := $(JDK_TOPDIR)/src/closed/share/classes/oracle/jrockit/jfr/settings 71 COPY_FILES += \ 72 $(JFR_CONFIGURATION_DIR_CLOSED)/jfc.xsd 73 endif 74 75 SWING_BEANINFO_RESOURCES_SRC_DIR = $(JDK_TOPDIR)/make/data/swingbeaninfo/images 76 SWING_BEANINFO_RESOURCES_SRC = $(wildcard $(SWING_BEANINFO_RESOURCES_SRC_DIR)/*.gif) 77 OUT_BEANINFO_RESOURCES = $(patsubst $(SWING_BEANINFO_RESOURCES_SRC_DIR)%, \ 78 $(JDK_OUTPUTDIR)/classes/javax/swing/beaninfo/images/%, \ 79 $(SWING_BEANINFO_RESOURCES_SRC)) 80 81 COPY_EXTRA += $(OUT_BEANINFO_RESOURCES) 82 83 # The exception handling of swing beaninfo 84 # These resources violates the convention of having code and resources together under 85 # $(JDK_TOPDIR)/src/.../classes directories 86 $(JDK_OUTPUTDIR)/classes/javax/swing/beaninfo/images/%.gif: \ 87 $(JDK_TOPDIR)/make/data/swingbeaninfo/images/%.gif 88 $(call install-file) 89 90 ########################################################################################## 91 # 92 # Copy the META-INF/services configuration files that are scattered around the source tree 93 # into classes/META-INF/services. Be aware that META-INF directories that are located at a 94 # source root (.../classes/META-INF) are automatically copied verbatim by the 95 # SetupJavaCompilation macro. 96 # 97 # Any other META-INF/services configuration file is found here and platform specific comments 98 # are uncommented and the configuration file is stored in the output META-INF directory. 99 100 # Make sure the output directory is created. 101 $(eval $(call MakeDir, $(JDK_OUTPUTDIR)/classes/META-INF/services)) 102 # Find all META-INF/services/* files 103 ALL_META-INF_DIRS_share := $(shell $(FIND) $(JDK_TOPDIR)/src/share/classes -type d -a -name META-INF) 104 ALL_META-INF_DIRS_targetapi := $(shell $(FIND) $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes -type d -a -name META-INF) 105 # Platform specific overrides shared 106 ifneq ($(ALL_META-INF_DIRS_targetapi), ) 107 ALL_META-INF_DIRS := $(ALL_META-INF_DIRS_targetapi) \ 108 $(filter-out %$(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes%,%,$(ALL_META-INF_DIRS_targetapi)), \ 109 $(ALL_META-INF_DIRS_share)) 110 else 111 ALL_META-INF_DIRS := $(ALL_META-INF_DIRS_share) 112 endif 113 114 SRC_SERVICES_FILES := $(wildcard $(addsuffix /services/*, $(ALL_META-INF_DIRS))) 115 116 # The number of services files are relatively few. If the increase in numbers, then 117 # we have to use ListPathsSafelyNow here. 118 # Change $(JDK_TOPDIR)/src/.../META-INF/services/yyyy into $(JDK_OUTPUTDIR)/classes/META-INF/services/yyyy 119 # The \n in the printf command is needed to make sed work on Solaris. 120 OUT_SERVICES_FILES := $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/, \ 121 $(shell $(PRINTF) "$(SRC_SERVICES_FILES)\n" | $(SED) -e 's|/[^ ]*/META-INF/services/||g')) 122 OUT_SERVICES_FILES_COLON := $(addsuffix :, $(OUT_SERVICES_FILES)) 123 # Exception handling for print services with no META-INF directory 124 SRC_SERVICES_FILES_PRINT = $(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/sun/print/services/*) 125 OUT_SERVICES_FILES_PRINT = $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/, \ 126 $(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/sun/print/services/%, %, \ 127 $(SRC_SERVICES_FILES_PRINT))) 128 OUT_SERVICES_FILES_PRINT_COLON = $(addsuffix :, $(OUT_SERVICES_FILES_PRINT)) 129 RULES_SERVICES_PRINT = $(join $(OUT_SERVICES_FILES_PRINT_COLON), $(SRC_SERVICES_FILES_PRINT)) 130 131 # Now setup the dependency rules to generate a META-INF/services/... from the correct source. 132 META-INF_RULES_SERVICES := $(RULES_SERVICES_PRINT) $(join $(OUT_SERVICES_FILES_COLON), $(SRC_SERVICES_FILES)) 133 # Eval the newly created rules to incorporate them into the make tree. 134 define addto_meta-inf_services 135 $1 136 echo $(LOG_INFO) Installing META-INF/services/$$(@F) 137 $(CAT) $$< | $(SED) -e "s/^#\[$(OPENJDK_TARGET_OS)\]//" > $$@ 138 endef 139 $(foreach i, $(META-INF_RULES_SERVICES), $(eval $(call addto_meta-inf_services, $i))) 140 # Here is the generic rule, whose receipt the above rules will trigger. 141 142 COPY_EXTRA += $(OUT_SERVICES_FILES) 143 COPY_EXTRA += $(OUT_SERVICES_FILES_PRINT) 144 145 ################################################################################ 146 147 JAVAX_SOUND_SRC := $(JDK_TOPDIR)/src/share/classes/com/sun/media/sound/services 148 149 JAVAX_SOUND_SRC_FILES := \ 150 javax.sound.midi.spi.MidiDeviceProvider \ 151 javax.sound.midi.spi.MidiFileReader \ 152 javax.sound.midi.spi.MidiFileWriter \ 153 javax.sound.midi.spi.SoundbankReader \ 154 javax.sound.sampled.spi.AudioFileReader \ 155 javax.sound.sampled.spi.AudioFileWriter \ 156 javax.sound.sampled.spi.FormatConversionProvider \ 157 javax.sound.sampled.spi.MixerProvider 158 159 COPY_EXTRA += $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/, $(JAVAX_SOUND_SRC_FILES)) 160 161 JAVAX_SOUND_RULES := $(foreach F, $(JAVAX_SOUND_SRC_FILES), $(JDK_OUTPUTDIR)/classes/META-INF/services/$(notdir $F):$(JAVAX_SOUND_SRC)/$F) 162 163 $(foreach R, $(JAVAX_SOUND_RULES), $(eval $(call addto_meta-inf_services, $R))) 164 165 ################################################################################ 166 167 CLEAN_FILES := $(wildcard \ 168 $(JDK_TOPDIR)/src/share/classes/com/sun/imageio/plugins/common/*.properties \ 169 $(JDK_TOPDIR)/src/share/classes/com/sun/java/util/jar/pack/*.properties \ 170 $(JDK_TOPDIR)/src/share/classes/com/sun/jndi/cosnaming/jndiprovider.properties \ 171 $(JDK_TOPDIR)/src/share/classes/com/sun/jndi/ldap/jndiprovider.properties \ 172 $(JDK_TOPDIR)/src/share/classes/com/sun/org/apache/xml/internal/security/resource/*.properties \ 173 $(JDK_TOPDIR)/src/share/classes/com/sun/rowset/*.properties \ 174 $(JDK_TOPDIR)/src/share/classes/com/sun/tools/script/shell/*.properties \ 175 $(JDK_TOPDIR)/src/share/classes/javax/sql/rowset/*.properties \ 176 $(JDK_TOPDIR)/src/share/classes/sun/rmi/registry/resources/*.properties \ 177 $(JDK_TOPDIR)/src/share/classes/sun/rmi/rmic/resources/*.properties \ 178 $(JDK_TOPDIR)/src/share/classes/sun/rmi/server/resources/*.properties \ 179 $(JDK_TOPDIR)/src/share/classes/sun/tools/javac/resources/*.properties \ 180 $(JDK_TOPDIR)/src/share/classes/sun/tools/jconsole/resources/*.properties \ 181 $(JDK_TOPDIR)/src/share/classes/sun/tools/serialver/resources/*.properties \ 182 ) 183 184 # Copy zh_HK files from zh_TW 185 186 $(JDK_OUTPUTDIR)/classes/%_zh_HK.properties: $(JDK_OUTPUTDIR)/classes/%_zh_TW.properties 187 $(install-file) 188 189 COPY_EXTRA += $(patsubst $(JDK_TOPDIR)/src/share/classes/%, $(JDK_OUTPUTDIR)/classes/%, \ 190 $(subst _zh_TW,_zh_HK, $(filter %_zh_TW.properties, $(CLEAN_FILES))))