2
# Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
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.
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).
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.
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
26
# This makefile creates an image of the optional static versions of certain JDK
37
ALL_MODULES = $(call FindAllModules)
39
################################################################################
43
ifneq ($(filter static-libs-image, $(MAKECMDGOALS)), )
44
IMAGE_DEST_DIR=$(STATIC_LIBS_IMAGE_DIR)/lib
45
else ifneq ($(filter static-libs-graal-image, $(MAKECMDGOALS)), )
46
IMAGE_DEST_DIR=$(STATIC_LIBS_GRAAL_IMAGE_DIR)/lib
49
# Copy JDK static libs to the image.
50
$(foreach m, $(ALL_MODULES), \
51
$(eval $(call SetupCopyFiles, COPY_STATIC_LIBS_$m, \
53
SRC := $(SUPPORT_OUTPUTDIR)/native/$m, \
54
DEST := $(IMAGE_DEST_DIR), \
55
FILES := $(filter %$(STATIC_LIBRARY_SUFFIX), \
56
$(call FindFiles, $(SUPPORT_OUTPUTDIR)/native/$m/*/static)), \
58
$(eval TARGETS += $$(COPY_STATIC_LIBS_$m)) \
59
$(eval STATIC_LIBS_TARGETS += $$(COPY_STATIC_LIBS_$m)) \
62
ifneq ($(filter static-libs-image, $(MAKECMDGOALS)), )
63
# Copy libjvm static library to the image.
64
$(foreach v, $(JVM_VARIANTS), \
65
$(eval $(call SetupCopyFiles, COPY_STATIC_LIBS_$v, \
66
SRC := $(HOTSPOT_OUTPUTDIR)/variant-$v/libjvm/objs/static, \
67
DEST := $(IMAGE_DEST_DIR)/$v, \
68
FILES := $(wildcard $(HOTSPOT_OUTPUTDIR)/variant-$v/libjvm/objs/static/*$(STATIC_LIBRARY_SUFFIX)), \
70
$(eval TARGETS += $$(COPY_STATIC_LIBS_$v)) \
71
$(eval HOTSPOT_VARIANT_STATIC_LIBS_TARGETS += $$(COPY_STATIC_LIBS_$v)) \
75
################################################################################
77
static-libs-image: $(HOTSPOT_VARIANT_STATIC_LIBS_TARGETS) $(STATIC_LIBS_TARGETS)
78
static-libs-graal-image: $(STATIC_LIBS_TARGETS)