annotate make/CompileDemos.gmk @ 13471:31ba5abc1e41

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