CompileDemos.gmk 17.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
#
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.  Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
#

default: all

include $(SPEC)
include MakeBase.gmk
include JavaCompilation.gmk
include NativeCompilation.gmk

# Setup the java compilers for the JDK build.
include Setup.gmk

# Append demo goals to this variable.
BUILD_DEMOS=

# The demo structure and contents should really be cleaned up.
# Now every other demo has its own quirks where to put the
# READMEs and other files.

##################################################################################################

define SetupAppletDemo
     $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_APPLET_$1,\
                SETUP:=GENERATE_USINGJDKBYTECODE$2,\
		SRC:=$(JDK_TOPDIR)/src/$3share/demo/applets/$1,\
		BIN:=$(JDK_OUTPUTDIR)/newdemo/applets/$1,\
		COPY:=.html .java .xyz .obj .au .gif))
     BUILD_DEMOS += $$(BUILD_DEMO_APPLET_$1)
endef

$(eval $(call SetupAppletDemo,ArcTest))
$(eval $(call SetupAppletDemo,BarChart))
$(eval $(call SetupAppletDemo,Blink))
$(eval $(call SetupAppletDemo,CardTest))
$(eval $(call SetupAppletDemo,Clock))
$(eval $(call SetupAppletDemo,DitherTest))
$(eval $(call SetupAppletDemo,DrawTest))
$(eval $(call SetupAppletDemo,Fractal))
$(eval $(call SetupAppletDemo,GraphicsTest))
$(eval $(call SetupAppletDemo,MoleculeViewer))
$(eval $(call SetupAppletDemo,NervousText))
$(eval $(call SetupAppletDemo,SimpleGraph))
$(eval $(call SetupAppletDemo,SortDemo))
$(eval $(call SetupAppletDemo,SpreadSheet))
# Build WireFrame without a server since it
# has a class Matrix3D that also exists in MoleculeViewer.
$(eval $(call SetupAppletDemo,WireFrame,_NOSERV))

ifndef OPENJDK
    $(eval $(call SetupAppletDemo,Animator,,closed/))
    $(eval $(call SetupAppletDemo,GraphLayout,_NOSERV,closed/))
    $(eval $(call SetupAppletDemo,JumpingBox,,closed/))
    $(eval $(call SetupAppletDemo,TicTacToe,,closed/))
endif

##################################################################################################

PATTERNS_TO_COPY=.html .txt .properties .js .gif .jpg .theme .data .opt README .c .h .png .ttf

