1 #
2 # Copyright (c) 2016, 2019, 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
108 else ifeq ($$($1_TYPE)-$(TAR_SUPPORTS_TRANSFORM)-$$($1_UNZIP_DEBUGINFO)-$$(words $$($1_BASE_DIRS)), \
109 tar.gz-true-false-1)
110 # If only one BASE_DIR, but with a SUBDIR set, tar.gz can use the
111 # transform option to create bundle directly from the BASE_DIR.
112 $(CD) $$($1_BASE_DIRS) \
113 && ( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
114 -$(TAR_INCLUDE_PARAM) $$($1_$$($1_BASE_DIRS)_LIST_FILE) \
115 $$(if $$($1_SUBDIR), --transform 's|^|$$($1_SUBDIR)/|S') \
116 $(TAR_IGNORE_EXIT_VALUE) ) \
117 | $(GZIP) > $$@
118 else
119 # In all other cases, need to copy all files into a temporary location
120 # before creation bundle.
121 $(RM) -r $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR)
122 $(MKDIR) -p $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR)
123 $$(foreach d, $$($1_BASE_DIRS), \
124 ( $(CD) $$d \
125 && $(TAR) cf - -$(TAR_INCLUDE_PARAM) $$($1_$$d_LIST_FILE) \
126 $(TAR_IGNORE_EXIT_VALUE) ) \
127 | ( $(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR) && $(TAR) xf - )$$(NEWLINE) )
128 # Unzip any zipped debuginfo files
129 ifeq ($$($1_UNZIP_DEBUGINFO), true)
130 for f in `$(FIND) $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR) -name "*.diz"`; do \
131 $(CD) $$$${f%/*} && $(UNZIP) -q $$$${f} && $(RM) $$$${f}; \
132 done
133 endif
134 ifeq ($$($1_TYPE), tar.gz)
135 $(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1 && \
136 ( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
137 $$(if $$($1_SUBDIR), $$($1_SUBDIR), .) $(TAR_IGNORE_EXIT_VALUE) ) \
138 | $(GZIP) > $$@
139 else ifeq ($$($1_TYPE), zip)
140 $(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1 && $(ZIPEXE) -qr $$@ .
141 endif
142 endif
143
144 $1 += $$($1_OUTPUTDIR)/$$($1_BUNDLE_NAME)
145
146 endef
147
201
202 # Create special filter rules when dealing with unzipped .dSYM directories on
203 # macosx
204 ifeq ($(call isTargetOs, macosx), true)
205 ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), false)
206 JDK_SYMBOLS_EXCLUDE_PATTERN := $(addprefix %, \
207 $(call containing, .dSYM/, $(patsubst $(JDK_IMAGE_DIR)/%, %, \
208 $(ALL_JDK_SYMBOLS_FILES))))
209 endif
210 endif
211
212 JDK_BUNDLE_FILES := \
213 $(filter-out \
214 $(JDK_SYMBOLS_EXCLUDE_PATTERN) \
215 $(JDK_EXTRA_EXCLUDES) \
216 $(SYMBOLS_EXCLUDE_PATTERN) \
217 $(JDK_IMAGE_HOMEDIR)/demo/% \
218 , \
219 $(ALL_JDK_FILES) \
220 )
221 JDK_SYMBOLS_BUNDLE_FILES := \
222 $(filter \
223 $(JDK_SYMBOLS_EXCLUDE_PATTERN) \
224 $(SYMBOLS_EXCLUDE_PATTERN) \
225 , \
226 $(filter-out \
227 $(JDK_IMAGE_HOMEDIR)/demo/% \
228 , \
229 $(ALL_JDK_SYMBOLS_FILES) \
230 ) \
231 ) \
232 $(call FindFiles, $(SYMBOLS_IMAGE_DIR))
233
234 TEST_DEMOS_BUNDLE_FILES := $(filter $(JDK_DEMOS_IMAGE_HOMEDIR)/demo/%, \
235 $(ALL_JDK_DEMOS_FILES))
236
237 ALL_JRE_FILES := $(call ShellFindFiles, $(JRE_IMAGE_DIR))
238
239 # Create special filter rules when dealing with unzipped .dSYM directories on
240 # macosx
241 ifeq ($(OPENJDK_TARGET_OS), macosx)
242 ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), false)
243 JRE_SYMBOLS_EXCLUDE_PATTERN := $(addprefix %, \
244 $(call containing, .dSYM/, $(patsubst $(JRE_IMAGE_DIR)/%, %, $(ALL_JRE_FILES))))
245 endif
246 endif
247
248 JRE_BUNDLE_FILES := $(filter-out \
249 $(JRE_SYMBOLS_EXCLUDE_PATTERN) \
250 $(SYMBOLS_EXCLUDE_PATTERN), \
251 $(ALL_JRE_FILES))
252
253 $(eval $(call SetupBundleFile, BUILD_JDK_BUNDLE, \
254 BUNDLE_NAME := $(JDK_BUNDLE_NAME), \
255 FILES := $(JDK_BUNDLE_FILES), \
256 SPECIAL_INCLUDES := $(JDK_SPECIAL_INCLUDES), \
257 BASE_DIRS := $(JDK_IMAGE_DIR), \
258 SUBDIR := $(JDK_BUNDLE_SUBDIR), \
259 ))
260
261 PRODUCT_TARGETS += $(BUILD_JDK_BUNDLE)
262
263 $(eval $(call SetupBundleFile, BUILD_JRE_BUNDLE, \
264 BUNDLE_NAME := $(JRE_BUNDLE_NAME), \
265 FILES := $(JRE_BUNDLE_FILES), \
266 BASE_DIRS := $(JRE_IMAGE_DIR), \
267 SUBDIR := $(JRE_BUNDLE_SUBDIR), \
268 ))
269
270 LEGACY_TARGETS += $(BUILD_JRE_BUNDLE)
271
272 ifeq ($(COPY_DEBUG_SYMBOLS), true)
273 $(eval $(call SetupBundleFile, BUILD_JDK_SYMBOLS_BUNDLE, \
274 BUNDLE_NAME := $(JDK_SYMBOLS_BUNDLE_NAME), \
275 FILES := $(JDK_SYMBOLS_BUNDLE_FILES), \
276 BASE_DIRS := $(JDK_SYMBOLS_IMAGE_DIR) $(wildcard $(SYMBOLS_IMAGE_DIR)), \
277 SUBDIR := $(JDK_BUNDLE_SUBDIR), \
278 UNZIP_DEBUGINFO := true, \
279 ))
280
281 PRODUCT_TARGETS += $(BUILD_JDK_SYMBOLS_BUNDLE)
282 endif
283
284 # The demo bundle is only created to support client tests. Ideally it should
|
1 #
2 # Copyright (c) 2016, 2020, 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
108 else ifeq ($$($1_TYPE)-$(TAR_SUPPORTS_TRANSFORM)-$$($1_UNZIP_DEBUGINFO)-$$(words $$($1_BASE_DIRS)), \
109 tar.gz-true-false-1)
110 # If only one BASE_DIR, but with a SUBDIR set, tar.gz can use the
111 # transform option to create bundle directly from the BASE_DIR.
112 $(CD) $$($1_BASE_DIRS) \
113 && ( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
114 -$(TAR_INCLUDE_PARAM) $$($1_$$($1_BASE_DIRS)_LIST_FILE) \
115 $$(if $$($1_SUBDIR), --transform 's|^|$$($1_SUBDIR)/|S') \
116 $(TAR_IGNORE_EXIT_VALUE) ) \
117 | $(GZIP) > $$@
118 else
119 # In all other cases, need to copy all files into a temporary location
120 # before creation bundle.
121 $(RM) -r $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR)
122 $(MKDIR) -p $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR)
123 $$(foreach d, $$($1_BASE_DIRS), \
124 ( $(CD) $$d \
125 && $(TAR) cf - -$(TAR_INCLUDE_PARAM) $$($1_$$d_LIST_FILE) \
126 $(TAR_IGNORE_EXIT_VALUE) ) \
127 | ( $(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR) && $(TAR) xf - )$$(NEWLINE) )
128 # Rename stripped pdb files
129 for f in `$(FIND) $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR) -name "*.stripped.pdb"`; do \
130 $(ECHO) found stripped pdb file $$$${f}, we rename it to: $$$${f%stripped.pdb}pdb; \
131 $(MV) $$$${f} $$$${f%stripped.pdb}pdb; \
132 done
133 # Unzip any zipped debuginfo files
134 ifeq ($$($1_UNZIP_DEBUGINFO), true)
135 for f in `$(FIND) $(SUPPORT_OUTPUTDIR)/bundles/$1/$$($1_SUBDIR) -name "*.diz"`; do \
136 $(CD) $$$${f%/*} && $(UNZIP) -q $$$${f} && $(RM) $$$${f}; \
137 done
138 endif
139 ifeq ($$($1_TYPE), tar.gz)
140 $(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1 && \
141 ( $(TAR) cf - $(TAR_CREATE_EXTRA_PARAM) \
142 $$(if $$($1_SUBDIR), $$($1_SUBDIR), .) $(TAR_IGNORE_EXIT_VALUE) ) \
143 | $(GZIP) > $$@
144 else ifeq ($$($1_TYPE), zip)
145 $(CD) $(SUPPORT_OUTPUTDIR)/bundles/$1 && $(ZIPEXE) -qr $$@ .
146 endif
147 endif
148
149 $1 += $$($1_OUTPUTDIR)/$$($1_BUNDLE_NAME)
150
151 endef
152
206
207 # Create special filter rules when dealing with unzipped .dSYM directories on
208 # macosx
209 ifeq ($(call isTargetOs, macosx), true)
210 ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), false)
211 JDK_SYMBOLS_EXCLUDE_PATTERN := $(addprefix %, \
212 $(call containing, .dSYM/, $(patsubst $(JDK_IMAGE_DIR)/%, %, \
213 $(ALL_JDK_SYMBOLS_FILES))))
214 endif
215 endif
216
217 JDK_BUNDLE_FILES := \
218 $(filter-out \
219 $(JDK_SYMBOLS_EXCLUDE_PATTERN) \
220 $(JDK_EXTRA_EXCLUDES) \
221 $(SYMBOLS_EXCLUDE_PATTERN) \
222 $(JDK_IMAGE_HOMEDIR)/demo/% \
223 , \
224 $(ALL_JDK_FILES) \
225 )
226
227 # include stripped pdb files in jdk image bundle
228 ifeq ($(call isTargetOs, windows), true)
229 JDK_STRIPPED_PDB_FILES := \
230 $(filter \
231 %.stripped.pdb \
232 , \
233 $(ALL_JDK_FILES) \
234 )
235 endif
236
237 # remove the stripped pdb files from symbols bundle, we include only the full pdbs
238 JDK_SYMBOLS_BUNDLE_FILES := \
239 $(filter \
240 $(JDK_SYMBOLS_EXCLUDE_PATTERN) \
241 $(SYMBOLS_EXCLUDE_PATTERN) \
242 , \
243 $(filter-out \
244 $(JDK_IMAGE_HOMEDIR)/demo/% %.stripped.pdb \
245 , \
246 $(ALL_JDK_SYMBOLS_FILES) \
247 ) \
248 ) \
249 $(call FindFiles, $(SYMBOLS_IMAGE_DIR))
250
251 TEST_DEMOS_BUNDLE_FILES := $(filter $(JDK_DEMOS_IMAGE_HOMEDIR)/demo/%, \
252 $(ALL_JDK_DEMOS_FILES))
253
254 ALL_JRE_FILES := $(call ShellFindFiles, $(JRE_IMAGE_DIR))
255
256 # Create special filter rules when dealing with unzipped .dSYM directories on
257 # macosx
258 ifeq ($(OPENJDK_TARGET_OS), macosx)
259 ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), false)
260 JRE_SYMBOLS_EXCLUDE_PATTERN := $(addprefix %, \
261 $(call containing, .dSYM/, $(patsubst $(JRE_IMAGE_DIR)/%, %, $(ALL_JRE_FILES))))
262 endif
263 endif
264
265 # include stripped pdb files in jdk image bundle
266 ifeq ($(call isTargetOs, windows), true)
267 JRE_STRIPPED_PDB_FILES := \
268 $(filter \
269 %.stripped.pdb \
270 , \
271 $(ALL_JRE_FILES) \
272 )
273 endif
274
275 JRE_BUNDLE_FILES := $(filter-out \
276 $(JRE_SYMBOLS_EXCLUDE_PATTERN) \
277 $(SYMBOLS_EXCLUDE_PATTERN), \
278 $(ALL_JRE_FILES))
279
280 $(eval $(call SetupBundleFile, BUILD_JDK_BUNDLE, \
281 BUNDLE_NAME := $(JDK_BUNDLE_NAME), \
282 FILES := $(JDK_BUNDLE_FILES) $(JDK_STRIPPED_PDB_FILES), \
283 SPECIAL_INCLUDES := $(JDK_SPECIAL_INCLUDES), \
284 BASE_DIRS := $(JDK_IMAGE_DIR), \
285 SUBDIR := $(JDK_BUNDLE_SUBDIR), \
286 ))
287
288 PRODUCT_TARGETS += $(BUILD_JDK_BUNDLE)
289
290 $(eval $(call SetupBundleFile, BUILD_JRE_BUNDLE, \
291 BUNDLE_NAME := $(JRE_BUNDLE_NAME) $(JRE_STRIPPED_PDB_FILES), \
292 FILES := $(JRE_BUNDLE_FILES), \
293 BASE_DIRS := $(JRE_IMAGE_DIR), \
294 SUBDIR := $(JRE_BUNDLE_SUBDIR), \
295 ))
296
297 LEGACY_TARGETS += $(BUILD_JRE_BUNDLE)
298
299 ifeq ($(COPY_DEBUG_SYMBOLS), true)
300 $(eval $(call SetupBundleFile, BUILD_JDK_SYMBOLS_BUNDLE, \
301 BUNDLE_NAME := $(JDK_SYMBOLS_BUNDLE_NAME), \
302 FILES := $(JDK_SYMBOLS_BUNDLE_FILES), \
303 BASE_DIRS := $(JDK_SYMBOLS_IMAGE_DIR) $(wildcard $(SYMBOLS_IMAGE_DIR)), \
304 SUBDIR := $(JDK_BUNDLE_SUBDIR), \
305 UNZIP_DEBUGINFO := true, \
306 ))
307
308 PRODUCT_TARGETS += $(BUILD_JDK_SYMBOLS_BUNDLE)
309 endif
310
311 # The demo bundle is only created to support client tests. Ideally it should
|