make/common/JdkNativeCompilation.gmk
author ihse
Wed, 14 Mar 2018 23:15:29 +0100
branchihse-jdk-library-branch
changeset 56309 a7655cb387f9
parent 56308 8724d985c980
child 56311 e05b4241302b
permissions -rw-r--r--
Really fix windows RC problem.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
56287
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
     1
#
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
     2
# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
     4
#
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    10
#
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    15
# accompanied this code).
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    16
#
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    20
#
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    23
# questions.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    24
#
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    25
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    26
ifndef _JDK_NATIVE_COMPILATION_GMK
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    27
_JDK_NATIVE_COMPILATION_GMK := 1
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    28
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    29
ifeq ($(_MAKEBASE_GMK), )
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    30
  $(error You must include MakeBase.gmk prior to including JdkNativeCompilation.gmk)
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    31
endif
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    32
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    33
include NativeCompilation.gmk
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    34
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    35
# Setup make rules for creating a native shared library with suitable defaults
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    36
# for the OpenJDK project.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    37
#
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    38
# Parameter 1 is the name of the rule. This name is used as variable prefix,
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    39
# and the targets generated are listed in a variable by that name.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    40
#
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    41
# Remaining parameters are named arguments. These include:
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    42
#   NAME The base name for the resulting binary, excluding decorations (like *.exe)
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    43
#   TYPE Type of binary (EXECUTABLE, LIBRARY or STATIC_LIBRARY). Default is LIBRARY.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    44
#   SUFFIX Override the default suffix for the output file
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    45
#   TOOLCHAIN Name of toolchain setup to use. Defaults to TOOLCHAIN_DEFAULT.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    46
#   SRC one or more directory roots to scan for C/C++ files.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    47
#   CFLAGS the compiler flags to be used, used both for C and C++.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    48
#   CXXFLAGS the compiler flags to be used for c++, if set overrides CFLAGS.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    49
#   LDFLAGS the linker flags to be used, used both for C and C++.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    50
#   LIBS the libraries to link to
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    51
#   ARFLAGS the archiver flags to be used
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    52
#   OBJECT_DIR the directory where we store the object files
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    53
#   OUTPUT_DIR the directory where the resulting binary is put
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    54
#   INCLUDES only pick source from these directories
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    55
#   EXCLUDES do not pick source from these directories
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    56
#   INCLUDE_FILES only compile exactly these files!
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    57
#   EXCLUDE_FILES with these names
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    58
#   EXCLUDE_PATTERN exclude files matching any of these substrings
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    59
#   EXTRA_FILES List of extra files not in any of the SRC dirs
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    60
#   EXTRA_OBJECT_FILES List of extra object files to include when linking
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    61
#   VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    62
#   RC_FLAGS flags for RC.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    63
#   EMBED_MANIFEST if true, embed manifest on Windows.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    64
#   MAPFILE mapfile
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    65
#   REORDER reorder file
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    66
#   USE_MAPFILE_FOR_SYMBOLS if true and this is a STATIC_BUILD, just copy the
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    67
#       mapfile for the output symbols file
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    68
#   CC the compiler to use, default is $(CC)
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    69
#   LD the linker to use, default is $(LD)
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    70
#   OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST, HIGHEST_JVM, SIZE
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    71
#   DISABLED_WARNINGS_<toolchain> Disable the given warnings for the specified toolchain
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    72
#   DISABLED_WARNINGS_C_<toolchain> Disable the given warnings for the specified toolchain
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    73
#       when compiling C code
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    74
#   DISABLED_WARNINGS_CXX_<toolchain> Disable the given warnings for the specified
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    75
#       toolchain when compiling C++ code
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    76
#   STRIP_SYMBOLS Set to false to override global strip policy and always leave
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    77
#       symbols in the binary, if the toolchain allows for it
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    78
#   DEBUG_SYMBOLS Set to false to disable generation of debug symbols
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    79
#   COPY_DEBUG_SYMBOLS Set to false to override global setting of debug symbol copying
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    80
#   ZIP_EXTERNAL_DEBUG_SYMBOLS Set to false to override global setting of debug symbol
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    81
#       zipping
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    82
#   STRIPFLAGS Optionally change the flags given to the strip command
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    83
#   PRECOMPILED_HEADER Header file to use as precompiled header
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    84
#   PRECOMPILED_HEADER_EXCLUDE List of source files that should not use PCH
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    85
SetupJdkLibrary = $(NamedParamsMacroTemplate)
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    86
define SetupJdkLibraryBody
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    87
  ifeq ($$($1_OUTPUT_DIR), )
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    88
    $1_OUTPUT_DIR := $$(call FindLibDirForModule, $$(MODULE))
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    89
  endif
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    90
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    91
  ifeq ($$($1_OBJECT_DIR), )
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    92
    $1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/lib$$($1_NAME)
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    93
  endif
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    94
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    95
  ifeq ($$($1_VERSIONINFO_RESOURCE), )
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    96
    $1_VERSIONINFO_RESOURCE := $$(GLOBAL_VERSION_INFO_RESOURCE)
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    97
  else ifeq ($$($1_VERSIONINFO_RESOURCE), DISABLE)
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    98
    $1_VERSIONINFO_RESOURCE :=
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
    99
  endif
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   100
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   101
  ifeq ($$($1_RC_FLAGS), )
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   102
    $1_RC_FLAGS :=  $(RC_FLAGS) \
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   103
        -D "JDK_FNAME=$$($1_NAME).dll" \
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   104
        -D "JDK_INTERNAL_NAME=$$($1_NAME)" \
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   105
        -D "JDK_FTYPE=0x2L"
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   106
  else ifeq ($$($1_RC_FLAGS), DISABLE)
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   107
    $1_RC_FLAGS :=
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   108
  endif
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   109
56308
8724d985c980 Try to fix RC_FLAGS issue on windows.
ihse
parents: 56287
diff changeset
   110
  $1_RC_FLAGS += $$($1_EXTRA_RC_FLAGS)
