2012-04-10 15:22:03 +00:00
|
|
|
#
|
2015-03-09 09:39:50 +00:00
|
|
|
# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
|
2012-04-10 15:22:03 +00:00
|
|
|
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
#
|
|
|
|
# This code is free software; you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU General Public License version 2 only, as
|
|
|
|
# published by the Free Software Foundation. Oracle designates this
|
|
|
|
# particular file as subject to the "Classpath" exception as provided
|
|
|
|
# by Oracle in the LICENSE file that accompanied this code.
|
|
|
|
#
|
|
|
|
# This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
# version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
# accompanied this code).
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License version
|
|
|
|
# 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
#
|
|
|
|
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
# or visit www.oracle.com if you need additional information or have any
|
|
|
|
# questions.
|
|
|
|
#
|
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
################################################################################
|
|
|
|
# Build demos for the JDK into $(SUPPORT_OUTPUTDIR)/demos/image.
|
|
|
|
################################################################################
|
|
|
|
|
2012-04-10 15:22:03 +00:00
|
|
|
default: all
|
|
|
|
|
|
|
|
include $(SPEC)
|
|
|
|
include MakeBase.gmk
|
|
|
|
include JavaCompilation.gmk
|
|
|
|
include NativeCompilation.gmk
|
2014-08-21 09:05:35 +00:00
|
|
|
include SetupJavaCompilers.gmk
|
2015-05-19 08:05:02 +00:00
|
|
|
include TextFileProcessing.gmk
|
2015-11-03 16:48:19 +00:00
|
|
|
include ZipArchive.gmk
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2014-08-17 14:54:13 +00:00
|
|
|
# Prepare the find cache.
|
2016-01-16 12:01:44 +00:00
|
|
|
$(eval $(call FillCacheFind, $(wildcard $(JDK_TOPDIR)/src/demo \
|
|
|
|
$(JDK_TOPDIR)/src/*/demo)))
|
2012-12-27 19:18:42 +00:00
|
|
|
|
2012-04-10 15:22:03 +00:00
|
|
|
# Append demo goals to this variable.
|
2015-11-03 16:48:19 +00:00
|
|
|
TARGETS =
|
2012-04-10 15:22:03 +00:00
|
|
|
|
|
|
|
# The demo structure and contents should really be cleaned up.
|
|
|
|
# Now every other demo has its own quirks where to put the
|
|
|
|
# READMEs and other files.
|
|
|
|
|
2014-08-17 14:54:13 +00:00
|
|
|
DEMO_SHARE_SRC := $(JDK_TOPDIR)/src/demo/share
|
2015-04-16 12:48:11 +00:00
|
|
|
GLOBAL_VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/common/version.rc
|
2014-08-17 14:54:13 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
DEMO_MANIFEST := $(SUPPORT_OUTPUTDIR)/demos/java-main-manifest.mf
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
# This rule will be depended on due to the MANIFEST line in SetupBuildDemo
|
|
|
|
# and SetupBuildJvmtiDemo.
|
2015-05-19 08:05:02 +00:00
|
|
|
$(eval $(call SetupTextFileProcessing, BUILD_JAVA_MANIFEST, \
|
|
|
|
SOURCE_FILES := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
|
2015-11-03 16:48:19 +00:00
|
|
|
OUTPUT_FILE := $(DEMO_MANIFEST), \
|
2015-05-19 08:05:02 +00:00
|
|
|
REPLACEMENTS := \
|
2015-06-10 22:23:01 +00:00
|
|
|
@@VERSION_SPECIFICATION@@ => $(VERSION_SPECIFICATION) ; \
|
|
|
|
@@VERSION_SHORT@@ => $(VERSION_SHORT) ; \
|
2015-05-19 08:05:02 +00:00
|
|
|
@@COMPANY_NAME@@ => $(COMPANY_NAME) , \
|
|
|
|
))
|
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
################################################################################
|
|
|
|
# Build applet demos.
|
|
|
|
|
|
|
|
# Setup make rules for building a demo applet.
|
|
|
|
#
|
|
|
|
# Parameter 1 is the name of the rule. This name is used as variable prefix,
|
|
|
|
# and the targets generated are listed in a variable by that name. It is also
|
|
|
|
# used to locate the name of the applet subdir, and to determine the name
|
|
|
|
# of the output directory.
|
|
|
|
#
|
|
|
|
# Remaining parameters are named arguments. These include:
|
|
|
|
# SRC_DIR Alternative source directory to use for the demos.
|
|
|
|
# DISABLE_SJAVAC Passed to SetupJavaCompilation
|
|
|
|
|
|
|
|
SetupBuildAppletDemo = $(NamedParamsMacroTemplate)
|
|
|
|
define SetupBuildAppletDemoBody
|
|
|
|
ifeq ($$($1_SRC_DIR), )
|
|
|
|
$1_SRC_DIR := $(DEMO_SHARE_SRC)/applets
|
|
|
|
endif
|
|
|
|
|
|
|
|
$$(eval $$(call SetupJavaCompilation, BUILD_DEMO_APPLET_$1, \
|
2013-10-10 13:06:21 +00:00
|
|
|
SETUP := GENERATE_USINGJDKBYTECODE, \
|
2015-11-03 16:48:19 +00:00
|
|
|
SRC := $$($1_SRC_DIR)/$1, \
|
|
|
|
BIN := $(SUPPORT_OUTPUTDIR)/demos/image/applets/$1, \
|
2013-10-10 13:06:21 +00:00
|
|
|
COPY := .html .java .xyz .obj .au .gif, \
|
2015-11-03 16:48:19 +00:00
|
|
|
DISABLE_SJAVAC := $$($1_DISABLE_SJAVAC), \
|
|
|
|
))
|
|
|
|
|
|
|
|
$1 := $$(BUILD_DEMO_APPLET_$1)
|
|
|
|
|
|
|
|
TARGETS += $$($1)
|
2012-04-10 15:22:03 +00:00
|
|
|
endef
|
|
|
|
|
2013-11-21 20:01:45 +00:00
|
|
|
ifneq ($(OPENJDK_TARGET_OS), solaris)
|
2015-11-03 16:48:19 +00:00
|
|
|
$(eval $(call SetupBuildAppletDemo, ArcTest))
|
|
|
|
$(eval $(call SetupBuildAppletDemo, BarChart))
|
|
|
|
$(eval $(call SetupBuildAppletDemo, Blink))
|
|
|
|
$(eval $(call SetupBuildAppletDemo, CardTest))
|
|
|
|
$(eval $(call SetupBuildAppletDemo, Clock))
|
|
|
|
$(eval $(call SetupBuildAppletDemo, DitherTest))
|
|
|
|
$(eval $(call SetupBuildAppletDemo, DrawTest))
|
|
|
|
$(eval $(call SetupBuildAppletDemo, Fractal))
|
|
|
|
$(eval $(call SetupBuildAppletDemo, GraphicsTest))
|
|
|
|
$(eval $(call SetupBuildAppletDemo, NervousText))
|
|
|
|
$(eval $(call SetupBuildAppletDemo, SimpleGraph))
|
|
|
|
$(eval $(call SetupBuildAppletDemo, SortDemo))
|
|
|
|
$(eval $(call SetupBuildAppletDemo, SpreadSheet))
|
2012-04-10 15:22:03 +00:00
|
|
|
endif
|
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
################################################################################
|
|
|
|
# Build normal demos.
|
|
|
|
|
|
|
|
COPY_TO_JAR := .html .txt .properties .js .gif .jpg .theme .data .opt .c .h \
|
|
|
|
.png .ttf .xyz .obj README COPYRIGHT
|
|
|
|
|
|
|
|
COPY_TO_IMAGE := *.html *.txt *.png *.xml README*
|
|
|
|
|
|
|
|
# Setup make rules for building a demo.
|
|
|
|
#
|
|
|
|
# Parameter 1 is the name of the rule. This name is used as variable prefix,
|
|
|
|
# and the targets generated are listed in a variable by that name.
|
|
|
|
#
|
|
|
|
# Remaining parameters are named arguments. These include:
|
|
|
|
# DEMO_SUBDIR The name of the subdir of the demo, below the demo top dir.
|
|
|
|
# EXTRA_SRC_DIR Additional source directory.
|
|
|
|
# SRC_SUB_DIR Optional subdir to locate source code in
|
|
|
|
# SRC_DIR Alternative source directory to use for the demos.
|
|
|
|
# EXCLUDE_FILES Exclude file list
|
|
|
|
# JAR_NAME Base name of jar file. Defaults to $1.
|
|
|
|
# MAIN_CLASS The main class for the jar. Defaults to $1.
|
|
|
|
# EXTRA_COPY_TO_JAR Additional files to copy to jar (as patterns)
|
|
|
|
# EXTRA_COPY_TO_IMAGE Additional files to copy to images (as wildcards)
|
|
|
|
# EXTRA_MANIFEST_ATTR Extra manifest attribute
|
|
|
|
# SKIP_COMPILATION Skip Java compilation iff true
|
|
|
|
# DISABLE_SJAVAC Passed to SetupJavaCompilation
|
|
|
|
SetupBuildDemo = $(NamedParamsMacroTemplate)
|
|
|
|
define SetupBuildDemoBody
|
|
|
|
ifeq ($$($1_SRC_DIR), )
|
|
|
|
$1_SRC_DIR := $(DEMO_SHARE_SRC)
|
2013-10-10 13:06:21 +00:00
|
|
|
endif
|
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$1_SRC_BASE := $$($1_SRC_DIR)/$$($1_DEMO_SUBDIR)/$1
|
|
|
|
|
|
|
|
# In some demos the source is found in a subdir
|
|
|
|
ifneq ($$($1_SRC_SUB_DIR), )
|
|
|
|
$1_MAIN_SRC := $$($1_SRC_BASE)/$$($1_SRC_SUB_DIR)
|
2013-10-10 13:06:21 +00:00
|
|
|
else
|
2015-11-03 16:48:19 +00:00
|
|
|
# for allmost all
|
|
|
|
$1_MAIN_SRC := $$($1_SRC_BASE)
|
2013-10-10 13:06:21 +00:00
|
|
|
endif
|
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
# Default is to use demo name as jar file name.
|
|
|
|
ifeq ($$($1_JAR_NAME), )
|
|
|
|
$1_JAR_NAME := $1
|
2013-10-10 13:06:21 +00:00
|
|
|
endif
|
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
# Default is to use demo name as jar main class.
|
|
|
|
ifeq ($$($1_MAIN_CLASS), )
|
|
|
|
$1_MAIN_CLASS := $1
|
|
|
|
else ifeq ($$($1_MAIN_CLASS), NONE)
|
|
|
|
$1_MAIN_CLASS :=
|
|
|
|
$1_EXTRA_MANIFEST_ATTR += Main-Class: \n
|
|
|
|
endif
|
2013-10-10 13:06:21 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
ifneq ($$($1_SKIP_COMPILATION), true)
|
|
|
|
$$(eval $$(call SetupJavaCompilation, BUILD_DEMO_$1, \
|
|
|
|
SETUP := GENERATE_USINGJDKBYTECODE, \
|
|
|
|
SRC := $$($1_MAIN_SRC) $$($1_EXTRA_SRC_DIR), \
|
|
|
|
BIN := $(SUPPORT_OUTPUTDIR)/demos/classes/$$($1_DEMO_SUBDIR)/$1, \
|
|
|
|
COPY := $(COPY_TO_JAR) $$($1_EXTRA_COPY_TO_JAR), \
|
|
|
|
JAR := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1/$$($1_JAR_NAME).jar, \
|
|
|
|
JARMAIN := $$($1_MAIN_CLASS), \
|
|
|
|
MANIFEST := $(DEMO_MANIFEST), \
|
|
|
|
EXTRA_MANIFEST_ATTR := $$($1_EXTRA_MANIFEST_ATTR), \
|
|
|
|
SRCZIP := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1/src.zip, \
|
|
|
|
EXCLUDE_FILES := $$($1_EXCLUDE_FILES), \
|
|
|
|
DISABLE_SJAVAC := $$($1_DISABLE_SJAVAC), \
|
|
|
|
))
|
|
|
|
|
|
|
|
$1 += $$(BUILD_DEMO_$1)
|
2013-10-10 13:06:21 +00:00
|
|
|
endif
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
# Copy files. Sort is needed to remove duplicates.
|
|
|
|
$1_COPY_FILES := $$(sort $$(wildcard $$(addprefix $$($1_SRC_BASE)/, \
|
|
|
|
$(COPY_TO_IMAGE) $$($1_EXTRA_COPY_TO_IMAGE))))
|
|
|
|
$$(eval $$(call SetupCopyFiles, COPY_DEMO_$1, \
|
|
|
|
SRC := $$($1_SRC_BASE), \
|
|
|
|
DEST := $(SUPPORT_OUTPUTDIR)/demos/image/$$($1_DEMO_SUBDIR)/$1, \
|
|
|
|
FILES := $$($1_COPY_FILES), \
|
|
|
|
))
|
|
|
|
|
|
|
|
$1 += $$(COPY_DEMO_$1)
|
|
|
|
|
|
|
|
TARGETS += $$($1)
|
2012-04-10 15:22:03 +00:00
|
|
|
endef
|
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
CODEPOINT_SERVICE := java.awt.im.spi.InputMethodDescriptor
|
|
|
|
CODEPOINT_METAINF_SERVICE_FILE := \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demos/classes/jfc/CodePointIM/META-INF/services/$(CODEPOINT_SERVICE)
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$(eval $(call SetupBuildDemo, CodePointIM, \
|
|
|
|
DEMO_SUBDIR := jfc, \
|
|
|
|
EXTRA_COPY_TO_JAR := $(CODEPOINT_SERVICE), \
|
|
|
|
))
|
|
|
|
|
|
|
|
# We also need to copy the CODEPOINT_SERVICE file to the META-INF/services
|
|
|
|
# location, and make sure the jar depends on that file to get it included.
|
|
|
|
$(CODEPOINT_METAINF_SERVICE_FILE): $(DEMO_SHARE_SRC)/jfc/CodePointIM/$(CODEPOINT_SERVICE)
|
2013-10-10 13:06:21 +00:00
|
|
|
$(call install-file)
|
2015-11-03 16:48:19 +00:00
|
|
|
|
|
|
|
$(BUILD_DEMO_CodePointIM_JAR): $(CODEPOINT_METAINF_SERVICE_FILE)
|
|
|
|
|
|
|
|
ifneq ($(OPENJDK_TARGET_OS), solaris)
|
|
|
|
$(eval $(call SetupBuildDemo, MoleculeViewer, \
|
|
|
|
DEMO_SUBDIR := applets, \
|
|
|
|
MAIN_CLASS := XYZChemModel, \
|
|
|
|
EXTRA_COPY_TO_IMAGE := *.java, \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(eval $(call SetupBuildDemo, WireFrame, \
|
|
|
|
DEMO_SUBDIR := applets, \
|
|
|
|
MAIN_CLASS := ThreeD, \
|
|
|
|
EXTRA_COPY_TO_IMAGE := *.java, \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(eval $(call SetupBuildDemo, SwingApplet, \
|
|
|
|
DEMO_SUBDIR := jfc, \
|
|
|
|
))
|
2012-04-10 15:22:03 +00:00
|
|
|
endif
|
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$(eval $(call SetupBuildDemo, FileChooserDemo, \
|
|
|
|
DEMO_SUBDIR := jfc, \
|
|
|
|
))
|
2013-10-10 13:06:21 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$(eval $(call SetupBuildDemo, Font2DTest, \
|
|
|
|
DEMO_SUBDIR := jfc, \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(eval $(call SetupBuildDemo, Metalworks, \
|
|
|
|
DEMO_SUBDIR := jfc, \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(eval $(call SetupBuildDemo, Notepad, \
|
|
|
|
DEMO_SUBDIR := jfc, \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(eval $(call SetupBuildDemo, SampleTree, \
|
|
|
|
DEMO_SUBDIR := jfc, \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(eval $(call SetupBuildDemo, TableExample, \
|
|
|
|
DEMO_SUBDIR := jfc, \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(eval $(call SetupBuildDemo, TransparentRuler, \
|
|
|
|
DEMO_SUBDIR := jfc, \
|
|
|
|
MAIN_CLASS := transparentruler.Ruler, \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(eval $(call SetupBuildDemo, jconsole-plugin, \
|
|
|
|
DEMO_SUBDIR := scripting, \
|
|
|
|
SRC_SUB_DIR := src, \
|
|
|
|
MAIN_CLASS := NONE, \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(eval $(call SetupBuildDemo, FullThreadDump, \
|
|
|
|
DEMO_SUBDIR := management, \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(eval $(call SetupBuildDemo, JTop, \
|
|
|
|
DEMO_SUBDIR := management, \
|
|
|
|
))
|
2013-10-10 13:06:21 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$(eval $(call SetupBuildDemo, MemoryMonitor, \
|
|
|
|
DEMO_SUBDIR := management, \
|
|
|
|
))
|
|
|
|
|
|
|
|
$(eval $(call SetupBuildDemo, VerboseGC, \
|
|
|
|
DEMO_SUBDIR := management, \
|
|
|
|
))
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Build JVMTI demos.
|
|
|
|
|
|
|
|
# Setup make rules for building a JVMTI demo.
|
|
|
|
#
|
|
|
|
# Parameter 1 is the name of the rule. This name is used as variable prefix,
|
|
|
|
# and the targets generated are listed in a variable by that name.
|
|
|
|
#
|
|
|
|
# Remaining parameters are named arguments. These include:
|
|
|
|
# EXTRA_SRC_SUBDIR Also include these subdirectories
|
|
|
|
# TOOLCHAIN Optionally specify toolchain to use
|
|
|
|
SetupBuildJvmtiDemo = $(NamedParamsMacroTemplate)
|
|
|
|
define SetupBuildJvmtiDemoBody
|
|
|
|
$1_SRC := \
|
|
|
|
$(DEMO_SHARE_SRC)/jvmti/$1 \
|
|
|
|
$$(wildcard $$(addprefix $(DEMO_SHARE_SRC)/jvmti/, \
|
|
|
|
agent_util $$($1_EXTRA_SRC_SUBDIR)))
|
|
|
|
|
|
|
|
### Build the native lib
|
|
|
|
$1_CFLAGS_INCLUDE := $$(addprefix -I, $$($1_SRC))
|
|
|
|
|
|
|
|
$1_CXXFLAGS := $$($1_CFLAGS_INCLUDE) $(CXXFLAGS_JDKLIB) $(CXXFLAGS_DEBUG_SYMBOLS)
|
|
|
|
|
|
|
|
ifeq ($$($1_TOOLCHAIN), TOOLCHAIN_LINK_CXX)
|
|
|
|
# For C++, we also need some special treatment.
|
2015-12-15 10:02:12 +00:00
|
|
|
$1_LDFLAGS := $$(LDFLAGS_CXX_JDK)
|
2015-11-03 16:48:19 +00:00
|
|
|
$1_LIBS := $(LIBCXX)
|
|
|
|
|
|
|
|
ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
|
|
|
|
$1_CXXFLAGS := $$(filter-out -xregs=no%appl, $$($1_CXXFLAGS))
|
|
|
|
endif
|
|
|
|
endif
|
2013-10-10 13:06:21 +00:00
|
|
|
|
|
|
|
# Remove the -incremental:no setting to get .ilk-files like in the old build.
|
2015-11-03 16:48:19 +00:00
|
|
|
$$(eval $$(call SetupNativeCompilation, BUILD_DEMO_JVMTI_NATIVE_$1, \
|
|
|
|
SRC := $$($1_SRC), \
|
|
|
|
TOOLCHAIN := $$($1_TOOLCHAIN), \
|
2013-10-10 13:06:21 +00:00
|
|
|
OPTIMIZATION := LOW, \
|
2015-11-03 16:48:19 +00:00
|
|
|
CFLAGS := $$($1_CFLAGS_INCLUDE) $$(CFLAGS_JDKLIB) $$(CFLAGS_DEBUG_SYMBOLS), \
|
2013-10-10 13:06:21 +00:00
|
|
|
CXXFLAGS := $$($1_CXXFLAGS), \
|
2015-12-15 10:02:12 +00:00
|
|
|
LDFLAGS := $(filter-out -incremental:no -opt:ref, $$(LDFLAGS_JDKLIB)) \
|
2015-11-03 16:48:19 +00:00
|
|
|
$$($1_LDFLAGS), \
|
2015-12-15 10:02:12 +00:00
|
|
|
LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN), \
|
2015-11-03 16:48:19 +00:00
|
|
|
LIBS := $$($1_LIBS), \
|
|
|
|
LIBS_solaris := -lc, \
|
2015-04-16 12:48:11 +00:00
|
|
|
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
2013-10-10 13:06:21 +00:00
|
|
|
RC_FLAGS := $$(RC_FLAGS) \
|
|
|
|
-D "JDK_FNAME=$1.dll" \
|
|
|
|
-D "JDK_INTERNAL_NAME=$1" \
|
|
|
|
-D "JDK_FTYPE=0x2L", \
|
2015-11-03 16:48:19 +00:00
|
|
|
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/demos/native/jvmti/$1, \
|
|
|
|
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/lib, \
|
|
|
|
LIBRARY := $1, \
|
|
|
|
))
|
2013-10-10 13:06:21 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$1 += $$(BUILD_DEMO_JVMTI_NATIVE_$1)
|
2013-10-10 13:06:21 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
### Build the jar, if we have java sources
|
|
|
|
ifneq ($$(wildcard $(DEMO_SHARE_SRC)/jvmti/$1/*.java), )
|
|
|
|
$$(eval $$(call SetupJavaCompilation, BUILD_DEMO_JVMTI_JAVA_$1, \
|
2013-10-10 13:06:21 +00:00
|
|
|
SETUP := GENERATE_USINGJDKBYTECODE, \
|
2014-08-17 14:54:13 +00:00
|
|
|
SRC := $(DEMO_SHARE_SRC)/jvmti/$1, \
|
2015-11-03 16:48:19 +00:00
|
|
|
BIN := $(SUPPORT_OUTPUTDIR)/demos/classes/jvmti/$1, \
|
|
|
|
COPY := $(COPY_TO_JAR), \
|
|
|
|
JAR := $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/$1.jar, \
|
2013-10-10 13:06:21 +00:00
|
|
|
EXTRA_MANIFEST_ATTR := Main-Class: \n, \
|
2015-11-03 16:48:19 +00:00
|
|
|
MANIFEST := $(DEMO_MANIFEST), \
|
|
|
|
))
|
2013-10-10 13:06:21 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$1 += $$(BUILD_DEMO_JVMTI_JAVA_$1_JAR)
|
2013-10-10 13:06:21 +00:00
|
|
|
endif
|
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
### Build the source zip
|
|
|
|
$1_EXCLUDE_FILES := \
|
|
|
|
$$(wildcard $$(patsubst %, $(DEMO_SHARE_SRC)/jvmti/%/README.txt, \
|
|
|
|
agent_util $$($1_EXTRA_SRC_SUBDIR))) \
|
|
|
|
$$(wildcard $$(patsubst %, $(DEMO_SHARE_SRC)/jvmti/%/sample.makefile.txt, \
|
|
|
|
agent_util $$($1_EXTRA_SRC_SUBDIR)))
|
2013-10-10 13:06:21 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$$(eval $$(call SetupZipArchive, BUILD_DEMO_JVMTI_SRC_$1, \
|
|
|
|
SRC := $$($1_SRC), \
|
|
|
|
EXCLUDE_FILES := $$($1_EXCLUDE_FILES), \
|
|
|
|
ZIP := $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/src.zip, \
|
|
|
|
))
|
2013-10-10 13:06:21 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$1 += $$(BUILD_DEMO_JVMTI_SRC_$1)
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
# Copy files to image
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/README.txt: $(DEMO_SHARE_SRC)/jvmti/$1/README.txt
|
|
|
|
$$(call install-file)
|
|
|
|
$(CHMOD) -f ug+w $$@
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$1 += $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/README.txt
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
ifeq ($(OPENJDK_TARGET_OS), windows)
|
|
|
|
# These lib and exp files normally end up in OBJECT_DIR but for demos they
|
|
|
|
# are supposed to be included in the distro. Since they are created as
|
|
|
|
# a side-effect of the library compilation, make does not know about them.
|
|
|
|
$1_SUPPORT_OUTPUTDIR := $(SUPPORT_OUTPUTDIR)/demos/native/jvmti/$1
|
|
|
|
$1_IMAGE_OUTPUTDIR := $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/lib
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$$($1_SUPPORT_OUTPUTDIR)/$1.lib: $$(BUILD_DEMO_JVMTI_NATIVE_$1)
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$$($1_SUPPORT_OUTPUTDIR)/$1.exp: $$(BUILD_DEMO_JVMTI_NATIVE_$1)
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$$($1_IMAGE_OUTPUTDIR)/$1.lib: $$($1_SUPPORT_OUTPUTDIR)/$1.lib
|
|
|
|
$$(call install-file)
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$$($1_IMAGE_OUTPUTDIR)/$1.exp: $$($1_SUPPORT_OUTPUTDIR)/$1.exp
|
|
|
|
$$(call install-file)
|
2012-06-08 03:40:50 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$1 += $$($1_IMAGE_OUTPUTDIR)/$1.lib $$($1_IMAGE_OUTPUTDIR)/$1.exp
|
|
|
|
endif
|
2012-06-08 03:40:50 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
TARGETS += $$($1)
|
|
|
|
endef
|
2012-06-08 03:40:50 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$(eval $(call SetupBuildJvmtiDemo, compiledMethodLoad))
|
|
|
|
$(eval $(call SetupBuildJvmtiDemo, gctest))
|
|
|
|
$(eval $(call SetupBuildJvmtiDemo, heapViewer))
|
|
|
|
$(eval $(call SetupBuildJvmtiDemo, versionCheck))
|
2012-06-08 03:40:50 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$(eval $(call SetupBuildJvmtiDemo, heapTracker, \
|
|
|
|
EXTRA_SRC_SUBDIR := java_crw_demo, \
|
|
|
|
))
|
2012-06-08 03:40:50 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$(eval $(call SetupBuildJvmtiDemo, minst, \
|
|
|
|
EXTRA_SRC_SUBDIR := java_crw_demo, \
|
|
|
|
))
|
2012-06-08 03:40:50 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$(eval $(call SetupBuildJvmtiDemo, mtrace, \
|
|
|
|
EXTRA_SRC_SUBDIR := java_crw_demo, \
|
|
|
|
))
|
2012-06-08 03:40:50 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$(eval $(call SetupBuildJvmtiDemo, waiters, \
|
|
|
|
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
|
|
|
))
|
2012-06-08 03:40:50 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
################################################################################
|
|
|
|
# Build the Poller demo (on Solaris only).
|
2012-06-08 03:40:50 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
|
|
|
DEMO_SOLARIS_SRC := $(JDK_TOPDIR)/src/demo/solaris
|
2013-10-10 13:06:21 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$(eval $(call SetupJavaCompilation, BUILD_DEMO_JAVA_Poller, \
|
2013-10-10 13:06:21 +00:00
|
|
|
SETUP := GENERATE_USINGJDKBYTECODE, \
|
2014-08-17 14:54:13 +00:00
|
|
|
SRC := $(DEMO_SOLARIS_SRC)/jni/Poller, \
|
2015-11-03 16:48:19 +00:00
|
|
|
BIN := $(SUPPORT_OUTPUTDIR)/demos/classes/jni/Poller, \
|
|
|
|
HEADERS := $(SUPPORT_OUTPUTDIR)/demos/classes/jni/Poller, \
|
|
|
|
JAR := $(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/Poller.jar, \
|
|
|
|
MANIFEST := $(SUPPORT_OUTPUTDIR)/demos/java-main-manifest.mf, \
|
|
|
|
SRCZIP := $(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/src.zip, \
|
2013-10-10 13:06:21 +00:00
|
|
|
COPY := README.txt Poller.c, \
|
2015-11-03 16:48:19 +00:00
|
|
|
JARMAIN := Client, \
|
|
|
|
))
|
2013-10-10 13:06:21 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
TARGETS += $(BUILD_DEMO_JAVA_Poller)
|
2013-10-10 13:06:21 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$(eval $(call SetupNativeCompilation, BUILD_DEMO_NATIVE_Poller, \
|
2014-08-17 14:54:13 +00:00
|
|
|
SRC := $(DEMO_SOLARIS_SRC)/jni/Poller, \
|
2013-10-10 13:06:21 +00:00
|
|
|
OPTIMIZATION := LOW, \
|
2015-05-08 08:37:14 +00:00
|
|
|
CFLAGS := $(CFLAGS_JDKLIB) \
|
2015-11-03 16:48:19 +00:00
|
|
|
-I$(SUPPORT_OUTPUTDIR)/demos/classes/jni/Poller, \
|
2013-10-10 13:06:21 +00:00
|
|
|
LDFLAGS := $(LDFLAGS_JDKLIB), \
|
2015-10-29 15:31:00 +00:00
|
|
|
LIBS_solaris := -lc, \
|
2015-11-03 16:48:19 +00:00
|
|
|
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/demos/native/jni/Poller, \
|
|
|
|
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/demos/native, \
|
|
|
|
LIBRARY := Poller, \
|
|
|
|
))
|
2013-10-10 13:06:21 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
TARGETS += $(BUILD_DEMO_NATIVE_Poller)
|
2013-10-10 13:06:21 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
# We can only compile native code after java has been compiled (since we
|
|
|
|
# depend on generated .h files)
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demos/native/jni/Poller/Poller.o: \
|
2015-12-11 10:46:45 +00:00
|
|
|
$(BUILD_DEMO_JAVA_Poller)
|
2015-11-03 16:48:19 +00:00
|
|
|
|
|
|
|
# Copy to image
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/README.txt: \
|
|
|
|
$(DEMO_SOLARIS_SRC)/jni/Poller/README.txt
|
2013-04-05 07:39:10 +00:00
|
|
|
$(call install-file)
|
2015-11-03 16:48:19 +00:00
|
|
|
$(CHMOD) -f ug+w $@
|
2012-06-08 03:40:50 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
TARGETS += $(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/README.txt
|
2012-06-08 03:40:50 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/lib/libPoller.so: \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demos/native/libPoller.so
|
|
|
|
$(call install-file)
|
|
|
|
|
|
|
|
TARGETS += $(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/lib/libPoller.so
|
2012-06-08 03:40:50 +00:00
|
|
|
endif
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
################################################################################
|
|
|
|
# Copy html and README files.
|
|
|
|
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demos/image/management/index.html: $(DEMO_SHARE_SRC)/management/index.html
|
|
|
|
$(call install-file)
|
|
|
|
$(CHMOD) -f ug+w $@
|
|
|
|
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demos/image/jvmti/index.html: $(DEMO_SHARE_SRC)/jvmti/index.html
|
|
|
|
$(call install-file)
|
|
|
|
$(CHMOD) -f ug+w $@
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demos/image/README: $(DEMO_SHARE_SRC)/README
|
|
|
|
$(call install-file)
|
2012-06-08 03:40:50 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
TARGETS += $(SUPPORT_OUTPUTDIR)/demos/image/management/index.html \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demos/image/jvmti/index.html \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demos/image/README
|
2012-06-08 03:40:50 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
################################################################################
|
|
|
|
# Copy netbeans project files.
|
2013-04-05 07:39:10 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%: $(DEMO_SHARE_SRC)/nbproject/%
|
|
|
|
$(call install-file)
|
|
|
|
$(CHMOD) -f ug+w $@
|
|
|
|
|
|
|
|
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
|
|
|
TARGETS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%, \
|
|
|
|
$(filter-out $(DEMO_SHARE_SRC)/nbproject/jfc/SwingApplet%, \
|
|
|
|
$(call CacheFind, $(DEMO_SHARE_SRC)/nbproject)))
|
|
|
|
else
|
|
|
|
TARGETS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%, \
|
|
|
|
$(call CacheFind, $(DEMO_SHARE_SRC)/nbproject))
|
2012-06-08 03:40:50 +00:00
|
|
|
endif
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
################################################################################
|
|
|
|
|
|
|
|
# Hook to include the corresponding custom file, if present.
|
|
|
|
$(eval $(call IncludeCustomExtension, jdk, CompileDemos.gmk))
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2015-11-03 16:48:19 +00:00
|
|
|
all: $(TARGETS)
|
2012-04-10 15:22:03 +00:00
|
|
|
|
|
|
|
.PHONY: all
|