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