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