define SetupDemo
    # Param 1 = Name of the demo
    # Param 2 = Subdirectory of the demo below the demo directory.
    # Param 3 = Additional javac flags.
    # Param 4 = The main class for the jar.
    # Param 5 = Additional source directory.
    # Param 6 = Extra dir below $(JDK_TOPDIR)/src (closed)
    # Param 7 = List of files to copy
    # Param 8 = Base name of jar file. Defaults to $1
    # Param 9 = Exclude list
    # Param 10 = Extra copy patterns
    # Param 11 = Extra manifest attribute
    # Param 12 = Suffix for compiler setup name

    # In some demos the source is found in a subdir called src.
    $1_MAIN_SRC:=$$(wildcard $(JDK_TOPDIR)/src/$6share/demo/$2/$1/src)
    ifeq ($$($1_MAIN_SRC),)
        $1_MAIN_SRC:=$(JDK_TOPDIR)/src/$6share/demo/$2/$1
    endif

    ifneq ($8,)
        $1_JARFILE := $8.jar
    else
        $1_JARFILE := $1.jar
    endif

    # Compile java classes if there are any.
    $1_JAVA_FILES_EXIST := $$(shell $$(FIND) $$($1_MAIN_SRC) -name "*.java")

    ifneq ($$($1_JAVA_FILES_EXIST),)
        $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_$1,\
                SETUP:=GENERATE_USINGJDKBYTECODE$(12),\
                ADD_JAVAC_FLAGS:=$3,\
		SRC:=$$($1_MAIN_SRC) $5,\
		BIN:=$(JDK_OUTPUTDIR)/newdemoclasses/$2/$1,\
		COPY:=$(PATTERNS_TO_COPY) $(10),\
		JAR:=$(JDK_OUTPUTDIR)/newdemo/$2/$1/$$($1_JARFILE),\
		JARMAIN:=$4,\
		MANIFEST:=$(JDK_TOPDIR)/make/tools/manifest.mf,\
		EXTRA_MANIFEST_ATTR:=$(11),\
		SRCZIP:=$(JDK_OUTPUTDIR)/newdemo/$2/$1/src.zip,\
		EXCLUDE_FILES:=$9))

        BUILD_DEMOS +=  $$(BUILD_DEMO_$1) \
			$(JDK_OUTPUTDIR)/newdemo/$2/$1/$$($1_JARFILE) \
			$(JDK_OUTPUTDIR)/newdemo/$2/$1/src.zip 
    endif

    # Copy files.
    $1_COPY_TARGETS :=  $$(patsubst $(JDK_TOPDIR)/src/$6share/demo/$2/$1/%,\
			$(JDK_OUTPUTDIR)/newdemo/$2/$1/%,\
			$$(wildcard $$(addprefix $(JDK_TOPDIR)/src/$6share/demo/$2/$1/,$7)))
    ifneq ($7,)
        $(JDK_OUTPUTDIR)/newdemo/$2/$1/% : $(JDK_TOPDIR)/src/$6share/demo/$2/$1/%
137 138 139
		$(MKDIR) -p $$(@D)
		$(CP) $$< $$@
		$(CHMOD) -f ug+w $$@
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157

        BUILD_DEMOS += $$($1_COPY_TARGETS)
    endif

endef

