author | naoto |
Tue, 12 Nov 2019 14:05:18 -0800 | |
changeset 59043 | 1a79b4bfc85a |
parent 58908 | 73bb9c4002cc |
permissions | -rw-r--r-- |
49244 | 1 |
# |
58908
73bb9c4002cc
8233381: Update copyright year in build system files
ihse
parents:
58846
diff
changeset
|
2 |
# Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. |
49244 | 3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
# |
|
5 |
# This code is free software; you can redistribute it and/or modify it |
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
|
7 |
# published by the Free Software Foundation. Oracle designates this |
|
8 |
# particular file as subject to the "Classpath" exception as provided |
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
24 |
# |
|
25 |
||
26 |
ifndef _JDK_NATIVE_COMPILATION_GMK |
|
27 |
_JDK_NATIVE_COMPILATION_GMK := 1 |
|
28 |
||
29 |
ifeq ($(_MAKEBASE_GMK), ) |
|
30 |
$(error You must include MakeBase.gmk prior to including JdkNativeCompilation.gmk) |
|
31 |
endif |
|
32 |
||
33 |
include NativeCompilation.gmk |
|
34 |
||
50471
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
35 |
# Hook to include the corresponding custom file, if present. |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
36 |
$(eval $(call IncludeCustomExtension, common/JdkNativeCompilation.gmk)) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
37 |
|
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
38 |
FindSrcDirsForLib += \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
39 |
$(call uniq, $(wildcard \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
40 |
$(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/lib$(strip $2) \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
41 |
$(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/native/lib$(strip $2) \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
42 |
$(TOPDIR)/src/$(strip $1)/share/native/lib$(strip $2))) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
43 |
|
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
44 |
FindSrcDirsForComponent += \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
45 |
$(call uniq, $(wildcard \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
46 |
$(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS)/native/$(strip $2) \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
47 |
$(TOPDIR)/src/$(strip $1)/$(OPENJDK_TARGET_OS_TYPE)/native/$(strip $2) \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
48 |
$(TOPDIR)/src/$(strip $1)/share/native/$(strip $2))) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
49 |
|
58846
f9ac726ab347
8232748: Build static versions of certain JDK libraries
erikj
parents:
55157
diff
changeset
|
50 |
# Find a library. Used for declaring dependencies on libraries in different |
f9ac726ab347
8232748: Build static versions of certain JDK libraries
erikj
parents:
55157
diff
changeset
|
51 |
# modules. |
52022
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
52 |
# Param 1 - module name |
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
53 |
# Param 2 - library name |
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
54 |
# Param 3 - optional subdir for library |
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
55 |
FindLib = \ |
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
56 |
$(call FindLibDirForModule, \ |
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
57 |
$(strip $1))$(strip $3)/$(LIBRARY_PREFIX)$(strip $2)$(SHARED_LIBRARY_SUFFIX) |
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
58 |
|
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
59 |
# Find a static library |
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
60 |
# Param 1 - module name |
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
61 |
# Param 2 - library name |
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
62 |
# Param 3 - optional subdir for library |
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
63 |
FindStaticLib = \ |
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
64 |
$(addprefix $(SUPPORT_OUTPUTDIR)/native/, \ |
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
65 |
$(strip $1)$(strip $3)/$(LIBRARY_PREFIX)$(strip $2)$(STATIC_LIBRARY_SUFFIX)) |
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
66 |
|
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
67 |
# If only generating compile_commands.json, make these return empty to avoid |
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
68 |
# declaring dependencies. |
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
69 |
ifeq ($(GENERATE_COMPILE_COMMANDS_ONLY), true) |
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
70 |
FindLib = |
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
71 |
FindStaticLib = |
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
72 |
endif |
58846
f9ac726ab347
8232748: Build static versions of certain JDK libraries
erikj
parents:
55157
diff
changeset
|
73 |
# If building static versions of libraries, make these return empty to avoid |
f9ac726ab347
8232748: Build static versions of certain JDK libraries
erikj
parents:
55157
diff
changeset
|
74 |
# declaring dependencies. |
f9ac726ab347
8232748: Build static versions of certain JDK libraries
erikj
parents:
55157
diff
changeset
|
75 |
ifeq ($(STATIC_LIBS), true) |
f9ac726ab347
8232748: Build static versions of certain JDK libraries
erikj
parents:
55157
diff
changeset
|
76 |
FindLib = |
f9ac726ab347
8232748: Build static versions of certain JDK libraries
erikj
parents:
55157
diff
changeset
|
77 |
FindStaticLib = |
f9ac726ab347
8232748: Build static versions of certain JDK libraries
erikj
parents:
55157
diff
changeset
|
78 |
endif |
52022
804792ce736f
8210459: Add support for generating compile_commands.json
rwestberg
parents:
50847
diff
changeset
|
79 |
|
50471
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
80 |
GetJavaHeaderDir = \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
81 |
$(wildcard $(SUPPORT_OUTPUTDIR)/headers/$(strip $1)) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
82 |
|
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
83 |
# Process a dir description such as "java.base:headers" into a set of proper absolute paths. |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
84 |
ProcessDir = \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
85 |
$(if $(findstring :, $1), \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
86 |
$(call FindSrcDirsForComponent, $(firstword $(subst :, , $1)), $(lastword $(subst :, , $1))) \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
87 |
, \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
88 |
$(if $(filter /%, $1), \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
89 |
$1 \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
90 |
, \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
91 |
$(call FindSrcDirsForComponent, $(MODULE), $1) \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
92 |
) \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
93 |
) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
94 |
|
49244 | 95 |
# Setup make rules for creating a native shared library with suitable defaults |
96 |
# for the OpenJDK project. |
|
97 |
# |
|
98 |
# Parameter 1 is the name of the rule. This name is used as variable prefix, |
|
99 |
# and the targets generated are listed in a variable by that name. |
|
100 |
# |
|
101 |
# Remaining parameters are named arguments. These are all passed on to |
|
50471
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
102 |
# SetupNativeCompilation, except for |
49244 | 103 |
# EXTRA_RC_FLAGS -- additional RC_FLAGS to append. |
50471
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
104 |
# EXTRA_HEADER_DIRS -- additional directories to look for headers in |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
105 |
# EXTRA_SRC -- additional directories to look for source in |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
106 |
# EXCLUDE_SRC_PATTERNS -- exclude source dirs matching these patterns from |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
107 |
# appearing in SRC. |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
108 |
# HEADERS_FROM_SRC -- if false, does not add source dirs automatically as |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
109 |
# header include dirs. (Defaults to true.) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
110 |
# SRC -- this is passed on, but preprocessed to accept source dir designations |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
111 |
# such as "java.base:headers". |
49244 | 112 |
SetupJdkLibrary = $(NamedParamsMacroTemplate) |
113 |
define SetupJdkLibraryBody |
|
114 |
ifeq ($$($1_OUTPUT_DIR), ) |
|
115 |
$1_OUTPUT_DIR := $$(call FindLibDirForModule, $$(MODULE)) |
|
116 |
endif |
|
117 |
||
118 |
ifeq ($$($1_OBJECT_DIR), ) |
|
119 |
$1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/lib$$($1_NAME) |
|
120 |
endif |
|
121 |
||
50471
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
122 |
ifeq ($$($1_SRC), ) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
123 |
$1_SRC := $$(call FindSrcDirsForLib, $$(MODULE), $$($1_NAME)) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
124 |
else |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
125 |
$1_SRC := $$(foreach dir, $$($1_SRC), $$(call ProcessDir, $$(dir))) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
126 |
endif |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
127 |
ifneq ($$($1_EXTRA_SRC), ) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
128 |
$1_SRC += $$(foreach dir, $$($1_EXTRA_SRC), $$(call ProcessDir, $$(dir))) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
129 |
endif |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
130 |
|
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
131 |
ifneq ($$($1_EXCLUDE_SRC_PATTERNS), ) |
55157 | 132 |
$1_SRC_WITHOUT_WORKSPACE_ROOT := $$(patsubst $$(WORKSPACE_ROOT)/%, %, $$($1_SRC)) |
133 |
$1_EXCLUDE_SRC := $$(addprefix %, $$(call containing, $$($1_EXCLUDE_SRC_PATTERNS), \ |
|
134 |
$$($1_SRC_WITHOUT_WORKSPACE_ROOT))) |
|
50471
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
135 |
$1_SRC := $$(filter-out $$($1_EXCLUDE_SRC), $$($1_SRC)) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
136 |
endif |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
137 |
|
49244 | 138 |
ifeq ($$($1_VERSIONINFO_RESOURCE), ) |
139 |
$1_VERSIONINFO_RESOURCE := $$(GLOBAL_VERSION_INFO_RESOURCE) |
|
140 |
else ifeq ($$($1_VERSIONINFO_RESOURCE), DISABLE) |
|
141 |
$1_VERSIONINFO_RESOURCE := |
|
142 |
endif |
|
143 |
||
144 |
ifeq ($$($1_RC_FLAGS), ) |
|
145 |
$1_RC_FLAGS := $(RC_FLAGS) \ |
|
146 |
-D "JDK_FNAME=$$($1_NAME).dll" \ |
|
147 |
-D "JDK_INTERNAL_NAME=$$($1_NAME)" \ |
|
148 |
-D "JDK_FTYPE=0x2L" |
|
149 |
else ifeq ($$($1_RC_FLAGS), DISABLE) |
|
150 |
$1_RC_FLAGS := |
|
151 |
endif |
|
152 |
||
50471
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
153 |
ifneq ($$($1_HEADERS_FROM_SRC), false) |
50847
b970fae53807
8205616: Build fails with system headers after 8204572
glaubitz
parents:
50471
diff
changeset
|
154 |
$1_SRC_HEADER_FLAGS := $$(addprefix -I, $$(wildcard $$($1_SRC))) |
50471
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
155 |
endif |
50847
b970fae53807
8205616: Build fails with system headers after 8204572
glaubitz
parents:
50471
diff
changeset
|
156 |
# Always add the java header dir |
b970fae53807
8205616: Build fails with system headers after 8204572
glaubitz
parents:
50471
diff
changeset
|
157 |
$1_SRC_HEADER_FLAGS += $$(addprefix -I, $$(call GetJavaHeaderDir, $$(MODULE))) |
b970fae53807
8205616: Build fails with system headers after 8204572
glaubitz
parents:
50471
diff
changeset
|
158 |
|
50471
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
159 |
ifneq ($$($1_EXTRA_HEADER_DIRS), ) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
160 |
$1_PROCESSED_EXTRA_HEADER_DIRS := $$(foreach dir, $$($1_EXTRA_HEADER_DIRS), \ |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
161 |
$$(call ProcessDir, $$(dir))) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
162 |
$1_EXTRA_HEADER_FLAGS := $$(addprefix -I, $$($1_PROCESSED_EXTRA_HEADER_DIRS)) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
163 |
endif |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
164 |
|
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
165 |
ifneq ($$($1_CFLAGS), ) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
166 |
$1_CFLAGS += $$($1_SRC_HEADER_FLAGS) $$($1_EXTRA_HEADER_FLAGS) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
167 |
endif |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
168 |
ifneq ($$($1_CXXFLAGS), ) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
169 |
$1_CXXFLAGS += $$($1_SRC_HEADER_FLAGS) $$($1_EXTRA_HEADER_FLAGS) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
170 |
endif |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
171 |
ifeq ($$($1_CFLAGS)$$($1_CXXFLAGS), ) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
172 |
$1_CFLAGS += $$($1_SRC_HEADER_FLAGS) $$($1_EXTRA_HEADER_FLAGS) |
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
173 |
endif |
49244 | 174 |
$1_RC_FLAGS += $$($1_EXTRA_RC_FLAGS) |
175 |
||
176 |
# Since we reuse the rule name ($1), all our arguments will pass through. |
|
177 |
# We lose in transparency, but gain in brevity in this call... |
|
178 |
$$(eval $$(call SetupNativeCompilation, $1, )) |
|
179 |
endef |
|
180 |
||
181 |
# Setup make rules for creating a native executable with suitable defaults for |
|
182 |
# the OpenJDK project. |
|
183 |
# |
|
184 |
# Parameter 1 is the name of the rule. This name is used as variable prefix, |
|
185 |
# and the targets generated are listed in a variable by that name. |
|
186 |
# |
|
187 |
# Remaining parameters are named arguments. These are all passed on to |
|
50471
f0aeede1b855
8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents:
49244
diff
changeset
|
188 |
# SetupNativeCompilation, except for |
49244 | 189 |
# EXTRA_RC_FLAGS -- additional RC_FLAGS to append. |
190 |
SetupJdkExecutable = $(NamedParamsMacroTemplate) |
|
191 |
define SetupJdkExecutableBody |
|
192 |
$1_TYPE := EXECUTABLE |
|
193 |
||
194 |
ifeq ($$($1_OUTPUT_DIR), ) |
|
195 |
$1_OUTPUT_DIR := $$(call FindExecutableDirForModule, $$(MODULE)) |
|
196 |
endif |
|
197 |
||
198 |
ifeq ($$($1_OBJECT_DIR), ) |
|
199 |
$1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$$($1_NAME) |
|
200 |
endif |
|
201 |
||
202 |
ifeq ($$($1_VERSIONINFO_RESOURCE), ) |
|
203 |
$1_VERSIONINFO_RESOURCE := $$(GLOBAL_VERSION_INFO_RESOURCE) |
|
204 |
else ifeq ($$($1_VERSIONINFO_RESOURCE), DISABLE) |
|
205 |
$1_VERSIONINFO_RESOURCE := |
|
206 |
endif |
|
207 |
||
208 |
ifeq ($$($1_RC_FLAGS), ) |
|
209 |
$1_RC_FLAGS := $(RC_FLAGS) \ |
|
210 |
-D "JDK_FNAME=$$($1_NAME).exe" \ |
|
211 |
-D "JDK_INTERNAL_NAME=$$($1_NAME)" \ |
|
212 |
-D "JDK_FTYPE=0x01L" |
|
213 |
else ifeq ($$($1_RC_FLAGS), DISABLE) |
|
214 |
$1_RC_FLAGS := |
|
215 |
endif |
|
216 |
||
217 |
$1_RC_FLAGS += $$($1_EXTRA_RC_FLAGS) |
|
218 |
||
219 |
# Since we reuse the rule name ($1), all our arguments will pass through. |
|
220 |
# We lose in transparency, but gain in brevity in this call... |
|
221 |
$$(eval $$(call SetupNativeCompilation, $1)) |
|
222 |
endef |
|
223 |
||
224 |
endif # _JDK_NATIVE_COMPILATION_GMK |