8724d985c980 Try to fix RC_FLAGS issue on windows.
ihse
parents: 56287
diff changeset
   111
56287
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   112
  # Since we reuse the rule name ($1), all our arguments will pass through.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   113
  # We lose in transparency, but gain in brevity in this call...
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   114
  $$(eval $$(call SetupNativeCompilation, $1, ))
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   115
endef
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   116
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   117
# Setup make rules for creating a native executable with suitable defaults for
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   118
# the OpenJDK project.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   119
#
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   120
# Parameter 1 is the name of the rule. This name is used as variable prefix,
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   121
# and the targets generated are listed in a variable by that name.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   122
#
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   123
# Remaining parameters are named arguments. These include:
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   124
#   NAME The base name for the resulting binary, excluding decorations (like *.exe)
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   125
#   TYPE Type of binary (EXECUTABLE, LIBRARY or STATIC_LIBRARY). Default is LIBRARY.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   126
#   SUFFIX Override the default suffix for the output file
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   127
#   TOOLCHAIN Name of toolchain setup to use. Defaults to TOOLCHAIN_DEFAULT.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   128
#   SRC one or more directory roots to scan for C/C++ files.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   129
#   CFLAGS the compiler flags to be used, used both for C and C++.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   130
#   CXXFLAGS the compiler flags to be used for c++, if set overrides CFLAGS.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   131
#   LDFLAGS the linker flags to be used, used both for C and C++.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   132
#   LIBS the libraries to link to
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   133
#   ARFLAGS the archiver flags to be used
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   134
#   OBJECT_DIR the directory where we store the object files
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   135
#   OUTPUT_DIR the directory where the resulting binary is put
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   136
#   INCLUDES only pick source from these directories
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   137
#   EXCLUDES do not pick source from these directories
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   138
#   INCLUDE_FILES only compile exactly these files!
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   139
#   EXCLUDE_FILES with these names
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   140
#   EXCLUDE_PATTERN exclude files matching any of these substrings
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   141
#   EXTRA_FILES List of extra files not in any of the SRC dirs
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   142
#   EXTRA_OBJECT_FILES List of extra object files to include when linking
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   143
#   VERSIONINFO_RESOURCE Input file for RC. Setting this implies that RC will be run
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   144
#   RC_FLAGS flags for RC.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   145
#   EMBED_MANIFEST if true, embed manifest on Windows.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   146
#   MAPFILE mapfile
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   147
#   REORDER reorder file
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   148
#   USE_MAPFILE_FOR_SYMBOLS if true and this is a STATIC_BUILD, just copy the
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   149
#       mapfile for the output symbols file
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   150
#   CC the compiler to use, default is $(CC)
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   151
#   LD the linker to use, default is $(LD)
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   152
#   OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST, HIGHEST_JVM, SIZE
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   153
#   DISABLED_WARNINGS_<toolchain> Disable the given warnings for the specified toolchain
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   154
#   DISABLED_WARNINGS_C_<toolchain> Disable the given warnings for the specified toolchain
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   155
#       when compiling C code
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   156
#   DISABLED_WARNINGS_CXX_<toolchain> Disable the given warnings for the specified
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   157
#       toolchain when compiling C++ code
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   158
#   STRIP_SYMBOLS Set to false to override global strip policy and always leave
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   159
#       symbols in the binary, if the toolchain allows for it
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   160
#   DEBUG_SYMBOLS Set to false to disable generation of debug symbols
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   161
#   COPY_DEBUG_SYMBOLS Set to false to override global setting of debug symbol copying
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   162
#   ZIP_EXTERNAL_DEBUG_SYMBOLS Set to false to override global setting of debug symbol
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   163
#       zipping
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   164
#   STRIPFLAGS Optionally change the flags given to the strip command
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   165
#   PRECOMPILED_HEADER Header file to use as precompiled header
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   166
#   PRECOMPILED_HEADER_EXCLUDE List of source files that should not use PCH
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   167
SetupJdkExecutable = $(NamedParamsMacroTemplate)
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   168
define SetupJdkExecutableBody
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   169
  $1_TYPE := EXECUTABLE
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   170
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   171
  ifeq ($$($1_OUTPUT_DIR), )
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   172
    $1_OUTPUT_DIR := $$(call FindExecutableDirForModule, $$(MODULE))
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   173
  endif
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   174
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   175
  ifeq ($$($1_OBJECT_DIR), )
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   176
    $1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$$($1_NAME)
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   177
  endif
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   178
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   179
  ifeq ($$($1_VERSIONINFO_RESOURCE), )
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   180
    $1_VERSIONINFO_RESOURCE := $$(GLOBAL_VERSION_INFO_RESOURCE)
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   181
  else ifeq ($$($1_VERSIONINFO_RESOURCE), DISABLE)
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   182
    $1_VERSIONINFO_RESOURCE :=
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   183
  endif
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   184
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   185
  ifeq ($$($1_RC_FLAGS), )
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   186
    $1_RC_FLAGS :=  $(RC_FLAGS) \
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   187
        -D "JDK_FNAME=$$($1_NAME).exe" \
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   188
        -D "JDK_INTERNAL_NAME=$$($1_NAME)" \
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   189
        -D "JDK_FTYPE=0x01L"
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   190
  else ifeq ($$($1_RC_FLAGS), DISABLE)
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   191
    $1_RC_FLAGS :=
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   192
  endif
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   193
56309
a7655cb387f9 Really fix windows RC problem.
ihse
parents: 56308
diff changeset
   194
  $1_RC_FLAGS += $$($1_EXTRA_RC_FLAGS)
a7655cb387f9 Really fix windows RC problem.
ihse
parents: 56308
diff changeset
   195
56287
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   196
  # Since we reuse the rule name ($1), all our arguments will pass through.
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   197
  # We lose in transparency, but gain in brevity in this call...
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   198
  $$(eval $$(call SetupNativeCompilation, $1))
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   199
endef
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   200
593a452fcbeb Introduce SetupJdkLibrary and SetupJdkExecutable.
ihse
parents:
diff changeset
   201
endif # _JDK_NATIVE_COMPILATION_GMK