annotate make/CompileDemos.gmk @ 11311:c942132c5014

Added tag jdk8u71-b01 for changeset e8b5e10a19d6
author asaha
date Tue, 22 Sep 2015 13:39:46 -0700
parents a7f226d059c6
children 92c6a16b6dac
rev   line source
dwanvik@7092 1
ohair@5221 2 #
ksrini@8812 3 # Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
ohair@5221 4 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@5221 5 #
ohair@5221 6 # This code is free software; you can redistribute it and/or modify it
ohair@5221 7 # under the terms of the GNU General Public License version 2 only, as
ohair@5221 8 # published by the Free Software Foundation. Oracle designates this
ohair@5221 9 # particular file as subject to the "Classpath" exception as provided
ohair@5221 10 # by Oracle in the LICENSE file that accompanied this code.
ohair@5221 11 #
ohair@5221 12 # This code is distributed in the hope that it will be useful, but WITHOUT
ohair@5221 13 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@5221 14 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@5221 15 # version 2 for more details (a copy is included in the LICENSE file that
ohair@5221 16 # accompanied this code).
ohair@5221 17 #
ohair@5221 18 # You should have received a copy of the GNU General Public License version
ohair@5221 19 # 2 along with this work; if not, write to the Free Software Foundation,
ohair@5221 20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@5221 21 #
ohair@5221 22 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@5221 23 # or visit www.oracle.com if you need additional information or have any
ohair@5221 24 # questions.
ohair@5221 25 #
ohair@5221 26
ohair@5221 27 default: all
ohair@5221 28
ohair@5221 29 include $(SPEC)
ohair@5221 30 include MakeBase.gmk
ohair@5221 31 include JavaCompilation.gmk
ohair@5221 32 include NativeCompilation.gmk
ohair@5221 33
ohair@5221 34 # Setup the java compilers for the JDK build.
ohair@5221 35 include Setup.gmk
ohair@5221 36
erikj@6354 37 # Prepare the find cache. Only used if running on windows.
ihse@8330 38 $(eval $(call FillCacheFind, $(JDK_TOPDIR)/src))
erikj@6354 39
ohair@5221 40 # Append demo goals to this variable.
ihse@8330 41 BUILD_DEMOS =
ohair@5221 42
ohair@5221 43 # The demo structure and contents should really be cleaned up.
ohair@5221 44 # Now every other demo has its own quirks where to put the
ohair@5221 45 # READMEs and other files.
ohair@5221 46
ohair@5221 47 ##################################################################################################
ohair@5221 48
ohair@5221 49 define SetupAppletDemo
ihse@8330 50 $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_APPLET_$1, \
ihse@8330 51 SETUP := GENERATE_USINGJDKBYTECODE, \
ihse@8330 52 SRC := $(JDK_TOPDIR)/src/$3share/demo/applets/$1, \
ihse@8330 53 BIN := $(JDK_OUTPUTDIR)/demo/applets/$1, \
ihse@8330 54 COPY := .html .java .xyz .obj .au .gif, \
ihse@8330 55 DISABLE_SJAVAC := $2))
ihse@8330 56 BUILD_DEMOS += $$(BUILD_DEMO_APPLET_$1)
ohair@5221 57 endef
ohair@5221 58
dtitov@10048 59 ifneq ($(OPENJDK_TARGET_OS), solaris)
dtitov@10048 60 $(eval $(call SetupAppletDemo,ArcTest))
dtitov@10048 61 $(eval $(call SetupAppletDemo,BarChart))
dtitov@10048 62 $(eval $(call SetupAppletDemo,Blink))
dtitov@10048 63 $(eval $(call SetupAppletDemo,CardTest))
dtitov@10048 64 $(eval $(call SetupAppletDemo,Clock))
dtitov@10048 65 $(eval $(call SetupAppletDemo,DitherTest))
dtitov@10048 66 $(eval $(call SetupAppletDemo,DrawTest))
dtitov@10048 67 $(eval $(call SetupAppletDemo,Fractal))
dtitov@10048 68 $(eval $(call SetupAppletDemo,GraphicsTest))
dtitov@10048 69 $(eval $(call SetupAppletDemo,NervousText))
dtitov@10048 70 $(eval $(call SetupAppletDemo,SimpleGraph))
dtitov@10048 71 $(eval $(call SetupAppletDemo,SortDemo))
dtitov@10048 72 $(eval $(call SetupAppletDemo,SpreadSheet))
dtitov@10048 73
dtitov@10048 74 ifndef OPENJDK
dtitov@10048 75 $(eval $(call SetupAppletDemo,Animator,,closed/))
dtitov@10048 76 $(eval $(call SetupAppletDemo,GraphLayout,true,closed/))
dtitov@10048 77 $(eval $(call SetupAppletDemo,JumpingBox,,closed/))
dtitov@10048 78 $(eval $(call SetupAppletDemo,TicTacToe,,closed/))
dtitov@10048 79 endif
dtitov@10048 80 endif
ohair@5221 81
ohair@5221 82 ##################################################################################################
ohair@5221 83
ihse@8330 84 PATTERNS_TO_COPY = .html .txt .properties .js .gif .jpg .theme .data .opt README .c .h .png .ttf .xyz .obj
ohair@5221 85
ohair@5221 86 define SetupDemo
ihse@8330 87 # Param 1 = Name of the demo
ihse@8330 88 # Param 2 = Subdirectory of the demo below the demo directory.
ihse@8330 89 # Param 3 = Additional javac flags.
ihse@8330 90 # Param 4 = The main class for the jar.
ihse@8330 91 # Param 5 = Additional source directory.
ihse@8330 92 # Param 6 = Extra dir below $(JDK_TOPDIR)/src (closed)
ihse@8330 93 # Param 7 = List of files to copy
ihse@8330 94 # Param 8 = Base name of jar file. Defaults to $1
ihse@8330 95 # Param 9 = Exclude list
ihse@8330 96 # Param 10 = Extra copy patterns
ihse@8330 97 # Param 11 = Extra manifest attribute
ihse@8330 98 # Param 12 = Suffix for compiler setup name
ohair@5221 99
ihse@8330 100 # In some demos the source is found in a subdir called src.
ihse@8330 101 $1_MAIN_SRC := $$(wildcard $(JDK_TOPDIR)/src/$6share/demo/$2/$1/src)
ihse@8330 102 ifeq ($$($1_MAIN_SRC), )
ihse@8330 103 $1_MAIN_SRC := $(JDK_TOPDIR)/src/$6share/demo/$2/$1
ihse@8330 104 endif
ohair@5221 105
ihse@8330 106 ifneq ($8, )
ihse@8330 107 $1_JARFILE := $8.jar
ihse@8330 108 else
ihse@8330 109 $1_JARFILE := $1.jar
ihse@8330 110 endif
ohair@5221 111
ihse@8330 112 ifeq ($(findstring $1,Laffy SwingSet3), )
ihse@8330 113 $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_$1, \
ihse@8330 114 SETUP := GENERATE_USINGJDKBYTECODE, \
ihse@8330 115 ADD_JAVAC_FLAGS := $3, \
ihse@8330 116 SRC := $$($1_MAIN_SRC) $5, \
ihse@8330 117 BIN := $(JDK_OUTPUTDIR)/democlasses/$2/$1, \
ihse@8330 118 COPY := $(PATTERNS_TO_COPY) $(10), \
ihse@8330 119 JAR := $(JDK_OUTPUTDIR)/demo/$2/$1/$$($1_JARFILE), \
ihse@8330 120 JARMAIN := $4, \
ihse@8845 121 MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
ihse@8330 122 EXTRA_MANIFEST_ATTR := $(11), \
ihse@8330 123 SRCZIP := $(JDK_OUTPUTDIR)/demo/$2/$1/src.zip, \
ihse@8330 124 EXCLUDE_FILES := $9, \
ihse@8330 125 DISABLE_SJAVAC := $(12)))
ohair@5221 126
ihse@8330 127 BUILD_DEMOS += $$(BUILD_DEMO_$1) \
ihse@8330 128 $(JDK_OUTPUTDIR)/demo/$2/$1/$$($1_JARFILE) \
ihse@8330 129 $(JDK_OUTPUTDIR)/demo/$2/$1/src.zip
ihse@8330 130 endif
ohair@5221 131
ihse@8330 132 # Copy files.
ihse@8330 133 $1_COPY_TARGETS := $$(patsubst $(JDK_TOPDIR)/src/$6share/demo/$2/$1/%, \
ihse@8330 134 $(JDK_OUTPUTDIR)/demo/$2/$1/%, \
ihse@8330 135 $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/$6share/demo/$2/$1/, $7)))
ihse@8330 136 ifneq ($7, )
ihse@8330 137 $(JDK_OUTPUTDIR)/demo/$2/$1/%: $(JDK_TOPDIR)/src/$6share/demo/$2/$1/%
ihse@8330 138 $$(call install-file)
ihse@8330 139 $(CHMOD) -f ug+w $$@
ohair@5221 140
ihse@8330 141 BUILD_DEMOS += $$($1_COPY_TARGETS)
ihse@8330 142 endif
ohair@5221 143
ohair@5221 144 endef
ohair@5221 145
ohair@5221 146 $(eval $(call SetupDemo,CodePointIM,jfc,,CodePointIM,,,*.html))
ihse@8330 147 $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.services: \
ihse@8330 148 $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar \
ihse@8330 149 $(JDK_TOPDIR)/src/share/demo/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor
ohair@5819 150 (cd $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM && \
ihse@8330 151 $(MKDIR) -p _the.tmp/META-INF/services && \
ihse@8330 152 $(CP) $(JDK_TOPDIR)/src/share/demo/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor _the.tmp/META-INF/services && \
ihse@8330 153 cd _the.tmp && \
ihse@8330 154 $(JAR) uf $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar META-INF/services/java.awt.im.spi.InputMethodDescriptor && \
ihse@8330 155 cd META-INF/services && \
ihse@8330 156 $(JAR) uf $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar java.awt.im.spi.InputMethodDescriptor)
ohair@5819 157 $(RM) -r $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.tmp
erikj@5507 158 $(TOUCH) $@
ohair@5221 159
ihse@8330 160 BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.services
ohair@5221 161
dtitov@10048 162 ifneq ($(OPENJDK_TARGET_OS), solaris)
dtitov@10048 163 $(eval $(call SetupDemo,MoleculeViewer,applets,,XYZChemModel,,,example*.html *.java))
dtitov@10048 164 $(eval $(call SetupDemo,WireFrame,applets,,ThreeD,,,example*.html *.java))
dtitov@10048 165 $(eval $(call SetupDemo,SwingApplet,jfc,,SwingApplet,,,README* *.html))
dtitov@10048 166 endif
ohair@5221 167 $(eval $(call SetupDemo,FileChooserDemo,jfc,,FileChooserDemo,,,README*))
dtitov@10048 168 $(eval $(call SetupDemo,Font2DTest,jfc,,Font2DTest,,,*.html *.txt))
ohair@5221 169 $(eval $(call SetupDemo,Metalworks,jfc,,Metalworks,,,README*))
ohair@5221 170 $(eval $(call SetupDemo,Notepad,jfc,,Notepad,,,README*))
ohair@5221 171 $(eval $(call SetupDemo,SampleTree,jfc,,SampleTree,,,README*))
ohair@5221 172 $(eval $(call SetupDemo,TableExample,jfc,,TableExample,,,README*))
ohair@5221 173 $(eval $(call SetupDemo,TransparentRuler,jfc,,transparentruler.Ruler,,,README*))
tbell@6135 174 $(eval $(call SetupDemo,jconsole-plugin,scripting,,,,,*.xml *.txt,,,,Main-Class: \n))
ohair@5221 175 $(eval $(call SetupDemo,FullThreadDump,management,,FullThreadDump,,,README*))
tbell@6135 176 $(eval $(call SetupDemo,JTop,management,,JTop,,,README*))
ohair@5221 177 $(eval $(call SetupDemo,MemoryMonitor,management,,MemoryMonitor,,,README*))
ohair@5221 178 $(eval $(call SetupDemo,VerboseGC,management,,VerboseGC,,,README*))
erikj@5507 179 $(eval $(call SetupDemo,zipfs,nio,,,,,README* *.java,,,,Main-Class: \n))
ohair@5221 180
ohair@5221 181 ifndef OPENJDK
ihse@8330 182 $(eval $(call SetupDemo,Laffy,jfc,,,,closed/,*))
ihse@8330 183 $(eval $(call SetupDemo,SwingSet3,jfc,,,,closed/,*))
ohair@5221 184
dtitov@10048 185 $(eval $(call SetupDemo,Java2D,jfc,,java2d.Java2Demo,,closed/,*.html README*,Java2Demo))
ihse@8330 186 $(eval $(call SetupDemo,Stylepad,jfc,,Stylepad, \
ksrini@8812 187 $(JDK_TOPDIR)/src/share/demo/jfc/Notepad,closed/,*.txt,,$(JDK_TOPDIR)/src/share/demo/jfc/Notepad/README.txt))
dtitov@10048 188 $(eval $(call SetupDemo,SwingSet2,jfc,,SwingSet2,,closed/,README* *.html,,,.java COPYRIGHT, \
dtitov@10048 189 SplashScreen-Image: resources/images/splash.png,true))
ohair@5221 190
ihse@8330 191 BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/closed/share/demo/nbproject/%, \
ihse@8330 192 $(JDK_OUTPUTDIR)/demo/nbproject/%, \
ihse@8330 193 $(call CacheFind, $(JDK_TOPDIR)/src/closed/share/demo/nbproject))
ihse@8330 194
ihse@8330 195 $(JDK_OUTPUTDIR)/demo/nbproject/%: $(JDK_TOPDIR)/src/closed/share/demo/nbproject/%
ihse@8330 196 $(call install-file)
ihse@8330 197 $(CHMOD) -f ug+w $@
ohair@5221 198 endif
ohair@5221 199
ohair@5221 200 ##################################################################################################
ohair@5221 201
ihse@8330 202 # In the old makefiles, j2dbench was not compiled.
ihse@8330 203 #$(eval $(call SetupDemo,J2DBench, java2d, /src, , j2dbench/J2DBench))
ohair@5221 204
ohair@5819 205 # JVMTI demos are a bit strange and share some files, but be careful the
ihse@8330 206 # shared files are just the *.c and *.h files, not the README or sample
ihse@8330 207 # makefiles. So we always exclude the README.txt and sample.makefile.txt
ihse@8330 208 # from the extra sources.
ohair@5221 209 define SetupJVMTIDemo
ihse@8330 210 # Param 1 = Name of the demo
ihse@8330 211 # Param 2 = add these directories to the includes, default is agent_util
ihse@8330 212 # Param 3 = extra CFLAGS
ihse@8330 213 # Param 4 = C or C++ (defaults to C)
ihse@8330 214 # Param 5 = libs for posix
ihse@8330 215 # Param 6 = libs for windows
ihse@8330 216 # Param 7 = libs for solaris
simonis@9240 217 # Param 8 = libs for linux
simonis@9240 218 # Param 9 = extra directories with required sources
ihse@8330 219 BUILD_DEMO_JVMTI_$1_EXTRA_SRC := \
ihse@8330 220 $$(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/demo/jvmti/$1) \
simonis@9240 221 $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/, $2)) \
simonis@9240 222 $9
ihse@8330 223 BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE := \
ihse@8330 224 $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/, $2)/README.txt) \
ihse@8330 225 $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/, $2)/sample.makefile.txt)
ihse@8330 226 BUILD_DEMO_JVMTI_$1_EXTRA_INC := $$(addprefix -I, $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC))
ihse@8330 227 BUILD_DEMO_JVMTI_$1_LANG := C
ihse@8330 228 ifneq (, $4)
ihse@8330 229 BUILD_DEMO_JVMTI_$1_LANG := $4
ihse@8330 230 endif
ihse@8330 231 ifeq (C++, $4)
ihse@8330 232 $1_EXTRA_CXX := $(LDFLAGS_CXX_JDK) $(LIBCXX)
ihse@8330 233 endif
erikj@5596 234
ihse@8330 235 $1_CXXFLAGS := $(CXXFLAGS_JDKLIB) -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 \
ihse@8330 236 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3 \
ihse@8330 237 $(CXXFLAGS_DEBUG_SYMBOLS)
ihse@8330 238 ifeq ($1-$(OPENJDK_TARGET_CPU_ARCH), waiters-sparc)
ihse@8330 239 $1_FILTER := -xregs=no%appl
ihse@8330 240 $1_CXXFLAGS := $$(filter-out $$($1_FILTER), $$($1_CXXFLAGS))
ihse@8330 241 endif
erikj@5596 242
ihse@8330 243 # Workaround for CFLAGS_JDKLIB containing ',' on solaris. If this is added as 'CFLAGS' to the
ihse@8330 244 # eval call below, the comma gets expanded too early.
ihse@8330 245 BUILD_DEMO_JVMTI_$1_CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_DEBUG_SYMBOLS) \
ihse@8330 246 -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3
ohair@5819 247
ihse@8330 248 # Remove the -incremental:no setting to get .ilk-files like in the old build.
ihse@8330 249 $$(eval $$(call SetupNativeCompilation,BUILD_DEMO_JVMTI_$1, \
ihse@8330 250 SRC := $(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC), \
ihse@8330 251 LANG := $$(BUILD_DEMO_JVMTI_$1_LANG), \
ihse@8330 252 OPTIMIZATION := LOW, \
ihse@8330 253 CXXFLAGS := $$($1_CXXFLAGS), \
ihse@8330 254 LDFLAGS := $(filter-out -incremental:no -opt:ref, $(LDFLAGS_JDKLIB)), \
ihse@8330 255 LDFLAGS_macosx := $(call SET_EXECUTABLE_ORIGIN), \
ihse@8330 256 LDFLAGS_SUFFIX := $$($1_EXTRA_CXX), \
ihse@8330 257 LDFLAGS_SUFFIX_posix := $5, \
ihse@8330 258 LDFLAGS_SUFFIX_windows := $6, \
ihse@8330 259 LDFLAGS_SUFFIX_solaris := $7 -lc, \
ihse@8330 260 LDFLAGS_SUFFIX_linux := $8, \
ihse@8330 261 VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
ihse@8330 262 RC_FLAGS := $$(RC_FLAGS) \
ihse@8330 263 -D "JDK_FNAME=$1.dll" \
ihse@8330 264 -D "JDK_INTERNAL_NAME=$1" \
ihse@8330 265 -D "JDK_FTYPE=0x2L", \
ihse@8330 266 OBJECT_DIR := $(JDK_OUTPUTDIR)/demoobjs/jvmti/$1, \
ihse@8330 267 OUTPUT_DIR := $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib, \
ihse@8330 268 LIBRARY := $1))
ohair@5221 269
ihse@8330 270 $$(eval $$(call SetupZipArchive,BUILD_DEMO_JVMTI_SRC_$1, \
ihse@8330 271 SRC := $(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC), \
ihse@8330 272 EXCLUDE_FILES := $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE), \
ihse@8330 273 ZIP := $(JDK_OUTPUTDIR)/demo/jvmti/$1/src.zip))
ohair@5221 274
ihse@8330 275 $(JDK_OUTPUTDIR)/demo/jvmti/$1/README.txt: $(JDK_TOPDIR)/src/share/demo/jvmti/$1/README.txt
ihse@8330 276 $$(call install-file)
ihse@8330 277 $(CHMOD) -f ug+w $$@
ohair@5221 278
ihse@8330 279 ifneq (, $$(wildcard $(JDK_TOPDIR)/src/share/demo/jvmti/$1/*.java))
ihse@8330 280 $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_JVMTI_$1_JAVA, \
ihse@8330 281 SETUP := GENERATE_USINGJDKBYTECODE, \
ihse@8330 282 SRC := $(JDK_TOPDIR)/src/share/demo/jvmti/$1, \
ihse@8330 283 BIN := $(JDK_OUTPUTDIR)/democlasses/jvmti/$1, \
ihse@8330 284 COPY := $(PATTERNS_TO_COPY), \
ihse@8330 285 JAR := $(JDK_OUTPUTDIR)/demo/jvmti/$1/$1.jar, \
ihse@8330 286 EXTRA_MANIFEST_ATTR := Main-Class: \n, \
ihse@8845 287 MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf))
ohair@5221 288
ihse@8330 289 BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jvmti/$1/$1.jar
ihse@8330 290 endif
ohair@5221 291
ihse@8330 292 BUILD_DEMOS += $$(BUILD_DEMO_JVMTI_$1) \
ihse@8330 293 $(JDK_OUTPUTDIR)/demo/jvmti/$1/src.zip \
ihse@8330 294 $(JDK_OUTPUTDIR)/demo/jvmti/$1/README.txt
ohair@5819 295
ihse@8330 296 ifeq ($(OPENJDK_TARGET_OS), windows)
ihse@8330 297 # These files normally end up in OBJECT_DIR but for demos they
ihse@8330 298 # are supposed to be included in the distro.
ihse@8330 299 $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib/$1.lib: $$(BUILD_DEMO_JVMTI_$1)
ihse@8330 300 $(CP) $(JDK_OUTPUTDIR)/demoobjs/jvmti/$1/$1.lib $$@
ohair@5819 301
ihse@8330 302 $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib/$1.exp: $$(BUILD_DEMO_JVMTI_$1)
ihse@8330 303 $(CP) $(JDK_OUTPUTDIR)/demoobjs/jvmti/$1/$1.exp $$@
ohair@5819 304
ihse@8330 305 BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib/$1.lib \
ihse@8330 306 $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib/$1.exp
ihse@8330 307 endif
ohair@5221 308 endef
ohair@5221 309
ihse@8330 310 $(eval $(call SetupJVMTIDemo,compiledMethodLoad, agent_util))
ihse@8330 311 $(eval $(call SetupJVMTIDemo,gctest, agent_util))
ihse@8330 312 $(eval $(call SetupJVMTIDemo,heapTracker, agent_util java_crw_demo))
ihse@8330 313 $(eval $(call SetupJVMTIDemo,heapViewer, agent_util))
simonis@9240 314
simonis@9240 315 # On AIX, hprof requires 'dladdr' from src/aix/porting/porting_aix.cpp
simonis@9240 316 BUILD_LIBHPROF_AIX_EXTRA_SRC :=
simonis@9240 317 BUILD_LIBHPROF_AIX_EXTRA_CFLAGS :=
simonis@9240 318 ifeq ($(OPENJDK_TARGET_OS), aix)
simonis@9240 319 BUILD_LIBHPROF_AIX_EXTRA_SRC += $(JDK_TOPDIR)/src/aix/porting
simonis@9240 320 BUILD_LIBHPROF_AIX_EXTRA_CFLAGS += -I$(JDK_TOPDIR)/src/aix/porting
simonis@9240 321 endif
simonis@9240 322
ihse@8330 323 $(eval $(call SetupJVMTIDemo,hprof, java_crw_demo, \
simonis@9240 324 -I$(JDK_TOPDIR)/src/share/npt -I$(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/npt \
simonis@9240 325 $(BUILD_LIBHPROF_AIX_EXTRA_CFLAGS), C, \
simonis@9240 326 -ldl, ws2_32.lib winmm.lib, -lsocket -lnsl, -lpthread, $(BUILD_LIBHPROF_AIX_EXTRA_SRC)))
ohair@5221 327
ihse@8330 328 $(eval $(call SetupJVMTIDemo,minst, agent_util java_crw_demo))
ihse@8330 329 $(eval $(call SetupJVMTIDemo,mtrace, agent_util java_crw_demo))
ihse@8330 330 $(eval $(call SetupJVMTIDemo,waiters, agent_util, , C++))
ihse@8330 331 $(eval $(call SetupJVMTIDemo,versionCheck, agent_util))
ohair@5221 332
ohair@5221 333 ##################################################################################################
ohair@5221 334
ohair@5221 335 # The jpda demo (com/sun/tools/example) is oddly enough stored in src/share/classes.
ohair@5221 336 # At least, we do not need to compile the jpda demo, just jar/zip up the sources.
ihse@8330 337 JPDA_SOURCES := $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example)
ohair@5221 338 # The number of files are few enough so that we can use echo safely below to list them.
ihse@8330 339 JPDA_FILES := $(subst $(JDK_TOPDIR)/src/share/classes/,,$(JPDA_SOURCES))
ohair@5221 340
ihse@8330 341 $(JDK_OUTPUTDIR)/demo/jpda/src.zip: $(JPDA_SOURCES)
erikj@6824 342 $(MKDIR) -p $(@D)
erikj@6824 343 (cd $(JDK_TOPDIR)/src/share/classes && $(ZIP) -qru $@ com -i "com/sun/tools/example/*")
ohair@5221 344
ihse@8330 345 $(JDK_OUTPUTDIR)/demo/jpda/examples.jar: $(JPDA_SOURCES)
erikj@6824 346 $(MKDIR) -p $(@D)
erikj@6824 347 $(RM) $(@D)/_the.sources
erikj@6824 348 $(call ListPathsSafely,JPDA_FILES,\n, >> $(@D)/_the.sources)
ihse@8330 349 $(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
ihse@8845 350 -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf > $(@D)/_the.manifest
erikj@6824 351 $(ECHO) "Main-Class: " >> $(@D)/_the.manifest
ihse@8330 352 (cd $(JDK_TOPDIR)/src/share/classes && $(JAR) cfm $@ $(@D)/_the.manifest @$(@D)/_the.sources)
erikj@6824 353 (cd $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example && $(JAR) uf $@ README)
ohair@5221 354
ihse@8330 355 $(JDK_OUTPUTDIR)/demo/jpda/com/sun/tools/example/README: $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example/README
erikj@6824 356 $(call install-file)
erikj@6824 357 $(CHMOD) -f ug+w $@
ohair@5221 358
ohair@5819 359 BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jpda/src.zip $(JDK_OUTPUTDIR)/demo/jpda/examples.jar \
ihse@8330 360 $(JDK_OUTPUTDIR)/demo/jpda/com/sun/tools/example/README
ohair@5221 361
ohair@5221 362 ##################################################################################################
ohair@5221 363
ihse@8330 364 $(JDK_OUTPUTDIR)/demo/management/index.html: $(JDK_TOPDIR)/src/share/demo/management/index.html
erikj@6824 365 $(call install-file)
erikj@6824 366 $(CHMOD) -f ug+w $@
ohair@5221 367
ihse@8330 368 $(JDK_OUTPUTDIR)/demo/jvmti/index.html: $(JDK_TOPDIR)/src/share/demo/jvmti/index.html
erikj@6824 369 $(call install-file)
erikj@6824 370 $(CHMOD) -f ug+w $@
ohair@5221 371
ohair@5819 372 BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/management/index.html \
ihse@8330 373 $(JDK_OUTPUTDIR)/demo/jvmti/index.html
ohair@5221 374
ohair@5221 375 ##################################################################################################
ohair@5221 376
ohair@5221 377 # The netbeans project files are copied into the demo directory.
ksrini@9087 378 ifeq ($(OPENJDK_TARGET_OS), solaris)
ksrini@9087 379 BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/share/demo/nbproject/%, \
ksrini@9087 380 $(JDK_OUTPUTDIR)/demo/nbproject/%, \
ksrini@9087 381 $(filter-out $(JDK_TOPDIR)/src/share/demo/nbproject/jfc/SwingApplet%, \
ksrini@9087 382 $(call CacheFind, $(JDK_TOPDIR)/src/share/demo/nbproject)))
ksrini@9087 383 else
ksrini@9087 384 BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/share/demo/nbproject/%, \
ihse@8330 385 $(JDK_OUTPUTDIR)/demo/nbproject/%, \
ihse@8330 386 $(call CacheFind, $(JDK_TOPDIR)/src/share/demo/nbproject))
ksrini@9087 387 endif
ohair@5221 388
ihse@8330 389 $(JDK_OUTPUTDIR)/demo/nbproject/%: $(JDK_TOPDIR)/src/share/demo/nbproject/%
erikj@6824 390 $(call install-file)
erikj@5507 391 $(CHMOD) -f ug+w $@
ohair@5221 392
ohair@5221 393 ##################################################################################################
ohair@5221 394
ohair@5819 395 $(JDK_OUTPUTDIR)/demo/README: $(JDK_TOPDIR)/src/share/demo/README
erikj@6824 396 $(call install-file)
erikj@5507 397
ohair@5819 398 BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/README
ohair@5221 399
ohair@5221 400 ##################################################################################################
ohair@5221 401
erikj@5596 402 ifeq ($(OPENJDK_TARGET_OS), solaris)
erikj@5507 403
ihse@8330 404 $(JDK_OUTPUTDIR)/democlasses/jni/Poller/%: $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/%
erikj@6824 405 $(call install-file)
erikj@6824 406 $(CHMOD) -f ug+w $@
erikj@5507 407
ihse@8330 408 $(JDK_OUTPUTDIR)/demo/jni/Poller/README.txt: $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/README.txt
erikj@6824 409 $(call install-file)
erikj@6824 410 $(CHMOD) -f ug+w $@
erikj@5507 411
ihse@8330 412 $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar: \
ihse@8330 413 $(JDK_OUTPUTDIR)/democlasses/jni/Poller/README.txt $(JDK_OUTPUTDIR)/democlasses/jni/Poller/Poller.c
erikj@5507 414
ihse@8330 415 $(eval $(call SetupJavaCompilation,BUILD_DEMO_POLLER_JAR, \
ihse@8330 416 SETUP := GENERATE_USINGJDKBYTECODE, \
ihse@8330 417 SRC := $(JDK_TOPDIR)/src/solaris/demo/jni/Poller, \
ihse@8330 418 BIN := $(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
ihse@8330 419 HEADERS := $(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
ihse@8330 420 JAR := $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar, \
ihse@8845 421 MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
ihse@8330 422 SRCZIP := $(JDK_OUTPUTDIR)/demo/jni/Poller/src.zip, \
ihse@8330 423 COPY := README.txt Poller.c, \
ihse@8330 424 JARMAIN := Client))
erikj@5507 425
erikj@5507 426
erikj@5507 427
ihse@8330 428 BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar $(JDK_OUTPUTDIR)/demo/jni/Poller/src.zip \
ihse@8330 429 $(JDK_OUTPUTDIR)/demo/jni/Poller/README.txt
erikj@5507 430
ihse@8330 431 $(eval $(call SetupNativeCompilation,BUILD_LIBPOLLER, \
ihse@8330 432 SRC := $(JDK_TOPDIR)/src/solaris/demo/jni/Poller, \
ihse@8330 433 LANG := C, \
ihse@8330 434 OPTIMIZATION := LOW, \
ihse@8330 435 CFLAGS := $(CFLAGS_JDKLIB) $(SHARED_LIBRARY_FLAGS) \
ihse@8330 436 -I$(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
ihse@8330 437 LDFLAGS := $(LDFLAGS_JDKLIB), \
ihse@8330 438 LDFLAGS_SUFFIX_solaris := -lc, \
ihse@8330 439 OBJECT_DIR := $(JDK_OUTPUTDIR)/demoobjs/jni/Poller, \
ihse@8330 440 OUTPUT_DIR := $(JDK_OUTPUTDIR)/demoobjs, \
ihse@8330 441 LIBRARY := Poller))
erikj@5507 442
ihse@8330 443 #
ihse@8330 444 # We can only compile native code after jar has been build (since we depend on generated .h files)
ihse@8330 445 #
ihse@8330 446 $(JDK_OUTPUTDIR)/demoobjs/jni/Poller/Poller.o: $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar
erikj@5507 447
ihse@8330 448 $(JDK_OUTPUTDIR)/demo/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX): \
ihse@8330 449 $(JDK_OUTPUTDIR)/demoobjs/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
erikj@6824 450 $(call install-file)
erikj@5507 451
ihse@8330 452 BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
erikj@5507 453
erikj@5507 454 endif
erikj@5507 455
erikj@5507 456 ##################################################################################################
erikj@5507 457
erikj@5507 458 ifndef OPENJDK
dwanvik@9958 459 DB_DEMO_ZIPFILE := $(wildcard $(JDK_TOPDIR)/src/closed/share/db/db-derby-*-bin.zip)
erikj@5507 460
ihse@8330 461 $(JDK_OUTPUTDIR)/demo/_the.db.unzipped: $(DB_DEMO_ZIPFILE)
erikj@5507 462 $(MKDIR) -p $(@D)
ohair@5819 463 $(RM) -r $(JDK_OUTPUTDIR)/demo/db $(JDK_OUTPUTDIR)/demo/demo
ohair@6025 464 $(CD) $(JDK_OUTPUTDIR)/demo && $(UNZIP) -q -o $<
dwanvik@7092 465 $(MV) $(JDK_OUTPUTDIR)/demo/db-derby-*-bin/demo $(JDK_OUTPUTDIR)/demo/db
dwanvik@7092 466 $(CD) $(JDK_OUTPUTDIR)/demo && $(RM) -r db-derby-*-bin
erikj@5507 467 $(TOUCH) $@
erikj@5507 468
ihse@8330 469 # Copy this after the unzip above to avoid race with directory creation and mv command.
ihse@8330 470 $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html: \
ihse@8330 471 $(JDK_TOPDIR)/src/closed/share/db/README-JDK-DEMOS.html \
ihse@8330 472 | $(JDK_OUTPUTDIR)/demo/_the.db.unzipped
dwanvik@7092 473 $(MKDIR) -p $(@D)
dwanvik@7092 474 $(CAT) $< | $(SED) "s/XXXX/$(shell cat $(JDK_TOPDIR)/src/closed/share/db/COPYRIGHTYEAR)/" > $@
erikj@6824 475
ihse@8330 476 BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/_the.db.unzipped $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html
erikj@5507 477 endif
erikj@5507 478
erikj@5507 479 ##################################################################################################
erikj@5507 480
erikj@5507 481 all: $(BUILD_DEMOS)
ohair@5221 482
ohair@5221 483 .PHONY: all