make/CompileInterimLangtools.gmk
author egahlin
Fri, 29 Nov 2019 17:31:01 +0100
changeset 59327 2c3578aa0bdf
parent 58713 ad69fd32778e
permissions -rw-r--r--
8234671: JFR api/consumer/recordingstream/TestStart.java failed due to timeout at testStartTwice() Reviewed-by: mgronlun
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14270
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     1
#
44457
0cca46f400f7 8177484: The old standard doclet should be deprecated for removal.
jjg
parents: 41448
diff changeset
     2
# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
14270
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     4
#
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    10
#
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    15
# accompanied this code).
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    16
#
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    20
#
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    23
# questions.
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    24
#
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    25
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    26
# This must be the first rule
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    27
default: all
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    28
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    29
include $(SPEC)
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    30
include MakeBase.gmk
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    31
include JavaCompilation.gmk
27579
d1a63c99cdd5 8049367: Modular Run-Time Images
chegar
parents: 26276
diff changeset
    32
include SetupJavaCompilers.gmk
47364
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    33
include Modules.gmk
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    34
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    35
################################################################################
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    36
# Generate interim versions of the module-info.java files for the interim
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    37
# langtools modules. Each interim module has ".interim" added as suffix to the
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    38
# original module name.
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    39
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    40
INTERIM_MODULEINFO_PATTERN := \
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    41
    $(foreach m, $(INTERIM_LANGTOOLS_BASE_MODULES), -e 's/$m\([,; ]\)/$m.interim\1/g')
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    42
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    43
$(BUILDTOOLS_OUTPUTDIR)/gensrc/%.interim/module-info.java: \
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    44
    $(TOPDIR)/src/%/share/classes/module-info.java
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    45
	$(call LogInfo, Generating module-info.java for $*.interim)
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    46
	$(call MakeDir, $(@D))
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    47
	$(SED) $(INTERIM_MODULEINFO_PATTERN) $< > $@
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    48
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    49
TARGETS += $(patsubst %, $(BUILDTOOLS_OUTPUTDIR)/gensrc/%/module-info.java, \
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    50
    $(INTERIM_LANGTOOLS_MODULES))
14270
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    51
58713
ad69fd32778e 8226585: Improve javac messages for using a preview API
jlahoda
parents: 48068
diff changeset
    52
$(eval $(call SetupCopyFiles, COPY_PREVIEW_FEATURES, \
ad69fd32778e 8226585: Improve javac messages for using a preview API
jlahoda
parents: 48068
diff changeset
    53
    FILES := $(TOPDIR)/src/java.base/share/classes/jdk/internal/PreviewFeature.java, \
ad69fd32778e 8226585: Improve javac messages for using a preview API
jlahoda
parents: 48068
diff changeset
    54
    DEST := $(BUILDTOOLS_OUTPUTDIR)/gensrc/java.base.interim/jdk/internal/, \
ad69fd32778e 8226585: Improve javac messages for using a preview API
jlahoda
parents: 48068
diff changeset
    55
))
ad69fd32778e 8226585: Improve javac messages for using a preview API
jlahoda
parents: 48068
diff changeset
    56
ad69fd32778e 8226585: Improve javac messages for using a preview API
jlahoda
parents: 48068
diff changeset
    57
TARGETS += $(COPY_PREVIEW_FEATURES)
ad69fd32778e 8226585: Improve javac messages for using a preview API
jlahoda
parents: 48068
diff changeset
    58
27579
d1a63c99cdd5 8049367: Modular Run-Time Images
chegar
parents: 26276
diff changeset
    59
################################################################################
40596
43b19b36e8e6 8145464: implement deprecation static analysis tool
smarks
parents: 36526
diff changeset
    60
# Setup the rules to build interim langtools, which is compiled by the boot
47364
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    61
# javac and can be run on the boot jdk. This will be used to compile the rest of
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    62
# the product. Each module is compiled separately because a multi module setup
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    63
# would require the source files to be copied into directories named after the
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    64
# actual interim modules.
14270
520b95b5d99d 8000992: Update new build-infra makefiles
ohair
parents:
diff changeset
    65
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    66
# Param 1 - Name of module to compile
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    67
define SetupInterimModule
47364
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    68
  $$(eval $$(call SetupJavaCompilation, BUILD_$1.interim, \
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    69
      SETUP := BOOT_JAVAC, \
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    70
      DISABLE_SJAVAC := true, \
47364
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    71
      SRC := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim \
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    72
          $$(wildcard $(SUPPORT_OUTPUTDIR)/gensrc/$1) \
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    73
          $(TOPDIR)/src/$1/share/classes, \
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    74
      EXCLUDES := sun, \
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    75
      EXCLUDE_FILES := $(TOPDIR)/src/$1/share/classes/module-info.java \
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    76
          Standard.java, \
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    77
      EXTRA_FILES := $(BUILDTOOLS_OUTPUTDIR)/gensrc/$1.interim/module-info.java, \
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    78
      COPY := .gif .png .xml .css .js javax.tools.JavaCompilerTool, \
48068
7c08e9f96916 8191439: Race in building jdk.rmic.interim
erikj
parents: 47364
diff changeset
    79
      BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules/$1.interim, \
7c08e9f96916 8191439: Race in building jdk.rmic.interim
erikj
parents: 47364
diff changeset
    80
      ADD_JAVAC_FLAGS := --module-path $(BUILDTOOLS_OUTPUTDIR)/interim_langtools_modules \
47364
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    81
          $$(INTERIM_LANGTOOLS_ADD_EXPORTS) \
58713
ad69fd32778e 8226585: Improve javac messages for using a preview API
jlahoda
parents: 48068
diff changeset
    82
          --patch-module java.base=$(BUILDTOOLS_OUTPUTDIR)/gensrc/java.base.interim \
ad69fd32778e 8226585: Improve javac messages for using a preview API
jlahoda
parents: 48068
diff changeset
    83
          --add-exports java.base/jdk.internal=jdk.compiler.interim \
47364
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    84
          -Xlint:-module, \
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    85
  ))
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    86
47364
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    87
  $1_DEPS_INTERIM := $$(addsuffix .interim, $$(filter \
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    88
      $$(INTERIM_LANGTOOLS_BASE_MODULES), $$(call FindTransitiveDepsForModule, $1)))
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    89
58713
ad69fd32778e 8226585: Improve javac messages for using a preview API
jlahoda
parents: 48068
diff changeset
    90
  $$(BUILD_$1.interim): $$(foreach d, $$($1_DEPS_INTERIM), $$(BUILD_$$d)) $(COPY_PREVIEW_FEATURES)
47364
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    91
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    92
  TARGETS += $$(BUILD_$1.interim)
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    93
endef
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    94
47364
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    95
$(foreach m, $(INTERIM_LANGTOOLS_BASE_MODULES), \
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    96
  $(eval $(call SetupInterimModule,$m)) \
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    97
)
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    98
6b3389375f31 8189094: Change required boot jdk to JDK 9
erikj
parents: 47217
diff changeset
    99
################################################################################
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   100
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
   101
all: $(TARGETS)