|
1 # |
|
2 # Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. |
|
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 |
|
35 # Setup make rules for creating a native shared library with suitable defaults |
|
36 # for the OpenJDK project. |
|
37 # |
|
38 # Parameter 1 is the name of the rule. This name is used as variable prefix, |
|
39 # and the targets generated are listed in a variable by that name. |
|
40 # |
|
41 # Remaining parameters are named arguments. These are all passed on to |
|
42 # SetupNativeCompilation, except for |
|
43 # EXTRA_RC_FLAGS -- additional RC_FLAGS to append. |
|
44 SetupJdkLibrary = $(NamedParamsMacroTemplate) |
|
45 define SetupJdkLibraryBody |
|
46 ifeq ($$($1_OUTPUT_DIR), ) |
|
47 $1_OUTPUT_DIR := $$(call FindLibDirForModule, $$(MODULE)) |
|
48 endif |
|
49 |
|
50 ifeq ($$($1_OBJECT_DIR), ) |
|
51 $1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/lib$$($1_NAME) |
|
52 endif |
|
53 |
|
54 ifeq ($$($1_VERSIONINFO_RESOURCE), ) |
|
55 $1_VERSIONINFO_RESOURCE := $$(GLOBAL_VERSION_INFO_RESOURCE) |
|
56 else ifeq ($$($1_VERSIONINFO_RESOURCE), DISABLE) |
|
57 $1_VERSIONINFO_RESOURCE := |
|
58 endif |
|
59 |
|
60 ifeq ($$($1_RC_FLAGS), ) |
|
61 $1_RC_FLAGS := $(RC_FLAGS) \ |
|
62 -D "JDK_FNAME=$$($1_NAME).dll" \ |
|
63 -D "JDK_INTERNAL_NAME=$$($1_NAME)" \ |
|
64 -D "JDK_FTYPE=0x2L" |
|
65 else ifeq ($$($1_RC_FLAGS), DISABLE) |
|
66 $1_RC_FLAGS := |
|
67 endif |
|
68 |
|
69 $1_RC_FLAGS += $$($1_EXTRA_RC_FLAGS) |
|
70 |
|
71 # Since we reuse the rule name ($1), all our arguments will pass through. |
|
72 # We lose in transparency, but gain in brevity in this call... |
|
73 $$(eval $$(call SetupNativeCompilation, $1, )) |
|
74 endef |
|
75 |
|
76 # Setup make rules for creating a native executable with suitable defaults for |
|
77 # the OpenJDK project. |
|
78 # |
|
79 # Parameter 1 is the name of the rule. This name is used as variable prefix, |
|
80 # and the targets generated are listed in a variable by that name. |
|
81 # |
|
82 # Remaining parameters are named arguments. These are all passed on to |
|
83 # SetupNativeCompilation, except for |
|
84 # EXTRA_RC_FLAGS -- additional RC_FLAGS to append. |
|
85 SetupJdkExecutable = $(NamedParamsMacroTemplate) |
|
86 define SetupJdkExecutableBody |
|
87 $1_TYPE := EXECUTABLE |
|
88 |
|
89 ifeq ($$($1_OUTPUT_DIR), ) |
|
90 $1_OUTPUT_DIR := $$(call FindExecutableDirForModule, $$(MODULE)) |
|
91 endif |
|
92 |
|
93 ifeq ($$($1_OBJECT_DIR), ) |
|
94 $1_OBJECT_DIR := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$$($1_NAME) |
|
95 endif |
|
96 |
|
97 ifeq ($$($1_VERSIONINFO_RESOURCE), ) |
|
98 $1_VERSIONINFO_RESOURCE := $$(GLOBAL_VERSION_INFO_RESOURCE) |
|
99 else ifeq ($$($1_VERSIONINFO_RESOURCE), DISABLE) |
|
100 $1_VERSIONINFO_RESOURCE := |
|
101 endif |
|
102 |
|
103 ifeq ($$($1_RC_FLAGS), ) |
|
104 $1_RC_FLAGS := $(RC_FLAGS) \ |
|
105 -D "JDK_FNAME=$$($1_NAME).exe" \ |
|
106 -D "JDK_INTERNAL_NAME=$$($1_NAME)" \ |
|
107 -D "JDK_FTYPE=0x01L" |
|
108 else ifeq ($$($1_RC_FLAGS), DISABLE) |
|
109 $1_RC_FLAGS := |
|
110 endif |
|
111 |
|
112 $1_RC_FLAGS += $$($1_EXTRA_RC_FLAGS) |
|
113 |
|
114 # Since we reuse the rule name ($1), all our arguments will pass through. |
|
115 # We lose in transparency, but gain in brevity in this call... |
|
116 $$(eval $$(call SetupNativeCompilation, $1)) |
|
117 endef |
|
118 |
|
119 endif # _JDK_NATIVE_COMPILATION_GMK |