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