author | amurillo |
Fri, 06 Nov 2015 11:11:53 -0800 | |
changeset 33666 | 7908508d9e1c |
parent 33502 | 61feec1d58aa |
child 34013 | 79c21cd6fcfc |
permissions | -rw-r--r-- |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
1 |
# |
29374
f031a666744a
8074096: Disable (most) native warnings in JDK on a per-library basis
ihse
parents:
27799
diff
changeset
|
2 |
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
3 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
4 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
5 |
# This code is free software; you can redistribute it and/or modify it |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
6 |
# under the terms of the GNU General Public License version 2 only, as |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
7 |
# published by the Free Software Foundation. Oracle designates this |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
8 |
# particular file as subject to the "Classpath" exception as provided |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
9 |
# by Oracle in the LICENSE file that accompanied this code. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
10 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
15 |
# accompanied this code). |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
16 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
17 |
# You should have received a copy of the GNU General Public License version |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
20 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
22 |
# or visit www.oracle.com if you need additional information or have any |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
23 |
# questions. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
24 |
# |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
25 |
|
33502 | 26 |
################################################################################ |
27 |
# Build demos for the JDK into $(SUPPORT_OUTPUTDIR)/demos/image. |
|
28 |
################################################################################ |
|
29 |
||
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
30 |
default: all |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
31 |
|
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
32 |
include $(SPEC) |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
33 |
include MakeBase.gmk |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
34 |
include JavaCompilation.gmk |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
35 |
include NativeCompilation.gmk |
26191
a0ff4b39d34b
8055188: General cleanup of minor issues from source restructure
erikj
parents:
25859
diff
changeset
|
36 |
include SetupJavaCompilers.gmk |
30654
3c2e826aa5ea
8080630: Stop doing sed manipulation of manifest files in SetupJavaCompilation
ihse
parents:
30434
diff
changeset
|
37 |
include TextFileProcessing.gmk |
33502 | 38 |
include ZipArchive.gmk |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
39 |
|
25859 | 40 |
# Prepare the find cache. |
20547 | 41 |
$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src)) |
15126
bceb690ccf35
8005540: build-infra: Improve incremental build speed on windows by caching find results
erikj
parents:
14596
diff
changeset
|
42 |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
43 |
# Append demo goals to this variable. |
33502 | 44 |
TARGETS = |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
45 |
|
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
46 |
# The demo structure and contents should really be cleaned up. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
47 |
# Now every other demo has its own quirks where to put the |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
48 |
# READMEs and other files. |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
49 |
|
25859 | 50 |
DEMO_SHARE_SRC := $(JDK_TOPDIR)/src/demo/share |
29925
6d47adfc6b47
8077847: Better handling of Windows executable manifest version
ihse
parents:
29392
diff
changeset
|
51 |
GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/common/version.rc |
25859 | 52 |
|
33502 | 53 |
DEMO_MANIFEST := $(SUPPORT_OUTPUTDIR)/demos/java-main-manifest.mf |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
54 |
|
33502 | 55 |
# This rule will be depended on due to the MANIFEST line in SetupBuildDemo |
56 |
# and SetupBuildJvmtiDemo. |
|
30654
3c2e826aa5ea
8080630: Stop doing sed manipulation of manifest files in SetupJavaCompilation
ihse
parents:
30434
diff
changeset
|
57 |
$(eval $(call SetupTextFileProcessing, BUILD_JAVA_MANIFEST, \ |
3c2e826aa5ea
8080630: Stop doing sed manipulation of manifest files in SetupJavaCompilation
ihse
parents:
30434
diff
changeset
|
58 |
SOURCE_FILES := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \ |
33502 | 59 |
OUTPUT_FILE := $(DEMO_MANIFEST), \ |
30654
3c2e826aa5ea
8080630: Stop doing sed manipulation of manifest files in SetupJavaCompilation
ihse
parents:
30434
diff
changeset
|
60 |
REPLACEMENTS := \ |
3c2e826aa5ea
8080630: Stop doing sed manipulation of manifest files in SetupJavaCompilation
ihse
parents:
30434
diff
changeset
|
61 |
@@RELEASE@@ => $(RELEASE) ; \ |
3c2e826aa5ea
8080630: Stop doing sed manipulation of manifest files in SetupJavaCompilation
ihse
parents:
30434
diff
changeset
|
62 |
@@COMPANY_NAME@@ => $(COMPANY_NAME) , \ |
3c2e826aa5ea
8080630: Stop doing sed manipulation of manifest files in SetupJavaCompilation
ihse
parents:
30434
diff
changeset
|
63 |
)) |
3c2e826aa5ea
8080630: Stop doing sed manipulation of manifest files in SetupJavaCompilation
ihse
parents:
30434
diff
changeset
|
64 |
|
33502 | 65 |
################################################################################ |
66 |
# Build applet demos. |
|
67 |
||
68 |
# Setup make rules for building a demo applet. |
|
69 |
# |
|
70 |
# Parameter 1 is the name of the rule. This name is used as variable prefix, |
|
71 |
# and the targets generated are listed in a variable by that name. It is also |
|
72 |
# used to locate the name of the applet subdir, and to determine the name |
|
73 |
# of the output directory. |
|
74 |
# |
|
75 |
# Remaining parameters are named arguments. These include: |
|
76 |
# SRC_DIR Alternative source directory to use for the demos. |
|
77 |
# DISABLE_SJAVAC Passed to SetupJavaCompilation |
|
78 |
||
79 |
SetupBuildAppletDemo = $(NamedParamsMacroTemplate) |
|
80 |
define SetupBuildAppletDemoBody |
|
81 |
ifeq ($$($1_SRC_DIR), ) |
|
82 |
$1_SRC_DIR := $(DEMO_SHARE_SRC)/applets |
|
83 |
endif |
|
84 |
||
85 |
$$(eval $$(call SetupJavaCompilation, BUILD_DEMO_APPLET_$1, \ |
|
20547 | 86 |
SETUP := GENERATE_USINGJDKBYTECODE, \ |
33502 | 87 |
SRC := $$($1_SRC_DIR)/$1, \ |
88 |
BIN := $(SUPPORT_OUTPUTDIR)/demos/image/applets/$1, \ |
|
20547 | 89 |
COPY := .html .java .xyz .obj .au .gif, \ |
33502 | 90 |
DISABLE_SJAVAC := $$($1_DISABLE_SJAVAC), \ |
91 |
)) |
|
92 |
||
93 |
$1 := $$(BUILD_DEMO_APPLET_$1) |
|
94 |
||
95 |
TARGETS += $$($1) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
96 |
endef |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
97 |
|
21742
e61b55843e88
8028645: [infra] purge applet demos from the Solaris distros
ksrini
parents:
21535
diff
changeset
|
98 |
ifneq ($(OPENJDK_TARGET_OS), solaris) |
33502 | 99 |
$(eval $(call SetupBuildAppletDemo, ArcTest)) |
100 |
$(eval $(call SetupBuildAppletDemo, BarChart)) |
|
101 |
$(eval $(call SetupBuildAppletDemo, Blink)) |
|
102 |
$(eval $(call SetupBuildAppletDemo, CardTest)) |
|
103 |
$(eval $(call SetupBuildAppletDemo, Clock)) |
|
104 |
$(eval $(call SetupBuildAppletDemo, DitherTest)) |
|
105 |
$(eval $(call SetupBuildAppletDemo, DrawTest)) |
|
106 |
$(eval $(call SetupBuildAppletDemo, Fractal)) |
|
107 |
$(eval $(call SetupBuildAppletDemo, GraphicsTest)) |
|
108 |
$(eval $(call SetupBuildAppletDemo, NervousText)) |
|
109 |
$(eval $(call SetupBuildAppletDemo, SimpleGraph)) |
|
110 |
$(eval $(call SetupBuildAppletDemo, SortDemo)) |
|
111 |
$(eval $(call SetupBuildAppletDemo, SpreadSheet)) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
112 |
endif |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
113 |
|
33502 | 114 |
################################################################################ |
115 |
# Build normal demos. |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
116 |
|
33502 | 117 |
COPY_TO_JAR := .html .txt .properties .js .gif .jpg .theme .data .opt .c .h \ |
118 |
.png .ttf .xyz .obj README COPYRIGHT |
|
119 |
||
120 |
COPY_TO_IMAGE := *.html *.txt *.png *.xml README* |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
121 |
|
33502 | 122 |
# Setup make rules for building a demo. |
123 |
# |
|
124 |
# Parameter 1 is the name of the rule. This name is used as variable prefix, |
|
125 |
# and the targets generated are listed in a variable by that name. |
|
126 |
# |
|
127 |
# Remaining parameters are named arguments. These include: |
|
128 |
# DEMO_SUBDIR The name of the subdir of the demo, below the demo top dir. |
|
129 |
# EXTRA_SRC_DIR Additional source directory. |
|
130 |
# SRC_SUB_DIR Optional subdir to locate source code in |
|
131 |
# SRC_DIR Alternative source directory to use for the demos. |
|
132 |
# EXCLUDE_FILES Exclude file list |
|
133 |
# JAR_NAME Base name of jar file. Defaults to $1. |
|
134 |
# MAIN_CLASS The main class for the jar. Defaults to $1. |
|
135 |
# EXTRA_COPY_TO_JAR Additional files to copy to jar (as patterns) |
|
136 |
# EXTRA_COPY_TO_IMAGE Additional files to copy to images (as wildcards) |
|
137 |
# EXTRA_MANIFEST_ATTR Extra manifest attribute |
|
138 |
# SKIP_COMPILATION Skip Java compilation iff true |
|
139 |
# DISABLE_SJAVAC Passed to SetupJavaCompilation |
|
140 |
SetupBuildDemo = $(NamedParamsMacroTemplate) |
|
141 |
define SetupBuildDemoBody |
|
142 |
ifeq ($$($1_SRC_DIR), ) |
|
143 |
$1_SRC_DIR := $(DEMO_SHARE_SRC) |
|
144 |
endif |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
145 |
|
33502 | 146 |
$1_SRC_BASE := $$($1_SRC_DIR)/$$($1_DEMO_SUBDIR)/$1 |
147 |
||
148 |
# In some demos the source is found in a subdir |
|
149 |
ifneq ($$($1_SRC_SUB_DIR), ) |
|
150 |
$1_MAIN_SRC := $$($1_SRC_BASE)/$$($1_SRC_SUB_DIR) |
|
151 |
else |
|
152 |
# for allmost all |
|
25859 | 153 |
$1_MAIN_SRC := $$($1_SRC_BASE) |
20547 | 154 |
endif |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
155 |
|
33502 | 156 |
# Default is to use demo name as jar file name. |
157 |
ifeq ($$($1_JAR_NAME), ) |
|
158 |
$1_JAR_NAME := $1 |
|
20547 | 159 |
endif |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
160 |
|
33502 | 161 |
# Default is to use demo name as jar main class. |
162 |
ifeq ($$($1_MAIN_CLASS), ) |
|
163 |
$1_MAIN_CLASS := $1 |
|
164 |
else ifeq ($$($1_MAIN_CLASS), NONE) |
|
165 |
$1_MAIN_CLASS := |
|
166 |
$1_EXTRA_MANIFEST_ATTR += Main-Class: \n |
|
20547 | 167 |
endif |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
168 |
|
33502 | 169 |
ifneq ($$($1_SKIP_COMPILATION), true) |
170 |
$$(eval $$(call SetupJavaCompilation, BUILD_DEMO_$1, \ |
|
171 |
SETUP := GENERATE_USINGJDKBYTECODE, \ |
|
172 |
SRC := $$($1_MAIN_SRC) $$($1_EXTRA_SRC_DIR), \ |
|
173 |
BIN := $(SUPPORT_OUTPUTDIR)/demos/classes/$$($1_DEMO_SUBDIR)/$1, \ |
|
174 |
COPY := $(COPY_TO_JAR) $$($1_EXTRA_COPY_TO_JAR), \ |
|
175 |
JAR := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1/$$($1_JAR_NAME).jar, \ |
|
176 |
JARMAIN := $$($1_MAIN_CLASS), \ |
|
177 |
MANIFEST := $(DEMO_MANIFEST), \ |
|
178 |
EXTRA_MANIFEST_ATTR := $$($1_EXTRA_MANIFEST_ATTR), \ |
|
179 |
SRCZIP := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1/src.zip, \ |
|
180 |
EXCLUDE_FILES := $$($1_EXCLUDE_FILES), \ |
|
181 |
DISABLE_SJAVAC := $$($1_DISABLE_SJAVAC), \ |
|
182 |
)) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
183 |
|
33502 | 184 |
$1 += $$(BUILD_DEMO_$1) |
20547 | 185 |
endif |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
186 |
|
33502 | 187 |
# Copy files. Sort is needed to remove duplicates. |
188 |
$1_COPY_FILES := $$(sort $$(wildcard $$(addprefix $$($1_SRC_BASE)/, \ |
|
189 |
$(COPY_TO_IMAGE) $$($1_EXTRA_COPY_TO_IMAGE)))) |
|
190 |
$$(eval $$(call SetupCopyFiles, COPY_DEMO_$1, \ |
|
191 |
SRC := $$($1_SRC_BASE), \ |
|
192 |
DEST := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1, \ |
|
193 |
FILES := $$($1_COPY_FILES), \ |
|
194 |
)) |
|
195 |
||
196 |
$1 += $$(COPY_DEMO_$1) |
|
197 |
||
198 |
TARGETS += $$($1) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
199 |
endef |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
200 |
|
33502 | 201 |
CODEPOINT_SERVICE := java.awt.im.spi.InputMethodDescriptor |
202 |
CODEPOINT_METAINF_SERVICE_FILE := \ |
|
203 |
$(SUPPORT_OUTPUTDIR)/demos/classes/jfc/CodePointIM/META-INF/services/$(CODEPOINT_SERVICE) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
204 |
|
33502 | 205 |
$(eval $(call SetupBuildDemo, CodePointIM, \ |
206 |
DEMO_SUBDIR := jfc, \ |
|
207 |
EXTRA_COPY_TO_JAR := $(CODEPOINT_SERVICE), \ |
|
208 |
)) |
|
209 |
||
210 |
# We also need to copy the CODEPOINT_SERVICE file to the META-INF/services |
|
211 |
# location, and make sure the jar depends on that file to get it included. |
|
212 |
$(CODEPOINT_METAINF_SERVICE_FILE): $(DEMO_SHARE_SRC)/jfc/CodePointIM/$(CODEPOINT_SERVICE) |
|
213 |
$(call install-file) |
|
214 |
||
215 |
$(BUILD_DEMO_CodePointIM_JAR): $(CODEPOINT_METAINF_SERVICE_FILE) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
216 |
|
21742
e61b55843e88
8028645: [infra] purge applet demos from the Solaris distros
ksrini
parents:
21535
diff
changeset
|
217 |
ifneq ($(OPENJDK_TARGET_OS), solaris) |
33502 | 218 |
$(eval $(call SetupBuildDemo, MoleculeViewer, \ |
219 |
DEMO_SUBDIR := applets, \ |
|
220 |
MAIN_CLASS := XYZChemModel, \ |
|
221 |
EXTRA_COPY_TO_IMAGE := *.java, \ |
|
222 |
)) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
223 |
|
33502 | 224 |
$(eval $(call SetupBuildDemo, WireFrame, \ |
225 |
DEMO_SUBDIR := applets, \ |
|
226 |
MAIN_CLASS := ThreeD, \ |
|
227 |
EXTRA_COPY_TO_IMAGE := *.java, \ |
|
228 |
)) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
229 |
|
33502 | 230 |
$(eval $(call SetupBuildDemo, SwingApplet, \ |
231 |
DEMO_SUBDIR := jfc, \ |
|
232 |
)) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
233 |
endif |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
234 |
|
33502 | 235 |
$(eval $(call SetupBuildDemo, FileChooserDemo, \ |
236 |
DEMO_SUBDIR := jfc, \ |
|
237 |
)) |
|
238 |
||
239 |
$(eval $(call SetupBuildDemo, Font2DTest, \ |
|
240 |
DEMO_SUBDIR := jfc, \ |
|
241 |
)) |
|
242 |
||
243 |
$(eval $(call SetupBuildDemo, Metalworks, \ |
|
244 |
DEMO_SUBDIR := jfc, \ |
|
245 |
)) |
|
246 |
||
247 |
$(eval $(call SetupBuildDemo, Notepad, \ |
|
248 |
DEMO_SUBDIR := jfc, \ |
|
249 |
)) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
250 |
|
33502 | 251 |
$(eval $(call SetupBuildDemo, SampleTree, \ |
252 |
DEMO_SUBDIR := jfc, \ |
|
253 |
)) |
|
254 |
||
255 |
$(eval $(call SetupBuildDemo, TableExample, \ |
|
256 |
DEMO_SUBDIR := jfc, \ |
|
257 |
)) |
|
258 |
||
259 |
$(eval $(call SetupBuildDemo, TransparentRuler, \ |
|
260 |
DEMO_SUBDIR := jfc, \ |
|
261 |
MAIN_CLASS := transparentruler.Ruler, \ |
|
262 |
)) |
|
263 |
||
264 |
$(eval $(call SetupBuildDemo, jconsole-plugin, \ |
|
265 |
DEMO_SUBDIR := scripting, \ |
|
266 |
SRC_SUB_DIR := src, \ |
|
267 |
MAIN_CLASS := NONE, \ |
|
268 |
)) |
|
269 |
||
270 |
$(eval $(call SetupBuildDemo, FullThreadDump, \ |
|
271 |
DEMO_SUBDIR := management, \ |
|
272 |
)) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
273 |
|
33502 | 274 |
$(eval $(call SetupBuildDemo, JTop, \ |
275 |
DEMO_SUBDIR := management, \ |
|
276 |
)) |
|
277 |
||
278 |
$(eval $(call SetupBuildDemo, MemoryMonitor, \ |
|
279 |
DEMO_SUBDIR := management, \ |
|
280 |
)) |
|
281 |
||
282 |
$(eval $(call SetupBuildDemo, VerboseGC, \ |
|
283 |
DEMO_SUBDIR := management, \ |
|
284 |
)) |
|
285 |
||
286 |
################################################################################ |
|
287 |
# Build JVMTI demos. |
|
288 |
||
289 |
# Setup make rules for building a JVMTI demo. |
|
290 |
# |
|
291 |
# Parameter 1 is the name of the rule. This name is used as variable prefix, |
|
292 |
# and the targets generated are listed in a variable by that name. |
|
293 |
# |
|
294 |
# Remaining parameters are named arguments. These include: |
|
295 |
# EXTRA_SRC_SUBDIR Also include these subdirectories |
|
296 |
# TOOLCHAIN Optionally specify toolchain to use |
|
297 |
SetupBuildJvmtiDemo = $(NamedParamsMacroTemplate) |
|
298 |
define SetupBuildJvmtiDemoBody |
|
299 |
$1_SRC := \ |
|
300 |
$(DEMO_SHARE_SRC)/jvmti/$1 \ |
|
301 |
$$(wildcard $$(addprefix $(DEMO_SHARE_SRC)/jvmti/, \ |
|
302 |
agent_util $$($1_EXTRA_SRC_SUBDIR))) |
|
303 |
||
304 |
### Build the native lib |
|
305 |
$1_CFLAGS_INCLUDE := $$(addprefix -I, $$($1_SRC)) |
|
306 |
||
307 |
$1_CXXFLAGS := $$($1_CFLAGS_INCLUDE) $(CXXFLAGS_JDKLIB) $(CXXFLAGS_DEBUG_SYMBOLS) |
|
308 |
||
309 |
ifeq ($$($1_TOOLCHAIN), TOOLCHAIN_LINK_CXX) |
|
310 |
# For C++, we also need some special treatment. |
|
311 |
$1_LDFLAGS := $(LDFLAGS_CXX_JDK) |
|
312 |
$1_LIBS := $(LIBCXX) |
|
313 |
||
314 |
ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc) |
|
315 |
$1_CXXFLAGS := $$(filter-out -xregs=no%appl, $$($1_CXXFLAGS)) |
|
316 |
endif |
|
20547 | 317 |
endif |
13164 | 318 |
|
20547 | 319 |
# Remove the -incremental:no setting to get .ilk-files like in the old build. |
33502 | 320 |
$$(eval $$(call SetupNativeCompilation, BUILD_DEMO_JVMTI_NATIVE_$1, \ |
321 |
SRC := $$($1_SRC), \ |
|
322 |
TOOLCHAIN := $$($1_TOOLCHAIN), \ |
|
20547 | 323 |
OPTIMIZATION := LOW, \ |
33502 | 324 |
CFLAGS := $$($1_CFLAGS_INCLUDE) $$(CFLAGS_JDKLIB) $$(CFLAGS_DEBUG_SYMBOLS), \ |
20547 | 325 |
CXXFLAGS := $$($1_CXXFLAGS), \ |
33502 | 326 |
LDFLAGS := $(filter-out -incremental:no -opt:ref, $(LDFLAGS_JDKLIB)) \ |
327 |
$$($1_LDFLAGS), \ |
|
20547 | 328 |
LDFLAGS_macosx := $(call SET_EXECUTABLE_ORIGIN), \ |
33502 | 329 |
LIBS := $$($1_LIBS), \ |
330 |
LIBS_solaris := -lc, \ |
|
29925
6d47adfc6b47
8077847: Better handling of Windows executable manifest version
ihse
parents:
29392
diff
changeset
|
331 |
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \ |
20547 | 332 |
RC_FLAGS := $$(RC_FLAGS) \ |
333 |
-D "JDK_FNAME=$1.dll" \ |
|
334 |
-D "JDK_INTERNAL_NAME=$1" \ |
|
335 |
-D "JDK_FTYPE=0x2L", \ |
|
33502 | 336 |
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/demos/native/jvmti/$1, \ |
337 |
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/lib, \ |
|
338 |
LIBRARY := $1, \ |
|
339 |
)) |
|
340 |
||
341 |
$1 += $$(BUILD_DEMO_JVMTI_NATIVE_$1) |
|
342 |
||
343 |
### Build the jar, if we have java sources |
|
344 |
ifneq ($$(wildcard $(DEMO_SHARE_SRC)/jvmti/$1/*.java), ) |
|
345 |
$$(eval $$(call SetupJavaCompilation, BUILD_DEMO_JVMTI_JAVA_$1, \ |
|
346 |
SETUP := GENERATE_USINGJDKBYTECODE, \ |
|
347 |
SRC := $(DEMO_SHARE_SRC)/jvmti/$1, \ |
|
348 |
BIN := $(SUPPORT_OUTPUTDIR)/demos/classes/jvmti/$1, \ |
|
349 |
COPY := $(COPY_TO_JAR), \ |
|
350 |
JAR := $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/$1.jar, \ |
|
351 |
EXTRA_MANIFEST_ATTR := Main-Class: \n, \ |
|
352 |
MANIFEST := $(DEMO_MANIFEST), \ |
|
353 |
)) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
354 |
|
33502 | 355 |
$1 += $$(BUILD_DEMO_JVMTI_JAVA_$1_JAR) |
356 |
endif |
|
357 |
||
358 |
### Build the source zip |
|
359 |
$1_EXCLUDE_FILES := \ |
|
360 |
$$(wildcard $$(patsubst %, $(DEMO_SHARE_SRC)/jvmti/%/README.txt, \ |
|
361 |
agent_util $$($1_EXTRA_SRC_SUBDIR))) \ |
|
362 |
$$(wildcard $$(patsubst %, $(DEMO_SHARE_SRC)/jvmti/%/sample.makefile.txt, \ |
|
363 |
agent_util $$($1_EXTRA_SRC_SUBDIR))) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
364 |
|
33502 | 365 |
$$(eval $$(call SetupZipArchive, BUILD_DEMO_JVMTI_SRC_$1, \ |
366 |
SRC := $$($1_SRC), \ |
|
367 |
EXCLUDE_FILES := $$($1_EXCLUDE_FILES), \ |
|
368 |
ZIP := $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/src.zip, \ |
|
369 |
)) |
|
370 |
||
371 |
$1 += $$(BUILD_DEMO_JVMTI_SRC_$1) |
|
372 |
||
373 |
# Copy files to image |
|
374 |
$(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/README.txt: $(DEMO_SHARE_SRC)/jvmti/$1/README.txt |
|
20547 | 375 |
$$(call install-file) |
376 |
$(CHMOD) -f ug+w $$@ |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
377 |
|
33502 | 378 |
$1 += $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/README.txt |
379 |
||
380 |
ifeq ($(OPENJDK_TARGET_OS), windows) |
|
381 |
# These lib and exp files normally end up in OBJECT_DIR but for demos they |
|
382 |
# are supposed to be included in the distro. Since they are created as |
|
383 |
# a side-effect of the library compilation, make does not know about them. |
|
384 |
$1_SUPPORT_OUTPUTDIR := $(SUPPORT_OUTPUTDIR)/demos/native/jvmti/$1 |
|
385 |
$1_IMAGE_OUTPUTDIR := $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/lib |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
386 |
|
33502 | 387 |
$$($1_SUPPORT_OUTPUTDIR)/$1.lib: $$(BUILD_DEMO_JVMTI_NATIVE_$1) |
388 |
||
389 |
$$($1_SUPPORT_OUTPUTDIR)/$1.exp: $$(BUILD_DEMO_JVMTI_NATIVE_$1) |
|
390 |
||
391 |
$$($1_IMAGE_OUTPUTDIR)/$1.lib: $$($1_SUPPORT_OUTPUTDIR)/$1.lib |
|
392 |
$$(call install-file) |
|
393 |
||
394 |
$$($1_IMAGE_OUTPUTDIR)/$1.exp: $$($1_SUPPORT_OUTPUTDIR)/$1.exp |
|
395 |
$$(call install-file) |
|
396 |
||
397 |
$1 += $$($1_IMAGE_OUTPUTDIR)/$1.lib $$($1_IMAGE_OUTPUTDIR)/$1.exp |
|
20547 | 398 |
endif |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
399 |
|
33502 | 400 |
TARGETS += $$($1) |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
401 |
endef |
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
402 |
|
33502 | 403 |
$(eval $(call SetupBuildJvmtiDemo, compiledMethodLoad)) |
404 |
$(eval $(call SetupBuildJvmtiDemo, gctest)) |
|
405 |
$(eval $(call SetupBuildJvmtiDemo, heapViewer)) |
|
406 |
$(eval $(call SetupBuildJvmtiDemo, versionCheck)) |
|
407 |
||
408 |
$(eval $(call SetupBuildJvmtiDemo, heapTracker, \ |
|
409 |
EXTRA_SRC_SUBDIR := java_crw_demo, \ |
|
410 |
)) |
|
411 |
||
412 |
$(eval $(call SetupBuildJvmtiDemo, minst, \ |
|
413 |
EXTRA_SRC_SUBDIR := java_crw_demo, \ |
|
414 |
)) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
415 |
|
33502 | 416 |
$(eval $(call SetupBuildJvmtiDemo, mtrace, \ |
417 |
EXTRA_SRC_SUBDIR := java_crw_demo, \ |
|
418 |
)) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
419 |
|
33502 | 420 |
$(eval $(call SetupBuildJvmtiDemo, waiters, \ |
421 |
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \ |
|
422 |
)) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
423 |
|
33502 | 424 |
################################################################################ |
425 |
# Build the Poller demo (on Solaris only). |
|
426 |
||
427 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
|
428 |
DEMO_SOLARIS_SRC := $(JDK_TOPDIR)/src/demo/solaris |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
429 |
|
33502 | 430 |
$(eval $(call SetupJavaCompilation, BUILD_DEMO_JAVA_Poller, \ |
431 |
SETUP := GENERATE_USINGJDKBYTECODE, \ |
|
432 |
SRC := $(DEMO_SOLARIS_SRC)/jni/Poller, \ |
|
433 |
BIN := $(SUPPORT_OUTPUTDIR)/demos/classes/jni/Poller, \ |
|
434 |
HEADERS := $(SUPPORT_OUTPUTDIR)/demos/classes/jni/Poller, \ |
|
435 |
JAR := $(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/Poller.jar, \ |
|
436 |
MANIFEST := $(SUPPORT_OUTPUTDIR)/demos/java-main-manifest.mf, \ |
|
437 |
SRCZIP := $(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/src.zip, \ |
|
438 |
COPY := README.txt Poller.c, \ |
|
439 |
JARMAIN := Client, \ |
|
440 |
)) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
441 |
|
33502 | 442 |
TARGETS += $(BUILD_DEMO_JAVA_Poller) |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
443 |
|
33502 | 444 |
$(eval $(call SetupNativeCompilation, BUILD_DEMO_NATIVE_Poller, \ |
445 |
SRC := $(DEMO_SOLARIS_SRC)/jni/Poller, \ |
|
446 |
OPTIMIZATION := LOW, \ |
|
447 |
CFLAGS := $(CFLAGS_JDKLIB) \ |
|
448 |
-I$(SUPPORT_OUTPUTDIR)/demos/classes/jni/Poller, \ |
|
449 |
LDFLAGS := $(LDFLAGS_JDKLIB), \ |
|
450 |
LIBS_solaris := -lc, \ |
|
451 |
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/demos/native/jni/Poller, \ |
|
452 |
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/demos/native, \ |
|
453 |
LIBRARY := Poller, \ |
|
454 |
)) |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
455 |
|
33502 | 456 |
TARGETS += $(BUILD_DEMO_NATIVE_Poller) |
457 |
||
458 |
# We can only compile native code after java has been compiled (since we |
|
459 |
# depend on generated .h files) |
|
460 |
$(SUPPORT_OUTPUTDIR)/demos/native/jni/Poller/Poller.o: \ |
|
461 |
$(BUILD_DEMO_JAVA_POLLER_COMPILE_TARGETS) |
|
462 |
||
463 |
# Copy to image |
|
464 |
$(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/README.txt: \ |
|
465 |
$(DEMO_SOLARIS_SRC)/jni/Poller/README.txt |
|
16636
1cc691bcfe50
8008373: JFR JTReg tests fail with CompilationError on MacOSX; missing '._sunec.jar'
erikj
parents:
15676
diff
changeset
|
466 |
$(call install-file) |
12892 | 467 |
$(CHMOD) -f ug+w $@ |
468 |
||
33502 | 469 |
TARGETS += $(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/README.txt |
12892 | 470 |
|
33502 | 471 |
$(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/lib/libPoller.so: \ |
472 |
$(SUPPORT_OUTPUTDIR)/demos/native/libPoller.so |
|
16636
1cc691bcfe50
8008373: JFR JTReg tests fail with CompilationError on MacOSX; missing '._sunec.jar'
erikj
parents:
15676
diff
changeset
|
473 |
$(call install-file) |
12892 | 474 |
|
33502 | 475 |
TARGETS += $(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/lib/libPoller.so |
476 |
endif |
|
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
477 |
|
33502 | 478 |
################################################################################ |
479 |
# Copy html and README files. |
|
12892 | 480 |
|
33502 | 481 |
$(SUPPORT_OUTPUTDIR)/demos/image/management/index.html: $(DEMO_SHARE_SRC)/management/index.html |
16636
1cc691bcfe50
8008373: JFR JTReg tests fail with CompilationError on MacOSX; missing '._sunec.jar'
erikj
parents:
15676
diff
changeset
|
482 |
$(call install-file) |
1cc691bcfe50
8008373: JFR JTReg tests fail with CompilationError on MacOSX; missing '._sunec.jar'
erikj
parents:
15676
diff
changeset
|
483 |
$(CHMOD) -f ug+w $@ |
12892 | 484 |
|
33502 | 485 |
$(SUPPORT_OUTPUTDIR)/demos/image/jvmti/index.html: $(DEMO_SHARE_SRC)/jvmti/index.html |
16636
1cc691bcfe50
8008373: JFR JTReg tests fail with CompilationError on MacOSX; missing '._sunec.jar'
erikj
parents:
15676
diff
changeset
|
486 |
$(call install-file) |
1cc691bcfe50
8008373: JFR JTReg tests fail with CompilationError on MacOSX; missing '._sunec.jar'
erikj
parents:
15676
diff
changeset
|
487 |
$(CHMOD) -f ug+w $@ |
12892 | 488 |
|
33502 | 489 |
$(SUPPORT_OUTPUTDIR)/demos/image/README: $(DEMO_SHARE_SRC)/README |
16636
1cc691bcfe50
8008373: JFR JTReg tests fail with CompilationError on MacOSX; missing '._sunec.jar'
erikj
parents:
15676
diff
changeset
|
490 |
$(call install-file) |
12892 | 491 |
|
33502 | 492 |
TARGETS += $(SUPPORT_OUTPUTDIR)/demos/image/management/index.html \ |
493 |
$(SUPPORT_OUTPUTDIR)/demos/image/jvmti/index.html \ |
|
494 |
$(SUPPORT_OUTPUTDIR)/demos/image/README |
|
495 |
||
496 |
################################################################################ |
|
497 |
# Copy netbeans project files. |
|
12892 | 498 |
|
33502 | 499 |
$(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%: $(DEMO_SHARE_SRC)/nbproject/% |
500 |
$(call install-file) |
|
501 |
$(CHMOD) -f ug+w $@ |
|
502 |
||
503 |
ifeq ($(OPENJDK_TARGET_OS), solaris) |
|
504 |
TARGETS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \ |
|
505 |
$(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%, \ |
|
506 |
$(filter-out $(DEMO_SHARE_SRC)/nbproject/jfc/SwingApplet%, \ |
|
507 |
$(call CacheFind, $(DEMO_SHARE_SRC)/nbproject))) |
|
508 |
else |
|
509 |
TARGETS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \ |
|
510 |
$(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%, \ |
|
511 |
$(call CacheFind, $(DEMO_SHARE_SRC)/nbproject)) |
|
12892 | 512 |
endif |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
513 |
|
33502 | 514 |
################################################################################ |
12892 | 515 |
|
33502 | 516 |
# Hook to include the corresponding custom file, if present. |
517 |
$(eval $(call IncludeCustomExtension, jdk, CompileDemos.gmk)) |
|
16636
1cc691bcfe50
8008373: JFR JTReg tests fail with CompilationError on MacOSX; missing '._sunec.jar'
erikj
parents:
15676
diff
changeset
|
518 |
|
33502 | 519 |
all: $(TARGETS) |
12317
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
520 |
|
9670c1610c53
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
521 |
.PHONY: all |