make/hotspot/ide/CreateVSProject.gmk
author vdeshpande
Fri, 15 Dec 2017 10:44:06 -0800
changeset 48371 291020144f22
parent 47687 fb290fd1f9d4
child 53157 3d60a1696e19
permissions -rw-r--r--
8190934: Regressions on Haswell Xeon due to JDK-8178811 Reviewed-by: neliasso, kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     1
#
43424
5c5d1360b2d3 8168137: import-hotspot build target not removed from hotspot-ide-project
ctornqvi
parents: 38097
diff changeset
     2
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     4
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    10
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    15
# accompanied this code).
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    16
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    20
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    23
# questions.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    24
#
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    25
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    26
# This must be the first rule
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    27
default: all
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    28
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    29
include $(SPEC)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    30
include MakeBase.gmk
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    31
include JavaCompilation.gmk
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    32
include SetupJavaCompilers.gmk
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    33
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    34
ifeq ($(OPENJDK_TARGET_OS), windows)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    35
  # The next part is a bit hacky. We include the CompileJvm.gmk to be
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    36
  # able to extact flags, but we do not wish to execute the rules.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    37
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    38
  # Use client as base for defines and includes
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    39
  JVM_VARIANT=client
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    40
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    41
  include HotspotCommon.gmk
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    42
  include lib/CompileJvm.gmk
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    43
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    44
  # Reset targets so we don't build libjvm.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    45
  TARGETS :=
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    46
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    47
  # Helper macro to convert a unix path to a Windows path, suitable for
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    48
  # inclusion in a command line.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    49
  FixPath = \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    50
    $(strip $(subst \,\\,$(shell $(CYGPATH) -w $1)))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    51
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    52
  JVM_DEFINES_client := $(patsubst -D%,%, $(filter -D%, $(JVM_CFLAGS)))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    53
  EXTRACTED_DEFINES_client := $(addprefix -define , $(JVM_DEFINES_client))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    54
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    55
  JVM_INCLUDES_client := $(patsubst -I%,%, $(filter -I%, $(JVM_CFLAGS)))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    56
  EXTRACTED_INCLUDES_client := $(foreach path, $(JVM_INCLUDES_client), -absoluteInclude $(call FixPath, $(path)))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    57
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    58
  # Hand-code variant-specific arguments, based on the fact that we use
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    59
  # client for general arguments. Not optimal but other solutions require
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    60
  # major changes in ProjectCreator.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    61
  ADDITIONAL_VARIANT_ARGS := \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    62
      -define_server COMPILER2 \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    63
      -ignorePath_client adfiles \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    64
      -ignorePath_client c2_ \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    65
      -ignorePath_client runtime_ \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    66
      -ignorePath_client libadt \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    67
      -ignorePath_client opto \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    68
      #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    69
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    70
  IGNORED_PLATFORMS_ARGS := \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    71
    -ignorePath aarch64 \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    72
    -ignorePath aix \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    73
    -ignorePath arm \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    74
    -ignorePath bsd \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    75
    -ignorePath linux \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    76
    -ignorePath posix \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    77
    -ignorePath ppc \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    78
    -ignorePath solaris \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    79
    -ignorePath sparc \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    80
    -ignorePath x86_32 \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    81
    -ignorePath zero \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    82
      #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    83
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    84
  ################################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    85
  # Build the ProjectCreator java tool.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    86
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    87
  TOOLS_OUTPUTDIR := $(HOTSPOT_OUTPUTDIR)/support/tools_classes
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    88
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    89
  $(eval $(call SetupJavaCompilation, BUILD_PROJECT_CREATOR, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    90
      SETUP := GENERATE_OLDBYTECODE, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    91
      ADD_JAVAC_FLAGS := -Xlint:-auxiliaryclass, \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    92
      SRC := $(TOPDIR)/make/hotspot/src/classes, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    93
      BIN := $(TOOLS_OUTPUTDIR), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    94
  ))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    95
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    96
  TARGETS += $(BUILD_PROJECT_CREATOR)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    97
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    98
  # Run the ProjectCreator tool
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    99
  PROJECT_CREATOR_TOOL := $(JAVA_SMALL) -cp $(TOOLS_OUTPUTDIR) build.tools.projectcreator.ProjectCreator
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   100
47253
92fd0e04e0e1 8187544: Replace BUILD_OUTPUT and OUTPUT_ROOT with OUTPUTDIR
ihse
parents: 47219
diff changeset
   101
  IDE_OUTPUTDIR := $(OUTPUTDIR)/ide/hotspot-visualstudio
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   102
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   103
  VCPROJ_FILE := $(IDE_OUTPUTDIR)/jvm.vcxproj
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   104
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   105
  PROJECT_CREATOR_CLASS := build.tools.projectcreator.WinGammaPlatformVC10
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   106
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   107
  # We hard-code gensrc dir to server (since this includes adfiles)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   108
  PROJECT_CREATOR_ARGS := \
