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.
|
|
|
|
#
|
|
|
|
|
|
|
|
default: all
|
|
|
|
|
|
|
|
include $(SPEC)
|
|
|
|
include MakeBase.gmk
|
|
|
|
include JavaCompilation.gmk
|
|
|
|
include NativeCompilation.gmk
|
2014-08-21 09:05:35 +00:00
|
|
|
include SetupJavaCompilers.gmk
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2014-08-17 14:54:13 +00:00
|
|
|
# Prepare the find cache.
|
2013-10-10 13:06:21 +00:00
|
|
|
$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src))
|
2012-12-27 19:18:42 +00:00
|
|
|
|
2012-04-10 15:22:03 +00:00
|
|
|
# Append demo goals to this variable.
|
2013-10-10 13:06:21 +00:00
|
|
|
BUILD_DEMOS =
|
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
|
|
|
|
DEMO_CLOSED_SHARE_SRC := $(JDK_TOPDIR)/src/closed/demo/share
|
|
|
|
DEMO_SOLARIS_SRC := $(JDK_TOPDIR)/src/demo/solaris
|
2014-11-21 15:05:11 +00:00
|
|
|
DEMO_OS_TYPE_SRC := $(JDK_TOPDIR)/src/demo/$(OPENJDK_TARGET_OS_TYPE)
|
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
|
|
|
|
2012-04-10 15:22:03 +00:00
|
|
|
##################################################################################################
|
|
|
|
|
|
|
|
define SetupAppletDemo
|
2013-10-10 13:06:21 +00:00
|
|
|
$$(eval $$(call SetupJavaCompilation,BUILD_DEMO_APPLET_$1, \
|
|
|
|
SETUP := GENERATE_USINGJDKBYTECODE, \
|
2014-08-17 14:54:13 +00:00
|
|
|
SRC := $(JDK_TOPDIR)/src/$3demo/share/applets/$1, \
|
2014-12-03 14:22:58 +00:00
|
|
|
BIN := $(SUPPORT_OUTPUTDIR)/demo/image/applets/$1, \
|
2013-10-10 13:06:21 +00:00
|
|
|
COPY := .html .java .xyz .obj .au .gif, \
|
|
|
|
DISABLE_SJAVAC := $2))
|
|
|
|
BUILD_DEMOS += $$(BUILD_DEMO_APPLET_$1)
|
2012-04-10 15:22:03 +00:00
|
|
|
endef
|
|
|
|
|
2013-11-21 20:01:45 +00:00
|
|
|
ifneq ($(OPENJDK_TARGET_OS), solaris)
|
|
|
|
$(eval $(call SetupAppletDemo,ArcTest))
|
|
|
|
$(eval $(call SetupAppletDemo,BarChart))
|
|
|
|
$(eval $(call SetupAppletDemo,Blink))
|
|
|
|
$(eval $(call SetupAppletDemo,CardTest))
|
|
|
|
$(eval $(call SetupAppletDemo,Clock))
|
|
|
|
$(eval $(call SetupAppletDemo,DitherTest))
|
|
|
|
$(eval $(call SetupAppletDemo,DrawTest))
|
|
|
|
$(eval $(call SetupAppletDemo,Fractal))
|
|
|
|
$(eval $(call SetupAppletDemo,GraphicsTest))
|
|
|
|
$(eval $(call SetupAppletDemo,NervousText))
|
|
|
|
$(eval $(call SetupAppletDemo,SimpleGraph))
|
|
|
|
$(eval $(call SetupAppletDemo,SortDemo))
|
|
|
|
$(eval $(call SetupAppletDemo,SpreadSheet))
|
|
|
|
|
|
|
|
ifndef OPENJDK
|
|
|
|
$(eval $(call SetupAppletDemo,Animator,,closed/))
|
|
|
|
$(eval $(call SetupAppletDemo,GraphLayout,true,closed/))
|
|
|
|
$(eval $(call SetupAppletDemo,JumpingBox,,closed/))
|
|
|
|
$(eval $(call SetupAppletDemo,TicTacToe,,closed/))
|
|
|
|
endif
|
2012-04-10 15:22:03 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
##################################################################################################
|
|
|
|
|
2013-10-10 13:06:21 +00:00
|
|
|
PATTERNS_TO_COPY = .html .txt .properties .js .gif .jpg .theme .data .opt README .c .h .png .ttf .xyz .obj
|
2012-04-10 15:22:03 +00:00
|
|
|
|
|
|
|
define SetupDemo
|
2013-10-10 13:06:21 +00:00
|
|
|
# Param 1 = Name of the demo
|
|
|
|
# Param 2 = Subdirectory of the demo below the demo directory.
|
|
|
|
# Param 3 = Additional javac flags.
|
|
|
|
# Param 4 = The main class for the jar.
|
|
|
|
# Param 5 = Additional source directory.
|
|
|
|
# Param 6 = Extra dir below $(JDK_TOPDIR)/src (closed)
|
|
|
|
# Param 7 = List of files to copy
|
|
|
|
# Param 8 = Base name of jar file. Defaults to $1
|
|
|
|
# Param 9 = Exclude list
|
|
|
|
# Param 10 = Extra copy patterns
|
|
|
|
# Param 11 = Extra manifest attribute
|
|
|
|
# Param 12 = Suffix for compiler setup name
|
|
|
|
|
2014-08-17 14:54:13 +00:00
|
|
|
$1_SRC_BASE := $(JDK_TOPDIR)/src/$6demo/share/$2/$1
|
2013-10-10 13:06:21 +00:00
|
|
|
# In some demos the source is found in a subdir called src.
|
2014-08-17 14:54:13 +00:00
|
|
|
$1_MAIN_SRC := $$(wildcard $$($1_SRC_BASE)/src)
|
2013-10-10 13:06:21 +00:00
|
|
|
ifeq ($$($1_MAIN_SRC), )
|
2014-08-17 14:54:13 +00:00
|
|
|
$1_MAIN_SRC := $$($1_SRC_BASE)
|
2013-10-10 13:06:21 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($8, )
|
|
|
|
$1_JARFILE := $8.jar
|
|
|
|
else
|
|
|
|
$1_JARFILE := $1.jar
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(findstring $1,Laffy SwingSet3), )
|
|
|
|
$$(eval $$(call SetupJavaCompilation,BUILD_DEMO_$1, \
|
|
|
|
SETUP := GENERATE_USINGJDKBYTECODE, \
|
|
|
|
ADD_JAVAC_FLAGS := $3, \
|
|
|
|
SRC := $$($1_MAIN_SRC) $5, \
|
2014-12-03 14:22:58 +00:00
|
|
|
BIN := $(SUPPORT_OUTPUTDIR)/demo/classes/$2/$1, \
|
2013-10-10 13:06:21 +00:00
|
|
|
COPY := $(PATTERNS_TO_COPY) $(10), \
|
2014-12-03 14:22:58 +00:00
|
|
|
JAR := $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/$$($1_JARFILE), \
|
2013-10-10 13:06:21 +00:00
|
|
|
JARMAIN := $4, \
|
2013-11-14 10:19:32 +00:00
|
|
|
MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
|
2013-10-10 13:06:21 +00:00
|
|
|
EXTRA_MANIFEST_ATTR := $(11), \
|
2014-12-03 14:22:58 +00:00
|
|
|
SRCZIP := $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/src.zip, \
|
2013-10-10 13:06:21 +00:00
|
|
|
EXCLUDE_FILES := $9, \
|
|
|
|
DISABLE_SJAVAC := $(12)))
|
|
|
|
|
|
|
|
BUILD_DEMOS += $$(BUILD_DEMO_$1) \
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/$$($1_JARFILE) \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/src.zip
|
2013-10-10 13:06:21 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Copy files.
|
2014-08-17 14:54:13 +00:00
|
|
|
$1_COPY_TARGETS := $$(patsubst $$($1_SRC_BASE)/%, \
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/%, \
|
2014-08-17 14:54:13 +00:00
|
|
|
$$(wildcard $$(addprefix $$($1_SRC_BASE)/, $7)))
|
2013-10-10 13:06:21 +00:00
|
|
|
ifneq ($7, )
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/%: $$($1_SRC_BASE)/%
|
2013-10-10 13:06:21 +00:00
|
|
|
$$(call install-file)
|
|
|
|
$(CHMOD) -f ug+w $$@
|
|
|
|
|
|
|
|
BUILD_DEMOS += $$($1_COPY_TARGETS)
|
|
|
|
endif
|
2012-04-10 15:22:03 +00:00
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call SetupDemo,CodePointIM,jfc,,CodePointIM,,,*.html))
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/_the.services: \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/CodePointIM.jar \
|
2014-08-17 14:54:13 +00:00
|
|
|
$(DEMO_SHARE_SRC)/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor
|
2014-12-03 14:22:58 +00:00
|
|
|
(cd $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM && \
|
2013-10-10 13:06:21 +00:00
|
|
|
$(MKDIR) -p _the.tmp/META-INF/services && \
|
2014-08-17 14:54:13 +00:00
|
|
|
$(CP) $(DEMO_SHARE_SRC)/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor _the.tmp/META-INF/services && \
|
2014-10-24 09:45:36 +00:00
|
|
|
cd ./_the.tmp && \
|
2014-12-03 14:22:58 +00:00
|
|
|
$(JAR) uf $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/CodePointIM.jar META-INF/services/java.awt.im.spi.InputMethodDescriptor && \
|
2014-10-24 09:45:36 +00:00
|
|
|
cd ./META-INF/services && \
|
2014-12-03 14:22:58 +00:00
|
|
|
$(JAR) uf $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/CodePointIM.jar java.awt.im.spi.InputMethodDescriptor)
|
|
|
|
$(RM) -r $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/_the.tmp
|
2012-06-08 03:40:50 +00:00
|
|
|
$(TOUCH) $@
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/_the.services
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2013-11-21 20:01:45 +00:00
|
|
|
ifneq ($(OPENJDK_TARGET_OS), solaris)
|
|
|
|
$(eval $(call SetupDemo,MoleculeViewer,applets,,XYZChemModel,,,example*.html *.java))
|
|
|
|
$(eval $(call SetupDemo,WireFrame,applets,,ThreeD,,,example*.html *.java))
|
|
|
|
$(eval $(call SetupDemo,SwingApplet,jfc,,SwingApplet,,,README* *.html))
|
|
|
|
endif
|
2012-04-10 15:22:03 +00:00
|
|
|
$(eval $(call SetupDemo,FileChooserDemo,jfc,,FileChooserDemo,,,README*))
|
|
|
|
$(eval $(call SetupDemo,Font2DTest,jfc,,Font2DTest,,,*.html *.txt))
|
|
|
|
$(eval $(call SetupDemo,Metalworks,jfc,,Metalworks,,,README*))
|
|
|
|
$(eval $(call SetupDemo,Notepad,jfc,,Notepad,,,README*))
|
|
|
|
$(eval $(call SetupDemo,SampleTree,jfc,,SampleTree,,,README*))
|
|
|
|
$(eval $(call SetupDemo,TableExample,jfc,,TableExample,,,README*))
|
|
|
|
$(eval $(call SetupDemo,TransparentRuler,jfc,,transparentruler.Ruler,,,README*))
|
2012-11-14 18:21:45 +00:00
|
|
|
$(eval $(call SetupDemo,jconsole-plugin,scripting,,,,,*.xml *.txt,,,,Main-Class: \n))
|
2012-04-10 15:22:03 +00:00
|
|
|
$(eval $(call SetupDemo,FullThreadDump,management,,FullThreadDump,,,README*))
|
2012-11-14 18:21:45 +00:00
|
|
|
$(eval $(call SetupDemo,JTop,management,,JTop,,,README*))
|
2012-04-10 15:22:03 +00:00
|
|
|
$(eval $(call SetupDemo,MemoryMonitor,management,,MemoryMonitor,,,README*))
|
|
|
|
$(eval $(call SetupDemo,VerboseGC,management,,VerboseGC,,,README*))
|
|
|
|
|
|
|
|
ifndef OPENJDK
|
2013-10-10 13:06:21 +00:00
|
|
|
$(eval $(call SetupDemo,Laffy,jfc,,,,closed/,*))
|
|
|
|
$(eval $(call SetupDemo,SwingSet3,jfc,,,,closed/,*))
|
|
|
|
|
|
|
|
$(eval $(call SetupDemo,Java2D,jfc,,java2d.Java2Demo,,closed/,*.html README*,Java2Demo))
|
|
|
|
$(eval $(call SetupDemo,Stylepad,jfc,,Stylepad, \
|
2014-08-17 14:54:13 +00:00
|
|
|
$(DEMO_SHARE_SRC)/jfc/Notepad,closed/,*.txt,,$(DEMO_SHARE_SRC)/jfc/Notepad/README.txt))
|
2013-10-10 13:06:21 +00:00
|
|
|
$(eval $(call SetupDemo,SwingSet2,jfc,,SwingSet2,,closed/,README* *.html,,,.java COPYRIGHT, \
|
|
|
|
SplashScreen-Image: resources/images/splash.png,true))
|
|
|
|
|
2014-08-17 14:54:13 +00:00
|
|
|
BUILD_DEMOS += $(patsubst $(DEMO_CLOSED_SHARE_SRC)/nbproject/%, \
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/nbproject/%, \
|
2014-08-17 14:54:13 +00:00
|
|
|
$(call CacheFind, $(DEMO_CLOSED_SHARE_SRC)/nbproject))
|
2013-10-10 13:06:21 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/nbproject/%: $(DEMO_CLOSED_SHARE_SRC)/nbproject/%
|
2013-10-10 13:06:21 +00:00
|
|
|
$(call install-file)
|
|
|
|
$(CHMOD) -f ug+w $@
|
2012-04-10 15:22:03 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
##################################################################################################
|
|
|
|
|
2013-10-10 13:06:21 +00:00
|
|
|
# In the old makefiles, j2dbench was not compiled.
|
|
|
|
#$(eval $(call SetupDemo,J2DBench, java2d, /src, , j2dbench/J2DBench))
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2012-09-18 18:29:24 +00:00
|
|
|
# JVMTI demos are a bit strange and share some files, but be careful the
|
2013-10-10 13:06:21 +00:00
|
|
|
# shared files are just the *.c and *.h files, not the README or sample
|
|
|
|
# makefiles. So we always exclude the README.txt and sample.makefile.txt
|
|
|
|
# from the extra sources.
|
2012-04-10 15:22:03 +00:00
|
|
|
define SetupJVMTIDemo
|
2013-10-10 13:06:21 +00:00
|
|
|
# Param 1 = Name of the demo
|
|
|
|
# Param 2 = add these directories to the includes, default is agent_util
|
|
|
|
# Param 3 = extra CFLAGS
|
|
|
|
# Param 4 = C or C++ (defaults to C)
|
2014-11-21 15:05:11 +00:00
|
|
|
# Param 5 = libs for unix
|
2013-10-10 13:06:21 +00:00
|
|
|
# Param 6 = libs for windows
|
|
|
|
# Param 7 = libs for solaris
|
2013-11-26 15:40:31 +00:00
|
|
|
# Param 8 = libs for linux
|
|
|
|
# Param 9 = extra directories with required sources
|
2015-03-09 09:39:50 +00:00
|
|
|
# Param 10 = DISABLED_WARNINGS_gcc
|
|
|
|
# Param 11 = DISABLED_WARNINGS_microsoft
|
|
|
|
# Param 12 = DISABLED_WARNINGS_clang
|
2013-10-10 13:06:21 +00:00
|
|
|
BUILD_DEMO_JVMTI_$1_EXTRA_SRC := \
|
2014-11-21 15:05:11 +00:00
|
|
|
$$(wildcard $(DEMO_OS_TYPE_SRC)/jvmti/$1) \
|
2014-08-17 14:54:13 +00:00
|
|
|
$$(wildcard $$(addprefix $(DEMO_SHARE_SRC)/jvmti/, $2)) \
|
2013-11-26 15:40:31 +00:00
|
|
|
$9
|
2013-10-10 13:06:21 +00:00
|
|
|
BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE := \
|
2014-08-17 14:54:13 +00:00
|
|
|
$$(wildcard $$(patsubst %, $(DEMO_SHARE_SRC)/jvmti/%/README.txt, $2)) \
|
|
|
|
$$(wildcard $$(patsubst %, $(DEMO_SHARE_SRC)/jvmti/%/sample.makefile.txt, $2))
|
2013-10-10 13:06:21 +00:00
|
|
|
BUILD_DEMO_JVMTI_$1_EXTRA_INC := $$(addprefix -I, $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC))
|
|
|
|
ifeq (C++, $4)
|
2015-04-17 11:55:42 +00:00
|
|
|
BUILD_DEMO_JVMTI_$1_TOOLCHAIN := TOOLCHAIN_LINK_CXX
|
2013-10-10 13:06:21 +00:00
|
|
|
$1_EXTRA_CXX := $(LDFLAGS_CXX_JDK) $(LIBCXX)
|
|
|
|
endif
|
|
|
|
|
2014-08-17 14:54:13 +00:00
|
|
|
$1_CXXFLAGS := $(CXXFLAGS_JDKLIB) -I$(DEMO_SHARE_SRC)/jvmti/$1 \
|
2013-10-10 13:06:21 +00:00
|
|
|
$$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3 \
|
|
|
|
$(CXXFLAGS_DEBUG_SYMBOLS)
|
|
|
|
ifeq ($1-$(OPENJDK_TARGET_CPU_ARCH), waiters-sparc)
|
|
|
|
$1_FILTER := -xregs=no%appl
|
|
|
|
$1_CXXFLAGS := $$(filter-out $$($1_FILTER), $$($1_CXXFLAGS))
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Workaround for CFLAGS_JDKLIB containing ',' on solaris. If this is added as 'CFLAGS' to the
|
|
|
|
# eval call below, the comma gets expanded too early.
|
|
|
|
BUILD_DEMO_JVMTI_$1_CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_DEBUG_SYMBOLS) \
|
2014-08-17 14:54:13 +00:00
|
|
|
-I$(DEMO_SHARE_SRC)/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3
|
2013-10-10 13:06:21 +00:00
|
|
|
|
|
|
|
# Remove the -incremental:no setting to get .ilk-files like in the old build.
|
|
|
|
$$(eval $$(call SetupNativeCompilation,BUILD_DEMO_JVMTI_$1, \
|
2014-08-17 14:54:13 +00:00
|
|
|
SRC := $(DEMO_SHARE_SRC)/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC), \
|
2015-04-17 11:55:42 +00:00
|
|
|
TOOLCHAIN := $$(BUILD_DEMO_JVMTI_$1_TOOLCHAIN), \
|
2013-10-10 13:06:21 +00:00
|
|
|
OPTIMIZATION := LOW, \
|
|
|
|
CXXFLAGS := $$($1_CXXFLAGS), \
|
2015-03-09 09:39:50 +00:00
|
|
|
DISABLED_WARNINGS_gcc := $(10), \
|
|
|
|
DISABLED_WARNINGS_clang := $(12), \
|
|
|
|
DISABLED_WARNINGS_microsoft := $(11), \
|
2013-10-10 13:06:21 +00:00
|
|
|
LDFLAGS := $(filter-out -incremental:no -opt:ref, $(LDFLAGS_JDKLIB)), \
|
|
|
|
LDFLAGS_macosx := $(call SET_EXECUTABLE_ORIGIN), \
|
|
|
|
LDFLAGS_SUFFIX := $$($1_EXTRA_CXX), \
|
2014-11-21 15:05:11 +00:00
|
|
|
LDFLAGS_SUFFIX_unix := $5, \
|
2013-10-10 13:06:21 +00:00
|
|
|
LDFLAGS_SUFFIX_windows := $6, \
|
|
|
|
LDFLAGS_SUFFIX_solaris := $7 -lc, \
|
|
|
|
LDFLAGS_SUFFIX_linux := $8, \
|
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", \
|
2014-12-03 14:22:58 +00:00
|
|
|
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/demo/native/jvmti/$1, \
|
|
|
|
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/lib, \
|
2013-10-10 13:06:21 +00:00
|
|
|
LIBRARY := $1))
|
|
|
|
|
|
|
|
$$(eval $$(call SetupZipArchive,BUILD_DEMO_JVMTI_SRC_$1, \
|
2014-08-17 14:54:13 +00:00
|
|
|
SRC := $(DEMO_SHARE_SRC)/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC), \
|
2013-10-10 13:06:21 +00:00
|
|
|
EXCLUDE_FILES := $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE), \
|
2014-12-03 14:22:58 +00:00
|
|
|
ZIP := $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/src.zip))
|
2013-10-10 13:06:21 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/README.txt: $(DEMO_SHARE_SRC)/jvmti/$1/README.txt
|
2013-10-10 13:06:21 +00:00
|
|
|
$$(call install-file)
|
|
|
|
$(CHMOD) -f ug+w $$@
|
|
|
|
|
2014-08-17 14:54:13 +00:00
|
|
|
ifneq (, $$(wildcard $(DEMO_SHARE_SRC)/jvmti/$1/*.java))
|
2013-10-10 13:06:21 +00:00
|
|
|
$$(eval $$(call SetupJavaCompilation,BUILD_DEMO_JVMTI_$1_JAVA, \
|
|
|
|
SETUP := GENERATE_USINGJDKBYTECODE, \
|
2014-08-17 14:54:13 +00:00
|
|
|
SRC := $(DEMO_SHARE_SRC)/jvmti/$1, \
|
2014-12-03 14:22:58 +00:00
|
|
|
BIN := $(SUPPORT_OUTPUTDIR)/demo/classes/jvmti/$1, \
|
2013-10-10 13:06:21 +00:00
|
|
|
COPY := $(PATTERNS_TO_COPY), \
|
2014-12-03 14:22:58 +00:00
|
|
|
JAR := $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/$1.jar, \
|
2013-10-10 13:06:21 +00:00
|
|
|
EXTRA_MANIFEST_ATTR := Main-Class: \n, \
|
2013-11-14 10:19:32 +00:00
|
|
|
MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf))
|
2013-10-10 13:06:21 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/$1.jar
|
2013-10-10 13:06:21 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
BUILD_DEMOS += $$(BUILD_DEMO_JVMTI_$1) \
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/src.zip \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/README.txt
|
2013-10-10 13:06:21 +00:00
|
|
|
|
|
|
|
ifeq ($(OPENJDK_TARGET_OS), windows)
|
|
|
|
# These files normally end up in OBJECT_DIR but for demos they
|
|
|
|
# are supposed to be included in the distro.
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/lib/$1.lib: $$(BUILD_DEMO_JVMTI_$1)
|
|
|
|
$(CP) $(SUPPORT_OUTPUTDIR)/demo/native/jvmti/$1/$1.lib $$@
|
2013-10-10 13:06:21 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/lib/$1.exp: $$(BUILD_DEMO_JVMTI_$1)
|
|
|
|
$(CP) $(SUPPORT_OUTPUTDIR)/demo/native/jvmti/$1/$1.exp $$@
|
2013-10-10 13:06:21 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/lib/$1.lib \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/lib/$1.exp
|
2013-10-10 13:06:21 +00:00
|
|
|
endif
|
2012-04-10 15:22:03 +00:00
|
|
|
endef
|
|
|
|
|
2015-03-11 07:09:35 +00:00
|
|
|
$(eval $(call SetupJVMTIDemo,compiledMethodLoad, agent_util))
|
2013-10-10 13:06:21 +00:00
|
|
|
$(eval $(call SetupJVMTIDemo,gctest, agent_util))
|
|
|
|
$(eval $(call SetupJVMTIDemo,heapTracker, agent_util java_crw_demo))
|
|
|
|
$(eval $(call SetupJVMTIDemo,heapViewer, agent_util))
|
|
|
|
$(eval $(call SetupJVMTIDemo,minst, agent_util java_crw_demo))
|
|
|
|
$(eval $(call SetupJVMTIDemo,mtrace, agent_util java_crw_demo))
|
2015-03-11 07:09:35 +00:00
|
|
|
$(eval $(call SetupJVMTIDemo,waiters, agent_util, , C++))
|
2013-10-10 13:06:21 +00:00
|
|
|
$(eval $(call SetupJVMTIDemo,versionCheck, agent_util))
|
2012-04-10 15:22:03 +00:00
|
|
|
|
|
|
|
##################################################################################################
|
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/management/index.html: $(DEMO_SHARE_SRC)/management/index.html
|
2013-04-05 07:39:10 +00:00
|
|
|
$(call install-file)
|
|
|
|
$(CHMOD) -f ug+w $@
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/jvmti/index.html: $(DEMO_SHARE_SRC)/jvmti/index.html
|
2013-04-05 07:39:10 +00:00
|
|
|
$(call install-file)
|
|
|
|
$(CHMOD) -f ug+w $@
|
2012-04-10 15:22:03 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/management/index.html \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/jvmti/index.html
|
2012-04-10 15:22:03 +00:00
|
|
|
|
|
|
|
##################################################################################################
|
|
|
|
|
|
|
|
# The netbeans project files are copied into the demo directory.
|
2013-12-18 19:34:34 +00:00
|
|
|
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
2014-08-17 14:54:13 +00:00
|
|
|
BUILD_DEMOS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/nbproject/%, \
|
2014-08-17 14:54:13 +00:00
|
|
|
$(filter-out $(DEMO_SHARE_SRC)/nbproject/jfc/SwingApplet%, \
|
|
|
|
$(call CacheFind, $(DEMO_SHARE_SRC)/nbproject)))
|
2013-12-18 19:34:34 +00:00
|
|
|
else
|
2014-08-17 14:54:13 +00:00
|
|
|
BUILD_DEMOS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/nbproject/%, \
|
2014-08-17 14:54:13 +00:00
|
|
|
$(call CacheFind, $(DEMO_SHARE_SRC)/nbproject))
|
2013-12-18 19:34:34 +00:00
|
|
|
endif
|
2012-06-08 03:40:50 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/nbproject/%: $(DEMO_SHARE_SRC)/nbproject/%
|
2013-04-05 07:39:10 +00:00
|
|
|
$(call install-file)
|
2012-06-08 03:40:50 +00:00
|
|
|
$(CHMOD) -f ug+w $@
|
|
|
|
|
|
|
|
##################################################################################################
|
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/README: $(DEMO_SHARE_SRC)/README
|
2013-04-05 07:39:10 +00:00
|
|
|
$(call install-file)
|
2012-06-08 03:40:50 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/README
|
2012-06-08 03:40:50 +00:00
|
|
|
|
|
|
|
##################################################################################################
|
|
|
|
|
2012-07-03 23:10:44 +00:00
|
|
|
ifeq ($(OPENJDK_TARGET_OS), solaris)
|
2012-06-08 03:40:50 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller/%: $(DEMO_SOLARIS_SRC)/jni/Poller/%
|
2013-04-05 07:39:10 +00:00
|
|
|
$(call install-file)
|
|
|
|
$(CHMOD) -f ug+w $@
|
2012-06-08 03:40:50 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/README.txt: $(DEMO_SOLARIS_SRC)/jni/Poller/README.txt
|
2013-04-05 07:39:10 +00:00
|
|
|
$(call install-file)
|
|
|
|
$(CHMOD) -f ug+w $@
|
2012-06-08 03:40:50 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/Poller.jar: \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller/README.txt \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller/Poller.c
|
2013-10-10 13:06:21 +00:00
|
|
|
|
|
|
|
$(eval $(call SetupJavaCompilation,BUILD_DEMO_POLLER_JAR, \
|
|
|
|
SETUP := GENERATE_USINGJDKBYTECODE, \
|
2014-08-17 14:54:13 +00:00
|
|
|
SRC := $(DEMO_SOLARIS_SRC)/jni/Poller, \
|
2014-12-03 14:22:58 +00:00
|
|
|
BIN := $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
|
|
|
|
HEADERS := $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
|
|
|
|
JAR := $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/Poller.jar, \
|
2013-11-14 10:19:32 +00:00
|
|
|
MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
|
2014-12-03 14:22:58 +00:00
|
|
|
SRCZIP := $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/src.zip, \
|
2013-10-10 13:06:21 +00:00
|
|
|
COPY := README.txt Poller.c, \
|
|
|
|
JARMAIN := Client))
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/Poller.jar \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/src.zip \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/README.txt
|
2013-10-10 13:06:21 +00:00
|
|
|
|
|
|
|
$(eval $(call SetupNativeCompilation,BUILD_LIBPOLLER, \
|
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) \
|
2014-12-03 14:22:58 +00:00
|
|
|
-I$(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
|
2013-10-10 13:06:21 +00:00
|
|
|
LDFLAGS := $(LDFLAGS_JDKLIB), \
|
|
|
|
LDFLAGS_SUFFIX_solaris := -lc, \
|
2014-12-03 14:22:58 +00:00
|
|
|
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/demo/native/jni/Poller, \
|
|
|
|
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/demo/native, \
|
2013-10-10 13:06:21 +00:00
|
|
|
LIBRARY := Poller))
|
|
|
|
|
|
|
|
#
|
|
|
|
# We can only compile native code after jar has been build (since we depend on generated .h files)
|
|
|
|
#
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/native/jni/Poller/Poller.o: $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/Poller.jar
|
2013-10-10 13:06:21 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX): \
|
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/native/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
|
2013-04-05 07:39:10 +00:00
|
|
|
$(call install-file)
|
2012-06-08 03:40:50 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
|
2012-06-08 03:40:50 +00:00
|
|
|
|
|
|
|
endif
|
2012-04-10 15:22:03 +00:00
|
|
|
|
|
|
|
##################################################################################################
|
|
|
|
|
2012-06-08 03:40:50 +00:00
|
|
|
ifndef OPENJDK
|
2014-08-17 14:54:13 +00:00
|
|
|
DB_ZIP_DIR := $(wildcard $(JDK_TOPDIR)/src/closed/db)
|
|
|
|
DB_DEMO_ZIPFILE := $(wildcard $(DB_ZIP_DIR)/*.zip)
|
2012-06-08 03:40:50 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/_the.db.unzipped: $(DB_DEMO_ZIPFILE)
|
2012-06-08 03:40:50 +00:00
|
|
|
$(MKDIR) -p $(@D)
|
2014-12-03 14:22:58 +00:00
|
|
|
$(RM) -r $(SUPPORT_OUTPUTDIR)/demo/image/db $(SUPPORT_OUTPUTDIR)/demo/image/demo
|
|
|
|
$(CD) $(SUPPORT_OUTPUTDIR)/demo/image && $(UNZIP) -q -o $<
|
|
|
|
$(MV) $(SUPPORT_OUTPUTDIR)/demo/image/db-derby-*-bin/demo $(SUPPORT_OUTPUTDIR)/demo/image/db
|
|
|
|
$(CD) $(SUPPORT_OUTPUTDIR)/demo/image && $(RM) -r db-derby-*-bin
|
2012-06-08 03:40:50 +00:00
|
|
|
$(TOUCH) $@
|
|
|
|
|
2013-10-10 13:06:21 +00:00
|
|
|
# Copy this after the unzip above to avoid race with directory creation and mv command.
|
2014-12-03 14:22:58 +00:00
|
|
|
$(SUPPORT_OUTPUTDIR)/demo/image/db/README-JDK-DEMOS.html: \
|
2014-08-17 14:54:13 +00:00
|
|
|
$(DB_ZIP_DIR)/README-JDK-DEMOS.html \
|
2014-12-03 14:22:58 +00:00
|
|
|
| $(SUPPORT_OUTPUTDIR)/demo/image/_the.db.unzipped
|
2013-05-06 03:51:01 +00:00
|
|
|
$(MKDIR) -p $(@D)
|
2014-08-17 14:54:13 +00:00
|
|
|
$(CAT) $< | $(SED) "s/XXXX/$(shell cat $(DB_ZIP_DIR)/COPYRIGHTYEAR)/" > $@
|
2013-04-05 07:39:10 +00:00
|
|
|
|
2014-12-03 14:22:58 +00:00
|
|
|
BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/_the.db.unzipped $(SUPPORT_OUTPUTDIR)/demo/image/db/README-JDK-DEMOS.html
|
2012-06-08 03:40:50 +00:00
|
|
|
endif
|
2012-04-10 15:22:03 +00:00
|
|
|
|
|
|
|
##################################################################################################
|
|
|
|
|
2012-06-08 03:40:50 +00:00
|
|
|
all: $(BUILD_DEMOS)
|
2012-04-10 15:22:03 +00:00
|
|
|
|
|
|
|
.PHONY: all
|