make/common/JdkNativeCompilation.gmk
author ihse
Thu, 03 May 2018 23:33:28 +0200
branchihse-jdk-library-branch
changeset 56517 cb0f21f5f307
parent 56511 2b67c11c0db6
child 56519 1b154e6d8bb2
permissions -rw-r--r--
Cleaning up src format.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
49244
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
     1
#
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
     2
# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
     4
#
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    10
#
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    15
# accompanied this code).
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    16
#
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    20
#
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    23
# questions.
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    24
#
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    25
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    26
ifndef _JDK_NATIVE_COMPILATION_GMK
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    27
_JDK_NATIVE_COMPILATION_GMK := 1
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    28
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    29
ifeq ($(_MAKEBASE_GMK), )
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    30
  $(error You must include MakeBase.gmk prior to including JdkNativeCompilation.gmk)
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    31
endif
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    32
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    33
include NativeCompilation.gmk
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    34
56433
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
    35
# Hook to include the corresponding custom file, if present.
56456
7c2619ac7f60 Proper fix for closed source.
ihse
parents: 56454
diff changeset
    36
$(eval $(call IncludeCustomExtension, common/JdkNativeCompilation.gmk))
56433
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
    37
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
    38
FindSrcDirsForLib += \
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
    39
  $(call uniq, $(wildcard \
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
    40
      $(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/lib$(strip $2) \
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
    41
      $(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/native/lib$(strip $2) \
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
    42
      $(TOPDIR)/src/$(strip $1)/share/native/lib$(strip $2)))
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
    43
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
    44
FindSrcDirsForComponent += \
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
    45
  $(call uniq, $(wildcard \
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
    46
      $(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/$(strip $2) \
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
    47
      $(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/native/$(strip $2) \
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
    48
      $(TOPDIR)/src/$(strip $1)/share/native/$(strip $2)))
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
    49
56454
82c3ae69914f Cleaning up HEADER_FLAGS.
ihse
parents: 56433
diff changeset
    50
FindHeaderDirForModule = \
82c3ae69914f Cleaning up HEADER_FLAGS.
ihse
parents: 56433
diff changeset
    51
  $(wildcard $(SUPPORT_OUTPUTDIR)/headers/$(strip $1))
82c3ae69914f Cleaning up HEADER_FLAGS.
ihse
parents: 56433
diff changeset
    52
49244
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    53
# Setup make rules for creating a native shared library with suitable defaults
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    54
# for the OpenJDK project.
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    55
#
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    56
# Parameter 1 is the name of the rule. This name is used as variable prefix,
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    57
# and the targets generated are listed in a variable by that name.
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    58
#
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    59
# Remaining parameters are named arguments. These are all passed on to
56433
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
    60
# SetupNativeCompilation, except for
49244
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    61
#   EXTRA_RC_FLAGS -- additional RC_FLAGS to append.
56511
2b67c11c0db6 Introduce EXTRA_SRC and supply headers as dirs.
ihse
parents: 56488
diff changeset
    62
#   EXTRA_HEADER_DIRS -- additional directories to look for headers in
2b67c11c0db6 Introduce EXTRA_SRC and supply headers as dirs.
ihse
parents: 56488
diff changeset
    63
#   EXTRA_SRC -- additional directories to look for source in
49244
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    64
SetupJdkLibrary = $(NamedParamsMacroTemplate)
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    65
define SetupJdkLibraryBody
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    66
  ifeq ($$($1_OUTPUT_DIR), )
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    67
    $1_OUTPUT_DIR := $$(call FindLibDirForModule, $$(MODULE))
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    68
  endif
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    69
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    70
  ifeq ($$($1_OBJECT_DIR), )
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    71
    $1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/lib$$($1_NAME)
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    72
  endif
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    73
56433
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
    74
  ifeq ($$($1_SRC), )
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
    75
    $1_SRC := $$(call FindSrcDirsForLib, $$(MODULE), $$($1_NAME))
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
    76
  endif
56511
2b67c11c0db6 Introduce EXTRA_SRC and supply headers as dirs.
ihse
parents: 56488
diff changeset
    77
  $1_PRE_SRC := $$($1_SRC)
2b67c11c0db6 Introduce EXTRA_SRC and supply headers as dirs.
ihse
parents: 56488
diff changeset
    78
  ifneq ($$($1_EXTRA_SRC), )
2b67c11c0db6 Introduce EXTRA_SRC and supply headers as dirs.
ihse
parents: 56488
diff changeset
    79
    $1_SRC += $$($1_EXTRA_SRC)
2b67c11c0db6 Introduce EXTRA_SRC and supply headers as dirs.
ihse
parents: 56488
diff changeset
    80
  endif
56433
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
    81
56517
cb0f21f5f307 Cleaning up src format.
ihse
parents: 56511
diff changeset
    82
  ifneq ($$($1_EXCLUDE_SRC_PATTERNS), )
cb0f21f5f307 Cleaning up src format.
ihse
parents: 56511
diff changeset
    83
    $1_EXCLUDE_SRC := $$(call containing, $$($1_EXCLUDE_SRC_PATTERNS), $$($1_SRC))
cb0f21f5f307 Cleaning up src format.
ihse
parents: 56511
diff changeset
    84
    $1_SRC := $$(filter-out $$($1_EXCLUDE_SRC), $$($1_SRC))
cb0f21f5f307 Cleaning up src format.
ihse
parents: 56511
diff changeset
    85
  endif
cb0f21f5f307 Cleaning up src format.
ihse
parents: 56511
diff changeset
    86
49244
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    87
  ifeq ($$($1_VERSIONINFO_RESOURCE), )
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    88
    $1_VERSIONINFO_RESOURCE := $$(GLOBAL_VERSION_INFO_RESOURCE)
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    89
  else ifeq ($$($1_VERSIONINFO_RESOURCE), DISABLE)
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    90
    $1_VERSIONINFO_RESOURCE :=
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    91
  endif
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    92
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    93
  ifeq ($$($1_RC_FLAGS), )
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    94
    $1_RC_FLAGS :=  $(RC_FLAGS) \
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    95
        -D "JDK_FNAME=$$($1_NAME).dll" \
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    96
        -D "JDK_INTERNAL_NAME=$$($1_NAME)" \
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    97
        -D "JDK_FTYPE=0x2L"
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    98
  else ifeq ($$($1_RC_FLAGS), DISABLE)
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
    99
    $1_RC_FLAGS :=
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   100
  endif
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   101
56433
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
   102
  ifneq ($$($1_HEADERS_FROM_SRC), false)
56511
2b67c11c0db6 Introduce EXTRA_SRC and supply headers as dirs.
ihse
parents: 56488
diff changeset
   103
    $1_SRC_HEADER_FLAGS := $$(foreach dir, $$(wildcard $$($1_SRC) $$($1_EXTRA_SRC) \
2b67c11c0db6 Introduce EXTRA_SRC and supply headers as dirs.
ihse
parents: 56488
diff changeset
   104
        $$(call FindHeaderDirForModule, $$(MODULE))), -I$$(dir))
56433
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
   105
  endif
56511
2b67c11c0db6 Introduce EXTRA_SRC and supply headers as dirs.
ihse
parents: 56488
diff changeset
   106
  ifneq ($$($1_EXTRA_HEADER_DIRS), )
2b67c11c0db6 Introduce EXTRA_SRC and supply headers as dirs.
ihse
parents: 56488
diff changeset
   107
    $1_EXTRA_HEADER_FLAGS := $$(foreach dir, $$($1_EXTRA_HEADER_DIRS), -I$$(dir))
2b67c11c0db6 Introduce EXTRA_SRC and supply headers as dirs.
ihse
parents: 56488
diff changeset
   108
  endif
2b67c11c0db6 Introduce EXTRA_SRC and supply headers as dirs.
ihse
parents: 56488
diff changeset
   109
56464
552922083f25 Fix jdk.accessibility.
ihse
parents: 56456
diff changeset
   110
  ifneq ($$($1_CFLAGS), )
56511
2b67c11c0db6 Introduce EXTRA_SRC and supply headers as dirs.
ihse
parents: 56488
diff changeset
   111
    $1_CFLAGS += $$($1_SRC_HEADER_FLAGS) $$($1_EXTRA_HEADER_FLAGS)
56464
552922083f25 Fix jdk.accessibility.
ihse
parents: 56456
diff changeset
   112
  endif
552922083f25 Fix jdk.accessibility.
ihse
parents: 56456
diff changeset
   113
  ifneq ($$($1_CXXFLAGS), )
56511
2b67c11c0db6 Introduce EXTRA_SRC and supply headers as dirs.
ihse
parents: 56488
diff changeset
   114
    $1_CXXFLAGS += $$($1_SRC_HEADER_FLAGS) $$($1_EXTRA_HEADER_FLAGS)
56464
552922083f25 Fix jdk.accessibility.
ihse
parents: 56456
diff changeset
   115
  endif
552922083f25 Fix jdk.accessibility.
ihse
parents: 56456
diff changeset
   116
  ifeq ($$($1_CFLAGS)$$($1_CXXFLAGS), )
56511
2b67c11c0db6 Introduce EXTRA_SRC and supply headers as dirs.
ihse
parents: 56488
diff changeset
   117
    $1_CFLAGS += $$($1_SRC_HEADER_FLAGS) $$($1_EXTRA_HEADER_FLAGS)
56464
552922083f25 Fix jdk.accessibility.
ihse
parents: 56456
diff changeset
   118
  endif
49244
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   119
  $1_RC_FLAGS += $$($1_EXTRA_RC_FLAGS)
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   120
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   121
  # Since we reuse the rule name ($1), all our arguments will pass through.
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   122
  # We lose in transparency, but gain in brevity in this call...
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   123
  $$(eval $$(call SetupNativeCompilation, $1, ))
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   124
endef
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   125
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   126
# Setup make rules for creating a native executable with suitable defaults for
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   127
# the OpenJDK project.
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   128
#
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   129
# Parameter 1 is the name of the rule. This name is used as variable prefix,
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   130
# and the targets generated are listed in a variable by that name.
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   131
#
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   132
# Remaining parameters are named arguments. These are all passed on to
56433
c3cf838aa2da Initial fix for setting SRC automatically + HEADER_FLAGS.
ihse
parents: 56311
diff changeset
   133
# SetupNativeCompilation, except for
49244
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   134
#   EXTRA_RC_FLAGS -- additional RC_FLAGS to append.
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   135
SetupJdkExecutable = $(NamedParamsMacroTemplate)
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   136
define SetupJdkExecutableBody
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   137
  $1_TYPE := EXECUTABLE
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   138
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   139
  ifeq ($$($1_OUTPUT_DIR), )
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   140
    $1_OUTPUT_DIR := $$(call FindExecutableDirForModule, $$(MODULE))
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   141
  endif
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   142
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   143
  ifeq ($$($1_OBJECT_DIR), )
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   144
    $1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$$($1_NAME)
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   145
  endif
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   146
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   147
  ifeq ($$($1_VERSIONINFO_RESOURCE), )
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   148
    $1_VERSIONINFO_RESOURCE := $$(GLOBAL_VERSION_INFO_RESOURCE)
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   149
  else ifeq ($$($1_VERSIONINFO_RESOURCE), DISABLE)
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   150
    $1_VERSIONINFO_RESOURCE :=
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   151
  endif
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   152
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   153
  ifeq ($$($1_RC_FLAGS), )
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   154
    $1_RC_FLAGS :=  $(RC_FLAGS) \
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   155
        -D "JDK_FNAME=$$($1_NAME).exe" \
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   156
        -D "JDK_INTERNAL_NAME=$$($1_NAME)" \
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   157
        -D "JDK_FTYPE=0x01L"
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   158
  else ifeq ($$($1_RC_FLAGS), DISABLE)
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   159
    $1_RC_FLAGS :=
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   160
  endif
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   161
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   162
  $1_RC_FLAGS += $$($1_EXTRA_RC_FLAGS)
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   163
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   164
  # Since we reuse the rule name ($1), all our arguments will pass through.
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   165
  # We lose in transparency, but gain in brevity in this call...
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   166
  $$(eval $$(call SetupNativeCompilation, $1))
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   167
endef
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   168
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents:
diff changeset
   169
endif # _JDK_NATIVE_COMPILATION_GMK