1 #
   2 # Copyright (c) 2011, 2015, 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 include SetupJavaCompilers.gmk
  33 
  34 # Prepare the find cache.
  35 $(eval $(call FillCacheFind, $(JDK_TOPDIR)/src))
  36 
  37 # Append demo goals to this variable.
  38 BUILD_DEMOS =
  39 
  40 # The demo structure and contents should really be cleaned up.
  41 # Now every other demo has its own quirks where to put the
  42 # READMEs and other files.
  43 
  44 DEMO_SHARE_SRC := $(JDK_TOPDIR)/src/demo/share
  45 DEMO_CLOSED_SHARE_SRC := $(JDK_TOPDIR)/src/closed/demo/share
  46 DEMO_SOLARIS_SRC := $(JDK_TOPDIR)/src/demo/solaris
  47 DEMO_OS_TYPE_SRC := $(JDK_TOPDIR)/src/demo/$(OPENJDK_TARGET_OS_TYPE)
  48 VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/common/version.rc
  49 
  50 ##################################################################################################
  51 
  52 define SetupAppletDemo
  53   $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_APPLET_$1, \
  54       SETUP := GENERATE_USINGJDKBYTECODE, \
  55       SRC := $(JDK_TOPDIR)/src/$3demo/share/applets/$1, \
  56       BIN := $(SUPPORT_OUTPUTDIR)/demo/image/applets/$1, \
  57       COPY := .html .java .xyz .obj .au .gif, \
  58       DISABLE_SJAVAC := $2))
  59       BUILD_DEMOS += $$(BUILD_DEMO_APPLET_$1)
  60 endef
  61 
  62 ifneq ($(OPENJDK_TARGET_OS), solaris)
  63   $(eval $(call SetupAppletDemo,ArcTest))
  64   $(eval $(call SetupAppletDemo,BarChart))
  65   $(eval $(call SetupAppletDemo,Blink))
  66   $(eval $(call SetupAppletDemo,CardTest))
  67   $(eval $(call SetupAppletDemo,Clock))
  68   $(eval $(call SetupAppletDemo,DitherTest))
  69   $(eval $(call SetupAppletDemo,DrawTest))
  70   $(eval $(call SetupAppletDemo,Fractal))
  71   $(eval $(call SetupAppletDemo,GraphicsTest))
  72   $(eval $(call SetupAppletDemo,NervousText))
  73   $(eval $(call SetupAppletDemo,SimpleGraph))
  74   $(eval $(call SetupAppletDemo,SortDemo))
  75   $(eval $(call SetupAppletDemo,SpreadSheet))
  76 
  77   ifndef OPENJDK
  78     $(eval $(call SetupAppletDemo,Animator,,closed/))
  79     $(eval $(call SetupAppletDemo,GraphLayout,true,closed/))
  80     $(eval $(call SetupAppletDemo,JumpingBox,,closed/))
  81     $(eval $(call SetupAppletDemo,TicTacToe,,closed/))
  82   endif
  83 endif
  84 
  85 ##################################################################################################
  86 
  87 PATTERNS_TO_COPY = .html .txt .properties .js .gif .jpg .theme .data .opt README .c .h .png .ttf .xyz .obj
  88 
  89 define SetupDemo
  90   # Param 1 = Name of the demo
  91   # Param 2 = Subdirectory of the demo below the demo directory.
  92   # Param 3 = Additional javac flags.
  93   # Param 4 = The main class for the jar.
  94   # Param 5 = Additional source directory.
  95   # Param 6 = Extra dir below $(JDK_TOPDIR)/src (closed)
  96   # Param 7 = List of files to copy
  97   # Param 8 = Base name of jar file. Defaults to $1
  98   # Param 9 = Exclude list
  99   # Param 10 = Extra copy patterns
 100   # Param 11 = Extra manifest attribute
 101   # Param 12 = Suffix for compiler setup name
 102 
 103   $1_SRC_BASE := $(JDK_TOPDIR)/src/$6demo/share/$2/$1
 104   # In some demos the source is found in a subdir called src.
 105   $1_MAIN_SRC := $$(wildcard $$($1_SRC_BASE)/src)
 106   ifeq ($$($1_MAIN_SRC), )
 107     $1_MAIN_SRC := $$($1_SRC_BASE)
 108   endif
 109 
 110   ifneq ($8, )
 111     $1_JARFILE := $8.jar
 112   else
 113     $1_JARFILE := $1.jar
 114   endif
 115 
 116   ifeq ($(findstring $1,Laffy SwingSet3), )
 117     $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_$1, \
 118         SETUP := GENERATE_USINGJDKBYTECODE, \
 119         ADD_JAVAC_FLAGS := $3, \
 120         SRC := $$($1_MAIN_SRC) $5, \
 121         BIN := $(SUPPORT_OUTPUTDIR)/demo/classes/$2/$1, \
 122         COPY := $(PATTERNS_TO_COPY) $(10), \
 123         JAR := $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/$$($1_JARFILE), \
 124         JARMAIN := $4, \
 125         MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
 126         EXTRA_MANIFEST_ATTR := $(11), \
 127         SRCZIP := $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/src.zip, \
 128         EXCLUDE_FILES := $9, \
 129         DISABLE_SJAVAC := $(12)))
 130 
 131     BUILD_DEMOS += $$(BUILD_DEMO_$1) \
 132         $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/$$($1_JARFILE) \
 133         $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/src.zip
 134   endif
 135 
 136   # Copy files.
 137   $1_COPY_TARGETS := $$(patsubst $$($1_SRC_BASE)/%, \
 138       $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/%, \
 139       $$(wildcard $$(addprefix $$($1_SRC_BASE)/, $7)))
 140   ifneq ($7, )
 141     $(SUPPORT_OUTPUTDIR)/demo/image/$2/$1/%: $$($1_SRC_BASE)/%
 142         $$(call install-file)
 143         $(CHMOD) -f ug+w $$@
 144 
 145     BUILD_DEMOS += $$($1_COPY_TARGETS)
 146   endif
 147 
 148 endef
 149 
 150 $(eval $(call SetupDemo,CodePointIM,jfc,,CodePointIM,,,*.html))
 151 $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/_the.services: \
 152     $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/CodePointIM.jar \
 153     $(DEMO_SHARE_SRC)/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor
 154         (cd $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM && \
 155         $(MKDIR) -p _the.tmp/META-INF/services && \
 156         $(CP) $(DEMO_SHARE_SRC)/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor _the.tmp/META-INF/services && \
 157         cd ./_the.tmp && \
 158         $(JAR) uf $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/CodePointIM.jar META-INF/services/java.awt.im.spi.InputMethodDescriptor && \
 159         cd ./META-INF/services && \
 160         $(JAR) uf $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/CodePointIM.jar java.awt.im.spi.InputMethodDescriptor)
 161         $(RM) -r $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/_the.tmp
 162         $(TOUCH) $@
 163 
 164 BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jfc/CodePointIM/_the.services
 165 
 166 ifneq ($(OPENJDK_TARGET_OS), solaris)
 167   $(eval $(call SetupDemo,MoleculeViewer,applets,,XYZChemModel,,,example*.html *.java))
 168   $(eval $(call SetupDemo,WireFrame,applets,,ThreeD,,,example*.html *.java))
 169   $(eval $(call SetupDemo,SwingApplet,jfc,,SwingApplet,,,README* *.html))
 170 endif
 171 $(eval $(call SetupDemo,FileChooserDemo,jfc,,FileChooserDemo,,,README*))
 172 $(eval $(call SetupDemo,Font2DTest,jfc,,Font2DTest,,,*.html *.txt))
 173 $(eval $(call SetupDemo,Metalworks,jfc,,Metalworks,,,README*))
 174 $(eval $(call SetupDemo,Notepad,jfc,,Notepad,,,README*))
 175 $(eval $(call SetupDemo,SampleTree,jfc,,SampleTree,,,README*))
 176 $(eval $(call SetupDemo,TableExample,jfc,,TableExample,,,README*))
 177 $(eval $(call SetupDemo,TransparentRuler,jfc,,transparentruler.Ruler,,,README*))
 178 $(eval $(call SetupDemo,jconsole-plugin,scripting,,,,,*.xml *.txt,,,,Main-Class: \n))
 179 $(eval $(call SetupDemo,FullThreadDump,management,,FullThreadDump,,,README*))
 180 $(eval $(call SetupDemo,JTop,management,,JTop,,,README*))
 181 $(eval $(call SetupDemo,MemoryMonitor,management,,MemoryMonitor,,,README*))
 182 $(eval $(call SetupDemo,VerboseGC,management,,VerboseGC,,,README*))
 183 
 184 ifndef OPENJDK
 185   $(eval $(call SetupDemo,Laffy,jfc,,,,closed/,*))
 186   $(eval $(call SetupDemo,SwingSet3,jfc,,,,closed/,*))
 187 
 188   $(eval $(call SetupDemo,Java2D,jfc,,java2d.Java2Demo,,closed/,*.html README*,Java2Demo))
 189   $(eval $(call SetupDemo,Stylepad,jfc,,Stylepad, \
 190   $(DEMO_SHARE_SRC)/jfc/Notepad,closed/,*.txt,,$(DEMO_SHARE_SRC)/jfc/Notepad/README.txt))
 191   $(eval $(call SetupDemo,SwingSet2,jfc,,SwingSet2,,closed/,README* *.html,,,.java COPYRIGHT, \
 192       SplashScreen-Image: resources/images/splash.png,true))
 193 
 194   BUILD_DEMOS += $(patsubst $(DEMO_CLOSED_SHARE_SRC)/nbproject/%, \
 195       $(SUPPORT_OUTPUTDIR)/demo/image/nbproject/%, \
 196       $(call CacheFind, $(DEMO_CLOSED_SHARE_SRC)/nbproject))
 197 
 198   $(SUPPORT_OUTPUTDIR)/demo/image/nbproject/%: $(DEMO_CLOSED_SHARE_SRC)/nbproject/%
 199         $(call install-file)
 200         $(CHMOD) -f ug+w $@
 201 endif
 202 
 203 ##################################################################################################
 204 
 205 # In the old makefiles, j2dbench was not compiled.
 206 #$(eval $(call SetupDemo,J2DBench, java2d, /src, , j2dbench/J2DBench))
 207 
 208 # JVMTI demos are a bit strange and share some files, but be careful the
 209 # shared files are just the *.c and *.h files, not the README or sample
 210 # makefiles. So we always exclude the README.txt and sample.makefile.txt
 211 # from the extra sources.
 212 define SetupJVMTIDemo
 213   # Param 1 = Name of the demo
 214   # Param 2 = add these directories to the includes, default is agent_util
 215   # Param 3 = extra CFLAGS
 216   # Param 4 = C or C++ (defaults to C)
 217   # Param 5 = libs for unix
 218   # Param 6 = libs for windows
 219   # Param 7 = libs for solaris
 220   # Param 8 = libs for linux
 221   # Param 9 = extra directories with required sources
 222   # Param 10 = DISABLED_WARNINGS_gcc
 223   # Param 11 = DISABLED_WARNINGS_microsoft
 224   # Param 12 = DISABLED_WARNINGS_clang
 225   BUILD_DEMO_JVMTI_$1_EXTRA_SRC := \
 226       $$(wildcard $(DEMO_OS_TYPE_SRC)/jvmti/$1) \
 227       $$(wildcard $$(addprefix $(DEMO_SHARE_SRC)/jvmti/, $2)) \
 228       $9
 229   BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE := \
 230       $$(wildcard $$(patsubst %, $(DEMO_SHARE_SRC)/jvmti/%/README.txt, $2)) \
 231       $$(wildcard $$(patsubst %, $(DEMO_SHARE_SRC)/jvmti/%/sample.makefile.txt, $2))
 232   BUILD_DEMO_JVMTI_$1_EXTRA_INC := $$(addprefix -I, $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC))
 233   BUILD_DEMO_JVMTI_$1_LANG := C
 234   ifneq (, $4)
 235     BUILD_DEMO_JVMTI_$1_LANG := $4
 236   endif
 237   ifeq (C++, $4)
 238     $1_EXTRA_CXX := $(LDFLAGS_CXX_JDK) $(LIBCXX)
 239   endif
 240 
 241   $1_CXXFLAGS := $(CXXFLAGS_JDKLIB) -I$(DEMO_SHARE_SRC)/jvmti/$1 \
 242       $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3 \
 243       $(CXXFLAGS_DEBUG_SYMBOLS)
 244   ifeq ($1-$(OPENJDK_TARGET_CPU_ARCH), waiters-sparc)
 245     $1_FILTER := -xregs=no%appl
 246     $1_CXXFLAGS := $$(filter-out $$($1_FILTER), $$($1_CXXFLAGS))
 247   endif
 248 
 249   # Workaround for CFLAGS_JDKLIB containing ',' on solaris. If this is added as 'CFLAGS' to the
 250   # eval call below, the comma gets expanded too early.
 251   BUILD_DEMO_JVMTI_$1_CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_DEBUG_SYMBOLS) \
 252       -I$(DEMO_SHARE_SRC)/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3
 253 
 254   # Remove the -incremental:no setting to get .ilk-files like in the old build.
 255   $$(eval $$(call SetupNativeCompilation,BUILD_DEMO_JVMTI_$1, \
 256       SRC := $(DEMO_SHARE_SRC)/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC), \
 257       LANG := $$(BUILD_DEMO_JVMTI_$1_LANG), \
 258       OPTIMIZATION := LOW, \
 259       CXXFLAGS := $$($1_CXXFLAGS), \
 260       DISABLED_WARNINGS_gcc := $(10), \
 261       DISABLED_WARNINGS_clang := $(12), \
 262       DISABLED_WARNINGS_microsoft := $(11), \
 263       LDFLAGS := $(filter-out -incremental:no -opt:ref, $(LDFLAGS_JDKLIB)), \
 264       LDFLAGS_macosx := $(call SET_EXECUTABLE_ORIGIN), \
 265       LDFLAGS_SUFFIX := $$($1_EXTRA_CXX), \
 266       LDFLAGS_SUFFIX_unix := $5, \
 267       LDFLAGS_SUFFIX_windows := $6, \
 268       LDFLAGS_SUFFIX_solaris := $7 -lc, \
 269       LDFLAGS_SUFFIX_linux := $8, \
 270       VERSIONINFO_RESOURCE := $(VERSION_INFO_RESOURCE), \
 271       RC_FLAGS := $$(RC_FLAGS) \
 272           -D "JDK_FNAME=$1.dll" \
 273           -D "JDK_INTERNAL_NAME=$1" \
 274           -D "JDK_FTYPE=0x2L", \
 275       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/demo/native/jvmti/$1, \
 276       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/lib, \
 277       LIBRARY := $1))
 278 
 279   $$(eval $$(call SetupZipArchive,BUILD_DEMO_JVMTI_SRC_$1, \
 280       SRC := $(DEMO_SHARE_SRC)/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC), \
 281       EXCLUDE_FILES := $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE), \
 282       ZIP := $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/src.zip))
 283 
 284   $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/README.txt: $(DEMO_SHARE_SRC)/jvmti/$1/README.txt
 285         $$(call install-file)
 286         $(CHMOD) -f ug+w $$@
 287 
 288   ifneq (, $$(wildcard $(DEMO_SHARE_SRC)/jvmti/$1/*.java))
 289     $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_JVMTI_$1_JAVA, \
 290         SETUP := GENERATE_USINGJDKBYTECODE, \
 291         SRC := $(DEMO_SHARE_SRC)/jvmti/$1, \
 292         BIN := $(SUPPORT_OUTPUTDIR)/demo/classes/jvmti/$1, \
 293         COPY := $(PATTERNS_TO_COPY), \
 294         JAR := $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/$1.jar, \
 295         EXTRA_MANIFEST_ATTR := Main-Class: \n, \
 296         MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf))
 297 
 298     BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/$1.jar
 299   endif
 300 
 301   BUILD_DEMOS += $$(BUILD_DEMO_JVMTI_$1) \
 302       $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/src.zip \
 303       $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/README.txt
 304 
 305   ifeq ($(OPENJDK_TARGET_OS), windows)
 306     # These files normally end up in OBJECT_DIR but for demos they
 307     # are supposed to be included in the distro.
 308     $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/lib/$1.lib: $$(BUILD_DEMO_JVMTI_$1)
 309         $(CP) $(SUPPORT_OUTPUTDIR)/demo/native/jvmti/$1/$1.lib $$@
 310 
 311     $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/lib/$1.exp: $$(BUILD_DEMO_JVMTI_$1)
 312         $(CP) $(SUPPORT_OUTPUTDIR)/demo/native/jvmti/$1/$1.exp $$@
 313 
 314     BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/lib/$1.lib \
 315         $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/$1/lib/$1.exp
 316   endif
 317 endef
 318 
 319 $(eval $(call SetupJVMTIDemo,compiledMethodLoad, agent_util, , , , , , , , pointer-to-int-cast format, , format))
 320 $(eval $(call SetupJVMTIDemo,gctest, agent_util))
 321 $(eval $(call SetupJVMTIDemo,heapTracker, agent_util java_crw_demo))
 322 $(eval $(call SetupJVMTIDemo,heapViewer, agent_util))
 323 $(eval $(call SetupJVMTIDemo,minst, agent_util java_crw_demo))
 324 $(eval $(call SetupJVMTIDemo,mtrace, agent_util java_crw_demo))
 325 $(eval $(call SetupJVMTIDemo,waiters, agent_util, , C++, , , , , , , 4101))
 326 $(eval $(call SetupJVMTIDemo,versionCheck, agent_util))
 327 
 328 ##################################################################################################
 329 
 330 $(SUPPORT_OUTPUTDIR)/demo/image/management/index.html: $(DEMO_SHARE_SRC)/management/index.html
 331         $(call install-file)
 332         $(CHMOD) -f ug+w $@
 333 
 334 $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/index.html: $(DEMO_SHARE_SRC)/jvmti/index.html
 335         $(call install-file)
 336         $(CHMOD) -f ug+w $@
 337 
 338 BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/management/index.html \
 339     $(SUPPORT_OUTPUTDIR)/demo/image/jvmti/index.html
 340 
 341 ##################################################################################################
 342 
 343 # The netbeans project files are copied into the demo directory.
 344 ifeq ($(OPENJDK_TARGET_OS), solaris)
 345   BUILD_DEMOS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
 346     $(SUPPORT_OUTPUTDIR)/demo/image/nbproject/%, \
 347     $(filter-out $(DEMO_SHARE_SRC)/nbproject/jfc/SwingApplet%, \
 348     $(call CacheFind, $(DEMO_SHARE_SRC)/nbproject)))
 349 else
 350   BUILD_DEMOS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
 351     $(SUPPORT_OUTPUTDIR)/demo/image/nbproject/%, \
 352     $(call CacheFind, $(DEMO_SHARE_SRC)/nbproject))
 353 endif
 354 
 355 $(SUPPORT_OUTPUTDIR)/demo/image/nbproject/%: $(DEMO_SHARE_SRC)/nbproject/%
 356         $(call install-file)
 357         $(CHMOD) -f ug+w $@
 358 
 359 ##################################################################################################
 360 
 361 $(SUPPORT_OUTPUTDIR)/demo/image/README: $(DEMO_SHARE_SRC)/README
 362         $(call install-file)
 363 
 364 BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/README
 365 
 366 ##################################################################################################
 367 
 368 ifeq ($(OPENJDK_TARGET_OS), solaris)
 369 
 370   $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller/%: $(DEMO_SOLARIS_SRC)/jni/Poller/%
 371         $(call install-file)
 372         $(CHMOD) -f ug+w $@
 373 
 374   $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/README.txt: $(DEMO_SOLARIS_SRC)/jni/Poller/README.txt
 375         $(call install-file)
 376         $(CHMOD) -f ug+w $@
 377 
 378   $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/Poller.jar: \
 379       $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller/README.txt \
 380       $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller/Poller.c
 381 
 382   $(eval $(call SetupJavaCompilation,BUILD_DEMO_POLLER_JAR, \
 383       SETUP := GENERATE_USINGJDKBYTECODE, \
 384       SRC := $(DEMO_SOLARIS_SRC)/jni/Poller, \
 385       BIN := $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
 386       HEADERS := $(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
 387       JAR := $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/Poller.jar, \
 388       MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
 389       SRCZIP := $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/src.zip, \
 390       COPY := README.txt Poller.c, \
 391       JARMAIN := Client))
 392 
 393 
 394 
 395   BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/Poller.jar \
 396       $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/src.zip \
 397       $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/README.txt
 398 
 399   $(eval $(call SetupNativeCompilation,BUILD_LIBPOLLER, \
 400       SRC := $(DEMO_SOLARIS_SRC)/jni/Poller, \
 401       LANG := C, \
 402       OPTIMIZATION := LOW, \
 403       CFLAGS := $(CFLAGS_JDKLIB) $(SHARED_LIBRARY_FLAGS) \
 404           -I$(SUPPORT_OUTPUTDIR)/demo/classes/jni/Poller, \
 405       LDFLAGS := $(LDFLAGS_JDKLIB), \
 406       LDFLAGS_SUFFIX_solaris := -lc, \
 407       OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/demo/native/jni/Poller, \
 408       OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/demo/native, \
 409       LIBRARY := Poller))
 410 
 411   #
 412   # We can only compile native code after jar has been build (since we depend on generated .h files)
 413   #
 414   $(SUPPORT_OUTPUTDIR)/demo/native/jni/Poller/Poller.o: $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/Poller.jar
 415 
 416   $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX): \
 417       $(SUPPORT_OUTPUTDIR)/demo/native/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
 418         $(call install-file)
 419 
 420   BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
 421 
 422 endif
 423 
 424 ##################################################################################################
 425 
 426 ifndef OPENJDK
 427   DB_ZIP_DIR := $(wildcard $(JDK_TOPDIR)/src/closed/db)
 428   DB_DEMO_ZIPFILE := $(wildcard $(DB_ZIP_DIR)/*.zip)
 429 
 430   $(SUPPORT_OUTPUTDIR)/demo/image/_the.db.unzipped: $(DB_DEMO_ZIPFILE)
 431         $(MKDIR) -p $(@D)
 432         $(RM) -r $(SUPPORT_OUTPUTDIR)/demo/image/db $(SUPPORT_OUTPUTDIR)/demo/image/demo
 433         $(CD) $(SUPPORT_OUTPUTDIR)/demo/image && $(UNZIP) -q -o $<
 434         $(MV) $(SUPPORT_OUTPUTDIR)/demo/image/db-derby-*-bin/demo $(SUPPORT_OUTPUTDIR)/demo/image/db
 435         $(CD) $(SUPPORT_OUTPUTDIR)/demo/image && $(RM) -r db-derby-*-bin
 436         $(TOUCH) $@
 437 
 438   # Copy this after the unzip above to avoid race with directory creation and mv command.
 439   $(SUPPORT_OUTPUTDIR)/demo/image/db/README-JDK-DEMOS.html: \
 440       $(DB_ZIP_DIR)/README-JDK-DEMOS.html \
 441       | $(SUPPORT_OUTPUTDIR)/demo/image/_the.db.unzipped
 442         $(MKDIR) -p $(@D)
 443         $(CAT) $< | $(SED) "s/XXXX/$(shell cat $(DB_ZIP_DIR)/COPYRIGHTYEAR)/" > $@
 444 
 445   BUILD_DEMOS += $(SUPPORT_OUTPUTDIR)/demo/image/_the.db.unzipped $(SUPPORT_OUTPUTDIR)/demo/image/db/README-JDK-DEMOS.html
 446 endif
 447 
 448 ##################################################################################################
 449 
 450 all: $(BUILD_DEMOS)
 451 
 452 .PHONY: all