2016-04-08 11:14:23 +00:00
|
|
|
#
|
2024-08-22 10:31:34 +00:00
|
|
|
# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
|
2016-04-08 11:14:23 +00:00
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
|
|
|
|
# This must be the first rule
|
|
|
|
default: all
|
|
|
|
|
|
|
|
include $(SPEC)
|
|
|
|
include MakeBase.gmk
|
|
|
|
include JavaCompilation.gmk
|
2019-03-11 12:09:14 +00:00
|
|
|
include Execute.gmk
|
2016-04-08 11:14:23 +00:00
|
|
|
|
2019-02-07 11:35:45 +00:00
|
|
|
ifeq ($(call isTargetOs, windows), true)
|
2016-04-08 11:14:23 +00:00
|
|
|
# The next part is a bit hacky. We include the CompileJvm.gmk to be
|
2022-04-14 19:33:28 +00:00
|
|
|
# able to extract flags, but we do not wish to execute the rules.
|
2016-04-08 11:14:23 +00:00
|
|
|
|
2023-03-09 16:07:16 +00:00
|
|
|
# Use primary variant for defines and includes
|
|
|
|
JVM_VARIANT := $(JVM_VARIANT_MAIN)
|
2016-04-08 11:14:23 +00:00
|
|
|
|
|
|
|
include HotspotCommon.gmk
|
|
|
|
include lib/CompileJvm.gmk
|
|
|
|
|
|
|
|
# Reset targets so we don't build libjvm.
|
|
|
|
TARGETS :=
|
|
|
|
|
2020-12-07 15:55:53 +00:00
|
|
|
ifeq ($(call isBuildOsEnv, windows.cygwin windows.msys2), true)
|
|
|
|
FixLinuxExecutable = $(call FixPath, $1)
|
|
|
|
else ifeq ($(call isBuildOsEnv, windows.wsl1 windows.wsl2), true)
|
|
|
|
FixLinuxExecutable = "%windir%\Sysnative\wsl.exe $1"
|
2019-01-07 12:56:59 +00:00
|
|
|
endif
|
2016-04-08 11:14:23 +00:00
|
|
|
|
|
|
|
JVM_DEFINES_client := $(patsubst -D%,%, $(filter -D%, $(JVM_CFLAGS)))
|
|
|
|
EXTRACTED_DEFINES_client := $(addprefix -define , $(JVM_DEFINES_client))
|
|
|
|
|
|
|
|
JVM_INCLUDES_client := $(patsubst -I%,%, $(filter -I%, $(JVM_CFLAGS)))
|
|
|
|
EXTRACTED_INCLUDES_client := $(foreach path, $(JVM_INCLUDES_client), -absoluteInclude $(call FixPath, $(path)))
|
|
|
|
|
|
|
|
# Hand-code variant-specific arguments, based on the fact that we use
|
|
|
|
# client for general arguments. Not optimal but other solutions require
|
|
|
|
# major changes in ProjectCreator.
|
|
|
|
ADDITIONAL_VARIANT_ARGS := \
|
|
|
|
-define_server COMPILER2 \
|
|
|
|
-ignorePath_client adfiles \
|
|
|
|
-ignorePath_client c2_ \
|
|
|
|
-ignorePath_client runtime_ \
|
|
|
|
-ignorePath_client libadt \
|
|
|
|
-ignorePath_client opto \
|
|
|
|
#
|
|
|
|
|
|
|
|
IGNORED_PLATFORMS_ARGS := \
|
|
|
|
-ignorePath aarch64 \
|
|
|
|
-ignorePath aix \
|
|
|
|
-ignorePath arm \
|
|
|
|
-ignorePath bsd \
|
|
|
|
-ignorePath linux \
|
|
|
|
-ignorePath posix \
|
|
|
|
-ignorePath ppc \
|
|
|
|
-ignorePath x86_32 \
|
|
|
|
-ignorePath zero \
|
|
|
|
#
|
|
|
|
|
2024-09-03 15:31:09 +00:00
|
|
|
##############################################################################
|
2016-04-08 11:14:23 +00:00
|
|
|
# Build the ProjectCreator java tool.
|
|
|
|
|
2024-08-22 10:31:34 +00:00
|
|
|
TOOLS_OUTPUTDIR := $(MAKESUPPORT_OUTPUTDIR)/ide/visualstudio
|
2016-04-08 11:14:23 +00:00
|
|
|
|
|
|
|
$(eval $(call SetupJavaCompilation, BUILD_PROJECT_CREATOR, \
|
2020-04-29 06:49:17 +00:00
|
|
|
TARGET_RELEASE := $(TARGET_RELEASE_BOOTJDK), \
|
|
|
|
DISABLED_WARNINGS := auxiliaryclass deprecation rawtypes unchecked cast options, \
|
2020-05-19 13:49:46 +00:00
|
|
|
SRC := $(TOPDIR)/make/ide/visualstudio/hotspot/src/classes, \
|
2016-04-08 11:14:23 +00:00
|
|
|
BIN := $(TOOLS_OUTPUTDIR), \
|
2020-04-29 06:49:17 +00:00
|
|
|
JAVAC_FLAGS := -XDstringConcat=inline, \
|
2016-04-08 11:14:23 +00:00
|
|
|
))
|
|
|
|
|
|
|
|
TARGETS += $(BUILD_PROJECT_CREATOR)
|
|
|
|
|
|
|
|
# Run the ProjectCreator tool
|
|
|
|
PROJECT_CREATOR_TOOL := $(JAVA_SMALL) -cp $(TOOLS_OUTPUTDIR) build.tools.projectcreator.ProjectCreator
|
|
|
|
|
2017-09-25 08:32:00 +00:00
|
|
|
IDE_OUTPUTDIR := $(OUTPUTDIR)/ide/hotspot-visualstudio
|
2016-04-08 11:14:23 +00:00
|
|
|
|
|
|
|
VCPROJ_FILE := $(IDE_OUTPUTDIR)/jvm.vcxproj
|
|
|
|
|
|
|
|
PROJECT_CREATOR_CLASS := build.tools.projectcreator.WinGammaPlatformVC10
|
|
|
|
|
|
|
|
# We hard-code gensrc dir to server (since this includes adfiles)
|
|
|
|
PROJECT_CREATOR_ARGS := \
|
2017-09-15 16:18:00 +00:00
|
|
|
-sourceBase $(call FixPath, $(TOPDIR)/src) \
|
|
|
|
-startAt hotspot \
|
|
|
|
-relativeSrcInclude hotspot \
|
2016-04-08 11:14:23 +00:00
|
|
|
-hidePath .hg \
|
|
|
|
-hidePath .jcheck \
|
|
|
|
-hidePath jdk.hotspot.agent \
|
2017-02-16 23:46:09 +00:00
|
|
|
-hidePath jdk.internal.vm.ci \
|
2016-04-08 11:14:23 +00:00
|
|
|
-hidePath jdk.jfr \
|
|
|
|
-compiler VC10 \
|
|
|
|
-jdkTargetRoot $(call FixPath, $(JDK_OUTPUTDIR)) \
|
|
|
|
-platformName x64 \
|
|
|
|
-buildBase $(call FixPath, $(IDE_OUTPUTDIR)/vs-output) \
|
|
|
|
-buildSpace $(call FixPath, $(IDE_OUTPUTDIR)) \
|
2019-01-07 12:56:59 +00:00
|
|
|
-makeBinary $(call FixLinuxExecutable, $(MAKE)) \
|
2017-01-04 15:57:26 +00:00
|
|
|
-makeOutput $(call FixPath, $(JDK_OUTPUTDIR)/bin/server) \
|
2016-04-08 11:14:23 +00:00
|
|
|
-absoluteInclude $(call FixPath, $(HOTSPOT_OUTPUTDIR)/variant-server/gensrc) \
|
|
|
|
-absoluteSrcInclude $(call FixPath, $(HOTSPOT_OUTPUTDIR)/variant-server/gensrc) \
|
|
|
|
$(EXTRACTED_DEFINES_client) \
|
|
|
|
$(EXTRACTED_INCLUDES_client) \
|
|
|
|
$(ADDITIONAL_VARIANT_ARGS) \
|
|
|
|
$(IGNORED_PLATFORMS_ARGS) \
|
|
|
|
#
|
|
|
|
|
|
|
|
VCPROJ_VARDEPS := $(PROJECT_CREATOR_CLASS) $(PROJECT_CREATOR_ARGS)
|
|
|
|
VCPROJ_VARDEPS_FILE := $(call DependOnVariable, VCPROJ_VARDEPS, \
|
|
|
|
$(VCPROJ_FILE).vardeps)
|
|
|
|
|
2019-03-05 10:07:19 +00:00
|
|
|
$(eval $(call SetupExecute, vcproj_file, \
|
|
|
|
INFO := Generating Visual Studio project file, \
|
|
|
|
DEPS := $(BUILD_PROJECT_CREATOR) $(VCPROJ_VARDEPS_FILE), \
|
|
|
|
OUTPUT_FILE := $(VCPROJ_FILE), \
|
|
|
|
COMMAND := $(PROJECT_CREATOR_TOOL) $(PROJECT_CREATOR_CLASS) \
|
2019-03-11 12:09:14 +00:00
|
|
|
$(PROJECT_CREATOR_ARGS) -projectFileName $(call FixPath, $(VCPROJ_FILE)) \
|
2019-03-05 10:07:19 +00:00
|
|
|
$(LOG_INFO), \
|
|
|
|
))
|
|
|
|
|
|
|
|
TARGETS += $(vcproj_file_TARGET)
|
2016-04-08 11:14:23 +00:00
|
|
|
|
|
|
|
all: $(TARGETS)
|
|
|
|
|
|
|
|
else
|
|
|
|
all:
|
|
|
|
$(info Hotspot Visual Studio generation only supported on Windows)
|
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: all
|