make/hotspot/gensrc/GensrcAdlc.gmk
author ihse
Wed, 23 Oct 2019 09:48:46 +0200
changeset 58747 c6fd655677ec
parent 54490 bf07e140c49c
child 58834 f78e7ce060b0
permissions -rw-r--r--
8232770: Enable more warnings on solaris studio Reviewed-by: erikj
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
     1
#
53542
5c80e6994d8a 8217856: ZGC: Break out C2 matching rules into separate AD file
pliden
parents: 52925
diff changeset
     2
# Copyright (c) 2013, 2019, 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
47314
743814386712 8188814: Simplify IncludeCustomExtension
ihse
parents: 47217
diff changeset
    26
$(eval $(call IncludeCustomExtension, hotspot/gensrc/GensrcAdlc.gmk))
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    27
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    28
ifeq ($(call check-jvm-feature, compiler2), true)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    29
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    30
  ADLC_SUPPORT_DIR := $(JVM_SUPPORT_DIR)/adlc
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    31
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    32
  ##############################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    33
  # Build the ad compiler (the adlc build tool)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    34
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    35
  # Flags depending on the build platform/tool chain
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    36
  # NOTE: No optimization or debug flags set here
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 53542
diff changeset
    37
  ifeq ($(call isBuildOs, linux), true)
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    38
    ADLC_CFLAGS := -fno-exceptions -DLINUX
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 53542
diff changeset
    39
  else ifeq ($(call isBuildOs, solaris), true)
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    40
    ADLC_LDFLAGS := -m64
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    41
    ADLC_CFLAGS := -m64
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    42
    ADLC_CFLAGS_WARNINGS := +w
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 53542
diff changeset
    43
  else ifeq ($(call isBuildOs, aix), true)
37469
ac811846846c 8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents: 37437
diff changeset
    44
    ADLC_LDFLAGS := -q64
ac811846846c 8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents: 37437
diff changeset
    45
    ADLC_CFLAGS := -qnortti -qeh -q64 -DAIX
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 53542
diff changeset
    46
  else ifeq ($(call isBuildOs, windows), true)
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    47
    ADLC_LDFLAGS := -nologo
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    48
    ADLC_CFLAGS := -nologo -EHsc
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    49
    # NOTE: The old build also have -D_CRT_SECURE_NO_DEPRECATE but it doesn't
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    50
    # seem needed any more.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    51
    ADLC_CFLAGS_WARNINGS := -W3 -D_CRT_SECURE_NO_WARNINGS
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    52
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    53
39963
5921b7f27d63 8156980: Hotspot build doesn't have -std=gnu++98 gcc option
andrew
parents: 38097
diff changeset
    54
  # Set the C++ standard if supported
49120
c04d813140dc 8198724: Refactor FLAGS handling in configure
ihse
parents: 49070
diff changeset
    55
  ADLC_CFLAGS += $(ADLC_CXXFLAG)