$(eval $(call SetupDemo,CodePointIM,jfc,,CodePointIM,,,*.html))
$(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/_the.services : \
			$(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/CodePointIM.jar \
			$(JDK_TOPDIR)/src/share/demo/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor
	(cd $(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM && \
		$(MKDIR) -p _the.tmp/META-INF/services && \
		$(CP) $(JDK_TOPDIR)/src/share/demo/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor _the.tmp/META-INF/services && \
		cd _the.tmp && \
		$(JAR) uf $(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/CodePointIM.jar META-INF/services/java.awt.im.spi.InputMethodDescriptor && \
		cd META-INF/services && \
		$(JAR) uf $(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/CodePointIM.jar java.awt.im.spi.InputMethodDescriptor)
	$(RM) -r $(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/_the.tmp
158
	$(TOUCH) $@
159 160 161 162 163 164 165 166 167 168 169

BUILD_DEMOS+=$(JDK_OUTPUTDIR)/newdemo/jfc/CodePointIM/_the.services

$(eval $(call SetupDemo,FileChooserDemo,jfc,,FileChooserDemo,,,README*))
$(eval $(call SetupDemo,Font2DTest,jfc,,Font2DTest,,,*.html *.txt))
$(eval $(call SetupDemo,Metalworks,jfc,,Metalworks,,,README*))
$(eval $(call SetupDemo,Notepad,jfc,,Notepad,,,README*))
$(eval $(call SetupDemo,SampleTree,jfc,,SampleTree,,,README*))
$(eval $(call SetupDemo,SwingApplet,jfc,,SwingApplet,,,README* *.html))
$(eval $(call SetupDemo,TableExample,jfc,,TableExample,,,README*))
$(eval $(call SetupDemo,TransparentRuler,jfc,,transparentruler.Ruler,,,README*))
170
$(eval $(call SetupDemo,jconsole-plugin,scripting,-cp $(JDK_OUTPUTDIR)/lib/jconsole.jar,,,,*.xml *.txt,,,,Main-Class: \n))
171 172 173 174
$(eval $(call SetupDemo,FullThreadDump,management,,FullThreadDump,,,README*))
$(eval $(call SetupDemo,JTop,management,-cp $(JDK_OUTPUTDIR)/lib/jconsole.jar,JTop,,,README*))
$(eval $(call SetupDemo,MemoryMonitor,management,,MemoryMonitor,,,README*))
$(eval $(call SetupDemo,VerboseGC,management,,VerboseGC,,,README*))
175
$(eval $(call SetupDemo,zipfs,nio,,,,,README* *.java,,,,Main-Class: \n))
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190

ifndef OPENJDK
    $(eval $(call SetupDemo,Laffy,jfc,,,,closed/,*))
    $(eval $(call SetupDemo,SwingSet3,jfc,,,,closed/,*))

    $(eval $(call SetupDemo,Java2D,jfc,,java2d.Java2Demo,,closed/,*.html README*,Java2Demo))
    $(eval $(call SetupDemo,Stylepad,jfc,,Stylepad,\
		$(JDK_TOPDIR)/src/share/demo/jfc/Notepad,closed/,*.txt,,$(JDK_TOPDIR)/src/share/demo/jfc/Notepad/README.txt))
    $(eval $(call SetupDemo,SwingSet2,jfc,,SwingSet2,,closed/,README* *.html,,,.java COPYRIGHT,\
		SplashScreen-Image: resources/images/splash.png,_NOSERV))

    BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/closed/share/demo/nbproject/%,\
			$(JDK_OUTPUTDIR)/newdemo/nbproject/%,\
			$(shell $(FIND) $(JDK_TOPDIR)/src/closed/share/demo/nbproject/ -type f))
    $(JDK_OUTPUTDIR)/newdemo/nbproject/% : $(JDK_TOPDIR)/src/closed/share/demo/nbproject/%
191 192 193
		$(MKDIR) -p $(@D)
		$(CP) $< $@
		$(CHMOD) -f ug+w $@
194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
endif

##################################################################################################

# Why do we install a demo jar into the main jre/lib/ext????????????????
$(JDK_OUTPUTDIR)/lib/ext/zipfs.jar : $(JDK_OUTPUTDIR)/newdemo/nio/zipfs/zipfs.jar
		$(MKDIR) -p $(@D)
		$(CP) $< $@

BUILD_DEMOS += $(JDK_OUTPUTDIR)/lib/ext/zipfs.jar

##################################################################################################

# In the old makefiles, j2dbench was not compiled. 
#$(eval $(call SetupDemo,J2DBench,java2d,/src,,j2dbench/J2DBench))

define SetupJVMTIDemo
     # Param 1 = Name of the demo
     # Param 2 = add these directories to the includes, default is agent_util
     # Param 3 = extra CFLAGS
     # Param 4 = C or C++ (defaults to C)
     # Param 5 = libs for posix
     # Param 6 = libs for winapi
     # Param 7 = libs for solaris
     BUILD_DEMO_JVMTI_$1_EXTRA_SRC:=	$$(wildcard $(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/demo/jvmti/$1) \
					$$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/,$2))
     BUILD_DEMO_JVMTI_$1_EXTRA_INC:=$$(addprefix -I,$$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC))
     BUILD_DEMO_JVMTI_$1_LANG:=C
     BUILD_DEMO_JVMTI_$1_O_FLAG:=$(C_O_FLAG_NORM)
     ifneq (,$4)
         BUILD_DEMO_JVMTI_$1_LANG:=$4
     endif
     ifeq (C++,$4)
         $1_EXTRA_CXX:=$(LIBCXX)
         BUILD_DEMO_JVMTI_$1_O_FLAG:=$(CXX_O_FLAG_NORM)
     endif
     $$(eval $$(call SetupNativeCompilation,BUILD_DEMO_JVMTI_$1,\
		SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC),\
		LANG:=$$(BUILD_DEMO_JVMTI_$1_LANG),\
		CFLAGS:=$(CFLAGS_JDKLIB) $$(BUILD_DEMO_JVMTI_$1_O_FLAG) -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3,\
234
		CXXFLAGS:=$(CXXFLAGS_JDKLIB) $$(BUILD_DEMO_JVMTI_$1_O_FLAG) -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3,\
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258
		LDFLAGS:=$(LDFLAGS_JDKLIB),\
		LDFLAGS_SUFFIX:=$$($1_EXTRA_CXX),\
		LDFLAGS_SUFFIX_posix:=$5,\
		LDFLAGS_SUFFIX_winapi:=$6,\
		LDFLAGS_SUFFIX_solaris:=-lc $7,\
		BIN:=$(JDK_OUTPUTDIR)/newdemoobjs/jvmti/$1,\
		LIB:=$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/lib/$(LIBRARY_PREFIX)$1$(SHARED_LIBRARY_SUFFIX)))

    $$(eval $$(call SetupZipArchive,BUILD_DEMO_JVMTI_SRC_$1,\
		SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC),\
		ZIP:=$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/src.zip))

     $(JDK_OUTPUTDIR)/newdemo/jvmti/$1/README.txt : $(JDK_TOPDIR)/src/share/demo/jvmti/$1/README.txt
		$(MKDIR) -p $$(@D)
		$(CP) $$< $$@
		$(CHMOD) -f ug+w $$@

     ifneq (,$$(wildcard $(JDK_TOPDIR)/src/share/demo/jvmti/$1/*.java))
         $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_JVMTI_$1_JAVA,\
                SETUP:=GENERATE_USINGJDKBYTECODE,\
		SRC:=$(JDK_TOPDIR)/src/share/demo/jvmti/$1,\
		BIN:=$(JDK_OUTPUTDIR)/newdemoclasses/jvmti/$1,\
		COPY:=$(PATTERNS_TO_COPY),\
		JAR:=$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/$1.jar,\
259
		EXTRA_MANIFEST_ATTR:=Main-Class: \n,\
260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293
		MANIFEST:=$(JDK_TOPDIR)/make/tools/manifest.mf))

         BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/jvmti/$1/$1.jar
     endif

     BUILD_DEMOS += 	$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/lib/$(LIBRARY_PREFIX)$1$(SHARED_LIBRARY_SUFFIX) \
			$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/src.zip \
			$(JDK_OUTPUTDIR)/newdemo/jvmti/$1/README.txt
endef

$(eval $(call SetupJVMTIDemo,compiledMethodLoad,	agent_util))
$(eval $(call SetupJVMTIDemo,gctest,			agent_util))
$(eval $(call SetupJVMTIDemo,heapTracker,		agent_util java_crw_demo))
$(eval $(call SetupJVMTIDemo,heapViewer,		agent_util))
# hprof contains error messages using __FILE__ macro. These expand to the absolute path
# in the new build system and relative in the old, causing the binaries to differ.
$(eval $(call SetupJVMTIDemo,hprof,			java_crw_demo,\
		-I$(JDK_TOPDIR)/src/share/npt -I$(JDK_TOPDIR)/src/$(LEGACY_HOST_OS_API)/npt,C,\
		-ldl,ws2_32.lib winmm.lib,-lsocket -lnsl))

$(eval $(call SetupJVMTIDemo,minst,			agent_util java_crw_demo))
$(eval $(call SetupJVMTIDemo,mtrace,			agent_util java_crw_demo))
$(eval $(call SetupJVMTIDemo,waiters,			agent_util,,C++))
$(eval $(call SetupJVMTIDemo,versionCheck,		agent_util))

##################################################################################################

# The jpda demo (com/sun/tools/example) is oddly enough stored in src/share/classes.
# At least, we do not need to compile the jpda demo, just jar/zip up the sources.
JPDA_SOURCES:=$(shell $(FIND) $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example -type f)
# The number of files are few enough so that we can use echo safely below to list them.
JPDA_FILES:=$(subst $(JDK_TOPDIR)/src/share/classes/,,$(JPDA_SOURCES))

$(JDK_OUTPUTDIR)/newdemo/jpda/src.zip : $(JPDA_SOURCES)
294
		$(MKDIR) -p $(@D)
295 296 297
		(cd $(JDK_TOPDIR)/src/share/classes && $(ZIP) -qru $@ com -i "com/sun/tools/example/*")

$(JDK_OUTPUTDIR)/newdemo/jpda/examples.jar : $(JPDA_SOURCES)
298
		$(MKDIR) -p $(@D)
299 300 301 302 303 304 305 306 307
		$(RM) $(@D)/_the.sources
		$(call ListPathsSafely,JPDA_FILES,\n, >> $(@D)/_the.sources)
		$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" 		\
		       -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" $(JDK_TOPDIR)/make/tools/manifest.mf > $(@D)/_the.manifest
		$(ECHO) "Main-Class: " >> $(@D)/_the.manifest
		(cd $(JDK_TOPDIR)/src/share/classes && $(JAR) cfm  $@ $(@D)/_the.manifest @$(@D)/_the.sources)
		(cd $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example && $(JAR) uf $@ README)

$(JDK_OUTPUTDIR)/newdemo/jpda/com/sun/tools/example/README : $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example/README
308
		$(MKDIR) -p $(@D)
309 310 311 312 313 314 315 316 317
		$(CP) $< $@
		$(CHMOD) -f ug+w $@

BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/jpda/src.zip $(JDK_OUTPUTDIR)/newdemo/jpda/examples.jar \
		$(JDK_OUTPUTDIR)/newdemo/jpda/com/sun/tools/example/README

##################################################################################################

$(JDK_OUTPUTDIR)/newdemo/management/index.html : $(JDK_TOPDIR)/src/share/demo/management/index.html
318
		$(MKDIR) -p $(@D)
319 320 321 322
		$(CP) $< $@
		$(CHMOD) -f ug+w $@

$(JDK_OUTPUTDIR)/newdemo/jvmti/index.html : $(JDK_TOPDIR)/src/share/demo/jvmti/index.html
323
		$(MKDIR) -p $(@D)
324 325 326 327 328 329 330 331 332
		$(CP) $< $@
		$(CHMOD) -f ug+w $@

BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/management/index.html \
		$(JDK_OUTPUTDIR)/newdemo/jvmti/index.html

##################################################################################################

# The netbeans project files are copied into the demo directory.
333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377
BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/share/demo/nbproject/%,\
		$(JDK_OUTPUTDIR)/newdemo/nbproject/%,\
		$(shell $(FIND) $(JDK_TOPDIR)/src/share/demo/nbproject/ -type f))

$(JDK_OUTPUTDIR)/newdemo/nbproject/% : $(JDK_TOPDIR)/src/share/demo/nbproject/%
	$(MKDIR) -p $(@D)
	$(CP) $< $@
	$(CHMOD) -f ug+w $@

##################################################################################################

$(JDK_OUTPUTDIR)/newdemo/README: $(JDK_TOPDIR)/src/share/demo/README
	$(MKDIR) -p $(@D)
	$(CP) $< $@

BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/README

##################################################################################################

ifeq ($(PLATFORM), solaris)

$(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller/% : $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/%
		$(MKDIR) -p $(@D)
		$(CP) $< $@
		$(CHMOD) -f ug+w $@

$(JDK_OUTPUTDIR)/newdemo/jni/Poller/README.txt : $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/README.txt
		$(MKDIR) -p $(@D)
		$(CP) $< $@
		$(CHMOD) -f ug+w $@

$(JDK_OUTPUTDIR)/newdemo/jni/Poller/Poller.jar : \
  $(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller/README.txt $(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller/Poller.c

$(eval $(call SetupJavaCompilation,BUILD_DEMO_POLLER_JAR,\
		SETUP:=GENERATE_USINGJDKBYTECODE, \
		SRC:=$(JDK_TOPDIR)/src/solaris/demo/jni/Poller, \
		BIN:=$(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller, \
		HEADERS:=$(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller, \
		JAR:=$(JDK_OUTPUTDIR)/newdemo/jni/Poller/Poller.jar, \
		MANIFEST:=$(JDK_TOPDIR)/make/tools/manifest.mf, \
		SRCZIP:=$(JDK_OUTPUTDIR)/newdemo/jni/Poller/src.zip, \
		COPY := README.txt Poller.c, \
		JARMAIN := Client))

378 379


380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404
BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/jni/Poller/Poller.jar $(JDK_OUTPUTDIR)/newdemo/jni/Poller/src.zip \
               $(JDK_OUTPUTDIR)/newdemo/jni/Poller/README.txt

$(eval $(call SetupNativeCompilation,BUILD_LIBPOLLER,\
		SRC:=$(JDK_TOPDIR)/src/solaris/demo/jni/Poller, \
		LANG := C, \
		CFLAGS:=$(CFLAGS_JDKLIB) $(C_O_FLAG_NORM) $(SHARED_LIBRARY_FLAGS) \
                        -I$(JDK_OUTPUTDIR)/newdemoclasses/jni/Poller, \
		LDFLAGS:=$(LDFLAGS_JDKLIB), \
		BIN:=$(JDK_OUTPUTDIR)/newdemoobjs/jni/Poller,\
		LIB:=$(JDK_OUTPUTDIR)/newdemoobjs/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)))

#
# We can only compile native code after jar has been build (since we depend on generated .h files)
#
$(JDK_OUTPUTDIR)/newdemoobjs/jni/Poller/Poller.o : $(JDK_OUTPUTDIR)/newdemo/jni/Poller/Poller.jar

$(JDK_OUTPUTDIR)/newdemo/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX) : \
  $(JDK_OUTPUTDIR)/newdemoobjs/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)
	$(MKDIR) -p $(@D)
	$(CP) $< $@

BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/jni/Poller/lib/$(LIBRARY_PREFIX)Poller$(SHARED_LIBRARY_SUFFIX)

endif
405 406 407

##################################################################################################

408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425
ifndef OPENJDK
    DB_DEMO_ZIPFILE := $(shell $(FIND) $(JDK_TOPDIR)/src/closed/share/db -name "*demo*.zip")

    $(JDK_OUTPUTDIR)/newdemo/_the.db.unzipped: $(DB_DEMO_ZIPFILE)
	$(MKDIR) -p $(@D)
	$(RM) -rf $(JDK_OUTPUTDIR)/newdemo/db $(JDK_OUTPUTDIR)/newdemo/demo
	$(CD) $(JDK_OUTPUTDIR)/newdemo && $(UNZIP) -o $<
	$(MV) $(JDK_OUTPUTDIR)/newdemo/demo $(JDK_OUTPUTDIR)/newdemo/db
	$(TOUCH) $@

#    Copy this after the unzip above to avoid race with directory creation and mv command.
     $(JDK_OUTPUTDIR)/newdemo/db/README-JDK-DEMOS.html: \
		$(JDK_TOPDIR)/src/closed/share/db/README-JDK-DEMOS.html \
		| $(JDK_OUTPUTDIR)/newdemo/_the.db.unzipped
	$(MKDIR) -p $(@D)
	$(CP) '$<' '$@'
     BUILD_DEMOS += $(JDK_OUTPUTDIR)/newdemo/_the.db.unzipped $(JDK_OUTPUTDIR)/newdemo/db/README-JDK-DEMOS.html
endif
426 427 428

##################################################################################################

429
all: $(BUILD_DEMOS)
430 431

.PHONY: all