47219
fd36993f7bf5 8187542: Remove superfluous *_TOPDIR variables
ihse
parents: 47217
diff changeset
   109
      -sourceBase $(call FixPath, $(TOPDIR)/src) \
fd36993f7bf5 8187542: Remove superfluous *_TOPDIR variables
ihse
parents: 47217
diff changeset
   110
      -startAt hotspot \
fd36993f7bf5 8187542: Remove superfluous *_TOPDIR variables
ihse
parents: 47217
diff changeset
   111
      -relativeSrcInclude hotspot \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   112
      -hidePath .hg \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   113
      -hidePath .jcheck \
43972
1ade39b8381b 8174879: Rename jdk.vm.ci to jdk.internal.vm.ci
kvn
parents: 43424
diff changeset
   114
      -hidePath jdk.aot \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   115
      -hidePath jdk.hotspot.agent \
43972
1ade39b8381b 8174879: Rename jdk.vm.ci to jdk.internal.vm.ci
kvn
parents: 43424
diff changeset
   116
      -hidePath jdk.internal.vm.ci \
1ade39b8381b 8174879: Rename jdk.vm.ci to jdk.internal.vm.ci
kvn
parents: 43424
diff changeset
   117
      -hidePath jdk.internal.vm.compiler \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   118
      -hidePath jdk.jfr \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   119
      -compiler VC10 \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   120
      -jdkTargetRoot $(call FixPath, $(JDK_OUTPUTDIR)) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   121
      -platformName x64 \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   122
      -buildBase $(call FixPath, $(IDE_OUTPUTDIR)/vs-output) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   123
      -buildSpace $(call FixPath, $(IDE_OUTPUTDIR)) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   124
      -makeBinary $(call FixPath, $(MAKE)) \
43424
5c5d1360b2d3 8168137: import-hotspot build target not removed from hotspot-ide-project
ctornqvi
parents: 38097
diff changeset
   125
      -makeOutput $(call FixPath, $(JDK_OUTPUTDIR)/bin/server) \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   126
      -absoluteInclude $(call FixPath, $(HOTSPOT_OUTPUTDIR)/variant-server/gensrc) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   127
      -absoluteSrcInclude $(call FixPath, $(HOTSPOT_OUTPUTDIR)/variant-server/gensrc) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   128
      $(EXTRACTED_DEFINES_client) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   129
      $(EXTRACTED_INCLUDES_client) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   130
      $(ADDITIONAL_VARIANT_ARGS) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   131
      $(IGNORED_PLATFORMS_ARGS) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   132
      #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   133
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   134
  VCPROJ_VARDEPS := $(PROJECT_CREATOR_CLASS) $(PROJECT_CREATOR_ARGS)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   135
  VCPROJ_VARDEPS_FILE := $(call DependOnVariable, VCPROJ_VARDEPS, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   136
    $(VCPROJ_FILE).vardeps)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   137
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   138
  $(VCPROJ_FILE): $(BUILD_PROJECT_CREATOR) $(VCPROJ_VARDEPS_FILE)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   139
	$(call MakeDir, $(@D))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   140
	$(call ExecuteWithLog, $@, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   141
	    $(PROJECT_CREATOR_TOOL) $(PROJECT_CREATOR_CLASS) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   142
	    $(PROJECT_CREATOR_ARGS) -projectFileName $(call FixPath, $@)) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   143
	    $(LOG_INFO)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   144
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   145
  TARGETS += $(VCPROJ_FILE)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   146
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   147
  all: $(TARGETS)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   148
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   149
else
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   150
  all:
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   151
	$(info Hotspot Visual Studio generation only supported on Windows)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   152
endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   153
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   154
.PHONY: all