49070
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 47314
diff changeset
    56
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    57
  # NOTE: The old build didn't set -DASSERT for windows but it doesn't seem to
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    58
  # hurt.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    59
  ADLC_CFLAGS += -DASSERT
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    60
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    61
  ADLC_CFLAGS += -D$(HOTSPOT_TARGET_CPU_DEFINE)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    62
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    63
  ADLC_CFLAGS += -I$(TOPDIR)/src/hotspot/share
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    64
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    65
  $(eval $(call SetupNativeCompilation, BUILD_ADLC, \
49070
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 47314
diff changeset
    66
      NAME := adlc, \
d7859531621b 8198751: Refactor SetupNativeCompilation to take NAME and TYPE
ihse
parents: 47314
diff changeset
    67
      TYPE := EXECUTABLE, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    68
      TOOLCHAIN := TOOLCHAIN_BUILD_LINK_CXX, \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    69
      SRC := $(TOPDIR)/src/hotspot/share/adlc, \
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
    70
      EXTRA_FILES := $(TOPDIR)/src/hotspot/share/opto/opcodes.cpp, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    71
      CFLAGS := $(ADLC_CFLAGS) $(ADLC_CFLAGS_WARNINGS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    72
      LDFLAGS := $(ADLC_LDFLAGS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    73
      LIBS := $(ADLC_LIBS), \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    74
      OBJECT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/adlc/objs, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    75
      OUTPUT_DIR := $(JVM_VARIANT_OUTPUTDIR)/tools/adlc, \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    76
      DEBUG_SYMBOLS := false, \
46630
75aa3e39d02c 8182299: Enable disabled clang warnings, build on OSX 10 + Xcode 8
jwilhelm
parents: 42664
diff changeset
    77
      DISABLED_WARNINGS_clang := tautological-compare, \
54490
bf07e140c49c 8221851: Use of THIS_FILE in hotspot invalidates precompiled header on Linux/GCC
erikj
parents: 53997
diff changeset
    78
      DEFINE_THIS_FILE := false, \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    79
  ))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    80
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    81
  ADLC_TOOL := $(BUILD_ADLC_TARGET)
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
  # Transform the ad source files into C++ source files using adlc
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    85
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    86
  # Setup flags for the adlc build tool (ADLCFLAGS).
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    87
  ADLCFLAGS += -q -T
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    88
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    89
  # ADLC flags depending on target OS
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 53542
diff changeset
    90
  ifeq ($(call isTargetOs, linux), true)
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    91
    ADLCFLAGS += -DLINUX=1 -D_GNU_SOURCE=1
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 53542
diff changeset
    92
  else ifeq ($(call isTargetOs, solaris), true)
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    93
    ADLCFLAGS += -DSOLARIS=1 -DSPARC_WORKS=1
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 53542
diff changeset
    94
  else ifeq ($(call isTargetOs, aix), true)
37469
ac811846846c 8154087: Fix AIX and Linux/ppc64le after the integration of the new hotspot build
simonis
parents: 37437
diff changeset
    95
    ADLCFLAGS += -DAIX=1
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 53542
diff changeset
    96
  else ifeq ($(call isTargetOs, macosx), true)
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    97
    ADLCFLAGS += -D_ALLBSD_SOURCE=1 -D_GNU_SOURCE=1
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    98
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
    99
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 53542
diff changeset
   100
  ifeq ($(call isTargetOs, windows), false)
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   101
    # NOTE: Windows adlc flags was different in the old build. Is this really
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   102
    # correct?
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   103
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   104
    # -g makes #line directives in the generated C++ files.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   105
    ADLCFLAGS += -g
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   106
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   107
    ADLCFLAGS += -D$(HOTSPOT_TARGET_CPU_DEFINE)=1
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   108
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   109
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   110
  # This generates checks in the generated C++ files that _LP64 is correctly
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   111
  # (un)defined when compiling them.
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 53542
diff changeset
   112
  ifeq ($(call isTargetCpuBits, 64), true)
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   113
    ADLCFLAGS += -D_LP64=1
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   114
  else
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   115
    ADLCFLAGS += -U_LP64
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   116
  endif
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   117
42664
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 40010
diff changeset
   118
  ifeq ($(HOTSPOT_TARGET_CPU_ARCH), arm)
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 40010
diff changeset
   119
    ADLCFLAGS += -DARM=1
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 40010
diff changeset
   120
  endif
29142a56c193 8168503: JEP 297: Unified arm32/arm64 Port
bobv
parents: 40010
diff changeset
   121
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   122
  ##############################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   123
  # Concatenate all ad source files into a single file, which will be fed to
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   124
  # adlc. Also include a #line directive at the start of every included file
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   125
  # (after the initial header block), stating the original source file name.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   126
  #
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   127
  # Normally, debugging is done directly on the ad_<arch>*.cpp files, but the
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   128
  # #line directives in those files will be pointing back to <arch>.ad.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   129
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   130
  # AD_SRC_ROOTS might have been added to by a custom extension
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   131
  AD_SRC_ROOTS += $(TOPDIR)/src/hotspot
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   132
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   133
  AD_SRC_FILES := $(call uniq, $(wildcard $(foreach d, $(AD_SRC_ROOTS), \
47217
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   134
      $d/cpu/$(HOTSPOT_TARGET_CPU_ARCH)/$(HOTSPOT_TARGET_CPU).ad \
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   135
      $d/cpu/$(HOTSPOT_TARGET_CPU_ARCH)/$(HOTSPOT_TARGET_CPU_ARCH).ad \
72e3ae9a25eb 8187444: Forest Consolidation: Make build work
erikj
parents: 47216
diff changeset
   136
      $d/os_cpu/$(HOTSPOT_TARGET_OS)_$(HOTSPOT_TARGET_CPU_ARCH)/$(HOTSPOT_TARGET_OS)_$(HOTSPOT_TARGET_CPU_ARCH).ad \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   137
    )))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   138
52925
9c18c9d839d3 8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents: 49120
diff changeset
   139
  ifeq ($(call check-jvm-feature, shenandoahgc), true)
9c18c9d839d3 8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents: 49120
diff changeset
   140
    AD_SRC_FILES += $(call uniq, $(wildcard $(foreach d, $(AD_SRC_ROOTS), \
9c18c9d839d3 8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents: 49120
diff changeset
   141
        $d/cpu/$(HOTSPOT_TARGET_CPU_ARCH)/gc/shenandoah/shenandoah_$(HOTSPOT_TARGET_CPU).ad \
9c18c9d839d3 8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents: 49120
diff changeset
   142
      )))
9c18c9d839d3 8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents: 49120
diff changeset
   143
  endif
9c18c9d839d3 8214259: Implementation: JEP 189: Shenandoah: A Low-Pause-Time Garbage Collector (Experimental)
rkennke
parents: 49120
diff changeset
   144
53542
5c80e6994d8a 8217856: ZGC: Break out C2 matching rules into separate AD file
pliden
parents: 52925
diff changeset
   145
  ifeq ($(call check-jvm-feature, zgc), true)
5c80e6994d8a 8217856: ZGC: Break out C2 matching rules into separate AD file
pliden
parents: 52925
diff changeset
   146
    AD_SRC_FILES += $(call uniq, $(wildcard $(foreach d, $(AD_SRC_ROOTS), \
5c80e6994d8a 8217856: ZGC: Break out C2 matching rules into separate AD file
pliden
parents: 52925
diff changeset
   147
        $d/cpu/$(HOTSPOT_TARGET_CPU_ARCH)/gc/z/z_$(HOTSPOT_TARGET_CPU).ad \
5c80e6994d8a 8217856: ZGC: Break out C2 matching rules into separate AD file
pliden
parents: 52925
diff changeset
   148
      )))
5c80e6994d8a 8217856: ZGC: Break out C2 matching rules into separate AD file
pliden
parents: 52925
diff changeset
   149
  endif
5c80e6994d8a 8217856: ZGC: Break out C2 matching rules into separate AD file
pliden
parents: 52925
diff changeset
   150
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   151
  SINGLE_AD_SRCFILE := $(ADLC_SUPPORT_DIR)/all-ad-src.ad
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   152
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   153
  INSERT_FILENAME_AWK_SCRIPT := \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   154
      '{ \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   155
         if (CUR_FN != FILENAME) { CUR_FN=FILENAME; NR_BASE=NR-1; need_lineno=1 } \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   156
         if (need_lineno && $$0 !~ /\/\//) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   157
           { print "\n\n\#line " (NR-NR_BASE) " \"" FILENAME "\""; need_lineno=0 }; \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   158
         print \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   159
       }'
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   160
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   161
  $(SINGLE_AD_SRCFILE): $(AD_SRC_FILES)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   162
	$(call LogInfo, Preprocessing adlc files $(^F))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   163
	$(call MakeDir, $(@D))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   164
	$(NAWK) $(INSERT_FILENAME_AWK_SCRIPT) $^ > $@
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   165
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   166
  ##############################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   167
  # Run the adlc tool on the single concatenated ad source file, and store the
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   168
  # output in support/adlc for further processing.
53995
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 53683
diff changeset
   169
  $(eval $(call SetupExecute, adlc_run, \
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 53683
diff changeset
   170
      INFO := Generating adlc files, \
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 53683
diff changeset
   171
      DEPS := $(BUILD_ADLC) $(SINGLE_AD_SRCFILE), \
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 53683
diff changeset
   172
      OUTPUT_DIR := $(ADLC_SUPPORT_DIR), \
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 53683
diff changeset
   173
      COMMAND := $(FIXPATH) $(ADLC_TOOL) $(ADLCFLAGS) $(SINGLE_AD_SRCFILE) \
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 53683
diff changeset
   174
          -c$(ADLC_SUPPORT_DIR)/ad_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 53683
diff changeset
   175
          -h$(ADLC_SUPPORT_DIR)/ad_$(HOTSPOT_TARGET_CPU_ARCH).hpp \
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 53683
diff changeset
   176
          -a$(ADLC_SUPPORT_DIR)/dfa_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 53683
diff changeset
   177
          -v$(ADLC_SUPPORT_DIR)/adGlobals_$(HOTSPOT_TARGET_CPU_ARCH).hpp, \
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 53683
diff changeset
   178
  ))
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   179
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   180
  ##############################################################################
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   181
  # Finally copy the generated files from support/adlc into gensrc/adfiles,
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   182
  # and postprocess them by fixing dummy #line directives.
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   183
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   184
  ADLC_GENERATED_FILES := $(addprefix $(JVM_VARIANT_OUTPUTDIR)/gensrc/adfiles/, \
40010
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 39963
diff changeset
   185
      ad_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 39963
diff changeset
   186
      ad_$(HOTSPOT_TARGET_CPU_ARCH).hpp \
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 39963
diff changeset
   187
      ad_$(HOTSPOT_TARGET_CPU_ARCH)_clone.cpp \
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 39963
diff changeset
   188
      ad_$(HOTSPOT_TARGET_CPU_ARCH)_expand.cpp \
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 39963
diff changeset
   189
      ad_$(HOTSPOT_TARGET_CPU_ARCH)_format.cpp \
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 39963
diff changeset
   190
      ad_$(HOTSPOT_TARGET_CPU_ARCH)_gen.cpp \
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 39963
diff changeset
   191
      ad_$(HOTSPOT_TARGET_CPU_ARCH)_misc.cpp \
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 39963
diff changeset
   192
      ad_$(HOTSPOT_TARGET_CPU_ARCH)_peephole.cpp \
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 39963
diff changeset
   193
      ad_$(HOTSPOT_TARGET_CPU_ARCH)_pipeline.cpp \
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 39963
diff changeset
   194
      adGlobals_$(HOTSPOT_TARGET_CPU_ARCH).hpp \
e32d5e545789 8161258: Simplify including platform files.
goetz
parents: 39963
diff changeset
   195
      dfa_$(HOTSPOT_TARGET_CPU_ARCH).cpp \
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   196
  )
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   197
53995
ecc2bcc3beb0 8219971: Introduce SetupExecute in build system
ihse
parents: 53683
diff changeset
   198
  $(JVM_VARIANT_OUTPUTDIR)/gensrc/adfiles/%: $(adlc_run_TARGET)
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   199
	$(call LogInfo, Postprocessing adlc file $*)
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   200
	$(call MakeDir, $(@D))
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   201
	$(NAWK) \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   202
	    'BEGIN { print "#line 1 \"$*\""; } \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   203
	     /^#line 999999$$/ {print "#line " (NR+1) " \"$*\""; next} \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   204
	     {print}' \
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   205
	    < $(ADLC_SUPPORT_DIR)/$* > $@
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   206
53997
4ae746de6b86 8220155: JDK-8219971 broke hotspot build
ihse
parents: 53995
diff changeset
   207
  TARGETS += $(ADLC_GENERATED_FILES)
37437
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   208
f824aabc7af8 8152666: The new Hotspot Build System
erikj
parents:
diff changeset
   209
endif