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