jdk/make/CompileDemos.gmk
changeset 25866 82d7101d5cab
parent 25859 3317bb8137f4
child 26191 a0ff4b39d34b
equal deleted inserted replaced
25865:d38d876f1654 25866:82d7101d5cab
    29 include MakeBase.gmk
    29 include MakeBase.gmk
    30 include JavaCompilation.gmk
    30 include JavaCompilation.gmk
    31 include NativeCompilation.gmk
    31 include NativeCompilation.gmk
    32 
    32 
    33 # Setup the java compilers for the JDK build.
    33 # Setup the java compilers for the JDK build.
    34 include Setup.gmk
    34 include SetupJava.gmk
    35 
    35 
    36 # Prepare the find cache. Only used if running on windows.
    36 # Prepare the find cache.
    37 $(eval $(call FillCacheFind, $(JDK_TOPDIR)/src))
    37 $(eval $(call FillCacheFind, $(JDK_TOPDIR)/src))
    38 
    38 
    39 # Append demo goals to this variable.
    39 # Append demo goals to this variable.
    40 BUILD_DEMOS =
    40 BUILD_DEMOS =
    41 
    41 
    42 # The demo structure and contents should really be cleaned up.
    42 # The demo structure and contents should really be cleaned up.
    43 # Now every other demo has its own quirks where to put the
    43 # Now every other demo has its own quirks where to put the
    44 # READMEs and other files.
    44 # READMEs and other files.
    45 
    45 
       
    46 DEMO_SHARE_SRC := $(JDK_TOPDIR)/src/demo/share
       
    47 DEMO_CLOSED_SHARE_SRC := $(JDK_TOPDIR)/src/closed/demo/share
       
    48 DEMO_SOLARIS_SRC := $(JDK_TOPDIR)/src/demo/solaris
       
    49 DEMO_OS_API_SRC := $(JDK_TOPDIR)/src/demo/$(OPENJDK_TARGET_OS_API_DIR)
       
    50 VERSION_INFO_RESOURCE := $(JDK_TOPDIR)/src/java.base/windows/native/common/version.rc
       
    51 
    46 ##################################################################################################
    52 ##################################################################################################
    47 
    53 
    48 define SetupAppletDemo
    54 define SetupAppletDemo
    49   $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_APPLET_$1, \
    55   $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_APPLET_$1, \
    50       SETUP := GENERATE_USINGJDKBYTECODE, \
    56       SETUP := GENERATE_USINGJDKBYTECODE, \
    51       SRC := $(JDK_TOPDIR)/src/$3share/demo/applets/$1, \
    57       SRC := $(JDK_TOPDIR)/src/$3demo/share/applets/$1, \
    52       BIN := $(JDK_OUTPUTDIR)/demo/applets/$1, \
    58       BIN := $(JDK_OUTPUTDIR)/demo/applets/$1, \
    53       COPY := .html .java .xyz .obj .au .gif, \
    59       COPY := .html .java .xyz .obj .au .gif, \
    54       DISABLE_SJAVAC := $2))
    60       DISABLE_SJAVAC := $2))
    55       BUILD_DEMOS += $$(BUILD_DEMO_APPLET_$1)
    61       BUILD_DEMOS += $$(BUILD_DEMO_APPLET_$1)
    56 endef
    62 endef
    94   # Param 9 = Exclude list
   100   # Param 9 = Exclude list
    95   # Param 10 = Extra copy patterns
   101   # Param 10 = Extra copy patterns
    96   # Param 11 = Extra manifest attribute
   102   # Param 11 = Extra manifest attribute
    97   # Param 12 = Suffix for compiler setup name
   103   # Param 12 = Suffix for compiler setup name
    98 
   104 
       
   105   $1_SRC_BASE := $(JDK_TOPDIR)/src/$6demo/share/$2/$1
    99   # In some demos the source is found in a subdir called src.
   106   # In some demos the source is found in a subdir called src.
   100   $1_MAIN_SRC := $$(wildcard $(JDK_TOPDIR)/src/$6share/demo/$2/$1/src)
   107   $1_MAIN_SRC := $$(wildcard $$($1_SRC_BASE)/src)
   101   ifeq ($$($1_MAIN_SRC), )
   108   ifeq ($$($1_MAIN_SRC), )
   102     $1_MAIN_SRC := $(JDK_TOPDIR)/src/$6share/demo/$2/$1
   109     $1_MAIN_SRC := $$($1_SRC_BASE)
   103   endif
   110   endif
   104 
   111 
   105   ifneq ($8, )
   112   ifneq ($8, )
   106     $1_JARFILE := $8.jar
   113     $1_JARFILE := $8.jar
   107   else
   114   else
   127         $(JDK_OUTPUTDIR)/demo/$2/$1/$$($1_JARFILE) \
   134         $(JDK_OUTPUTDIR)/demo/$2/$1/$$($1_JARFILE) \
   128         $(JDK_OUTPUTDIR)/demo/$2/$1/src.zip
   135         $(JDK_OUTPUTDIR)/demo/$2/$1/src.zip
   129   endif
   136   endif
   130 
   137 
   131   # Copy files.
   138   # Copy files.
   132   $1_COPY_TARGETS := $$(patsubst $(JDK_TOPDIR)/src/$6share/demo/$2/$1/%, \
   139   $1_COPY_TARGETS := $$(patsubst $$($1_SRC_BASE)/%, \
   133       $(JDK_OUTPUTDIR)/demo/$2/$1/%, \
   140       $(JDK_OUTPUTDIR)/demo/$2/$1/%, \
   134       $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/$6share/demo/$2/$1/, $7)))
   141       $$(wildcard $$(addprefix $$($1_SRC_BASE)/, $7)))
   135   ifneq ($7, )
   142   ifneq ($7, )
   136     $(JDK_OUTPUTDIR)/demo/$2/$1/%: $(JDK_TOPDIR)/src/$6share/demo/$2/$1/%
   143     $(JDK_OUTPUTDIR)/demo/$2/$1/%: $$($1_SRC_BASE)/%
   137 	$$(call install-file)
   144 	$$(call install-file)
   138 	$(CHMOD) -f ug+w $$@
   145 	$(CHMOD) -f ug+w $$@
   139 
   146 
   140     BUILD_DEMOS += $$($1_COPY_TARGETS)
   147     BUILD_DEMOS += $$($1_COPY_TARGETS)
   141   endif
   148   endif
   143 endef
   150 endef
   144 
   151 
   145 $(eval $(call SetupDemo,CodePointIM,jfc,,CodePointIM,,,*.html))
   152 $(eval $(call SetupDemo,CodePointIM,jfc,,CodePointIM,,,*.html))
   146 $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.services: \
   153 $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.services: \
   147     $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar \
   154     $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar \
   148     $(JDK_TOPDIR)/src/share/demo/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor
   155     $(DEMO_SHARE_SRC)/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor
   149 	(cd $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM && \
   156 	(cd $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM && \
   150 	$(MKDIR) -p _the.tmp/META-INF/services && \
   157 	$(MKDIR) -p _the.tmp/META-INF/services && \
   151 	$(CP) $(JDK_TOPDIR)/src/share/demo/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor _the.tmp/META-INF/services && \
   158 	$(CP) $(DEMO_SHARE_SRC)/jfc/CodePointIM/java.awt.im.spi.InputMethodDescriptor _the.tmp/META-INF/services && \
   152 	cd _the.tmp && \
   159 	cd _the.tmp && \
   153 	$(JAR) uf $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar META-INF/services/java.awt.im.spi.InputMethodDescriptor && \
   160 	$(JAR) uf $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar META-INF/services/java.awt.im.spi.InputMethodDescriptor && \
   154 	cd META-INF/services && \
   161 	cd META-INF/services && \
   155 	$(JAR) uf $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar java.awt.im.spi.InputMethodDescriptor)
   162 	$(JAR) uf $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/CodePointIM.jar java.awt.im.spi.InputMethodDescriptor)
   156 	$(RM) -r $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.tmp
   163 	$(RM) -r $(JDK_OUTPUTDIR)/demo/jfc/CodePointIM/_the.tmp
   180   $(eval $(call SetupDemo,Laffy,jfc,,,,closed/,*))
   187   $(eval $(call SetupDemo,Laffy,jfc,,,,closed/,*))
   181   $(eval $(call SetupDemo,SwingSet3,jfc,,,,closed/,*))
   188   $(eval $(call SetupDemo,SwingSet3,jfc,,,,closed/,*))
   182 
   189 
   183   $(eval $(call SetupDemo,Java2D,jfc,,java2d.Java2Demo,,closed/,*.html README*,Java2Demo))
   190   $(eval $(call SetupDemo,Java2D,jfc,,java2d.Java2Demo,,closed/,*.html README*,Java2Demo))
   184   $(eval $(call SetupDemo,Stylepad,jfc,,Stylepad, \
   191   $(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))
   192   $(DEMO_SHARE_SRC)/jfc/Notepad,closed/,*.txt,,$(DEMO_SHARE_SRC)/jfc/Notepad/README.txt))
   186   $(eval $(call SetupDemo,SwingSet2,jfc,,SwingSet2,,closed/,README* *.html,,,.java COPYRIGHT, \
   193   $(eval $(call SetupDemo,SwingSet2,jfc,,SwingSet2,,closed/,README* *.html,,,.java COPYRIGHT, \
   187       SplashScreen-Image: resources/images/splash.png,true))
   194       SplashScreen-Image: resources/images/splash.png,true))
   188 
   195 
   189   BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/closed/share/demo/nbproject/%, \
   196   BUILD_DEMOS += $(patsubst $(DEMO_CLOSED_SHARE_SRC)/nbproject/%, \
   190       $(JDK_OUTPUTDIR)/demo/nbproject/%, \
   197       $(JDK_OUTPUTDIR)/demo/nbproject/%, \
   191       $(call CacheFind, $(JDK_TOPDIR)/src/closed/share/demo/nbproject))
   198       $(call CacheFind, $(DEMO_CLOSED_SHARE_SRC)/nbproject))
   192 
   199 
   193   $(JDK_OUTPUTDIR)/demo/nbproject/%: $(JDK_TOPDIR)/src/closed/share/demo/nbproject/%
   200   $(JDK_OUTPUTDIR)/demo/nbproject/%: $(DEMO_CLOSED_SHARE_SRC)/nbproject/%
   194 	$(call install-file)
   201 	$(call install-file)
   195 	$(CHMOD) -f ug+w $@
   202 	$(CHMOD) -f ug+w $@
   196 endif
   203 endif
   197 
   204 
   198 ##################################################################################################
   205 ##################################################################################################
   213   # Param 6 = libs for windows
   220   # Param 6 = libs for windows
   214   # Param 7 = libs for solaris
   221   # Param 7 = libs for solaris
   215   # Param 8 = libs for linux
   222   # Param 8 = libs for linux
   216   # Param 9 = extra directories with required sources
   223   # Param 9 = extra directories with required sources
   217   BUILD_DEMO_JVMTI_$1_EXTRA_SRC := \
   224   BUILD_DEMO_JVMTI_$1_EXTRA_SRC := \
   218       $$(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/demo/jvmti/$1) \
   225       $$(wildcard $(DEMO_OS_API_SRC)/jvmti/$1) \
   219       $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/, $2)) \
   226       $$(wildcard $$(addprefix $(DEMO_SHARE_SRC)/jvmti/, $2)) \
   220       $9
   227       $9
   221   BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE := \
   228   BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE := \
   222       $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/, $2)/README.txt) \
   229       $$(wildcard $$(patsubst %, $(DEMO_SHARE_SRC)/jvmti/%/README.txt, $2)) \
   223       $$(wildcard $$(addprefix $(JDK_TOPDIR)/src/share/demo/jvmti/, $2)/sample.makefile.txt)
   230       $$(wildcard $$(patsubst %, $(DEMO_SHARE_SRC)/jvmti/%/sample.makefile.txt, $2))
   224   BUILD_DEMO_JVMTI_$1_EXTRA_INC := $$(addprefix -I, $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC))
   231   BUILD_DEMO_JVMTI_$1_EXTRA_INC := $$(addprefix -I, $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC))
   225   BUILD_DEMO_JVMTI_$1_LANG := C
   232   BUILD_DEMO_JVMTI_$1_LANG := C
   226   ifneq (, $4)
   233   ifneq (, $4)
   227     BUILD_DEMO_JVMTI_$1_LANG := $4
   234     BUILD_DEMO_JVMTI_$1_LANG := $4
   228   endif
   235   endif
   229   ifeq (C++, $4)
   236   ifeq (C++, $4)
   230     $1_EXTRA_CXX := $(LDFLAGS_CXX_JDK) $(LIBCXX)
   237     $1_EXTRA_CXX := $(LDFLAGS_CXX_JDK) $(LIBCXX)
   231   endif
   238   endif
   232 
   239 
   233   $1_CXXFLAGS := $(CXXFLAGS_JDKLIB) -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 \
   240   $1_CXXFLAGS := $(CXXFLAGS_JDKLIB) -I$(DEMO_SHARE_SRC)/jvmti/$1 \
   234       $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3 \
   241       $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3 \
   235       $(CXXFLAGS_DEBUG_SYMBOLS)
   242       $(CXXFLAGS_DEBUG_SYMBOLS)
   236   ifeq ($1-$(OPENJDK_TARGET_CPU_ARCH), waiters-sparc)
   243   ifeq ($1-$(OPENJDK_TARGET_CPU_ARCH), waiters-sparc)
   237     $1_FILTER := -xregs=no%appl
   244     $1_FILTER := -xregs=no%appl
   238     $1_CXXFLAGS := $$(filter-out $$($1_FILTER), $$($1_CXXFLAGS))
   245     $1_CXXFLAGS := $$(filter-out $$($1_FILTER), $$($1_CXXFLAGS))
   239   endif
   246   endif
   240 
   247 
   241   # Workaround for CFLAGS_JDKLIB containing ',' on solaris. If this is added as 'CFLAGS' to the
   248   # Workaround for CFLAGS_JDKLIB containing ',' on solaris. If this is added as 'CFLAGS' to the
   242   # eval call below, the comma gets expanded too early.
   249   # eval call below, the comma gets expanded too early.
   243   BUILD_DEMO_JVMTI_$1_CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_DEBUG_SYMBOLS) \
   250   BUILD_DEMO_JVMTI_$1_CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_DEBUG_SYMBOLS) \
   244       -I$(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3
   251       -I$(DEMO_SHARE_SRC)/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_INC) $3
   245 
   252 
   246   # Remove the -incremental:no setting to get .ilk-files like in the old build.
   253   # Remove the -incremental:no setting to get .ilk-files like in the old build.
   247   $$(eval $$(call SetupNativeCompilation,BUILD_DEMO_JVMTI_$1, \
   254   $$(eval $$(call SetupNativeCompilation,BUILD_DEMO_JVMTI_$1, \
   248       SRC := $(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC), \
   255       SRC := $(DEMO_SHARE_SRC)/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC), \
   249       LANG := $$(BUILD_DEMO_JVMTI_$1_LANG), \
   256       LANG := $$(BUILD_DEMO_JVMTI_$1_LANG), \
   250       OPTIMIZATION := LOW, \
   257       OPTIMIZATION := LOW, \
   251       CXXFLAGS := $$($1_CXXFLAGS), \
   258       CXXFLAGS := $$($1_CXXFLAGS), \
   252       LDFLAGS := $(filter-out -incremental:no -opt:ref, $(LDFLAGS_JDKLIB)), \
   259       LDFLAGS := $(filter-out -incremental:no -opt:ref, $(LDFLAGS_JDKLIB)), \
   253       LDFLAGS_macosx := $(call SET_EXECUTABLE_ORIGIN), \
   260       LDFLAGS_macosx := $(call SET_EXECUTABLE_ORIGIN), \
   254       LDFLAGS_SUFFIX := $$($1_EXTRA_CXX), \
   261       LDFLAGS_SUFFIX := $$($1_EXTRA_CXX), \
   255       LDFLAGS_SUFFIX_posix := $5, \
   262       LDFLAGS_SUFFIX_posix := $5, \
   256       LDFLAGS_SUFFIX_windows := $6, \
   263       LDFLAGS_SUFFIX_windows := $6, \
   257       LDFLAGS_SUFFIX_solaris := $7 -lc, \
   264       LDFLAGS_SUFFIX_solaris := $7 -lc, \
   258       LDFLAGS_SUFFIX_linux := $8, \
   265       LDFLAGS_SUFFIX_linux := $8, \
   259       VERSIONINFO_RESOURCE := $(JDK_TOPDIR)/src/windows/resource/version.rc, \
   266       VERSIONINFO_RESOURCE := $(VERSION_INFO_RESOURCE), \
   260       RC_FLAGS := $$(RC_FLAGS) \
   267       RC_FLAGS := $$(RC_FLAGS) \
   261           -D "JDK_FNAME=$1.dll" \
   268           -D "JDK_FNAME=$1.dll" \
   262           -D "JDK_INTERNAL_NAME=$1" \
   269           -D "JDK_INTERNAL_NAME=$1" \
   263           -D "JDK_FTYPE=0x2L", \
   270           -D "JDK_FTYPE=0x2L", \
   264       OBJECT_DIR := $(JDK_OUTPUTDIR)/demoobjs/jvmti/$1, \
   271       OBJECT_DIR := $(JDK_OUTPUTDIR)/demoobjs/jvmti/$1, \
   265       OUTPUT_DIR := $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib, \
   272       OUTPUT_DIR := $(JDK_OUTPUTDIR)/demo/jvmti/$1/lib, \
   266       LIBRARY := $1))
   273       LIBRARY := $1))
   267 
   274 
   268   $$(eval $$(call SetupZipArchive,BUILD_DEMO_JVMTI_SRC_$1, \
   275   $$(eval $$(call SetupZipArchive,BUILD_DEMO_JVMTI_SRC_$1, \
   269       SRC := $(JDK_TOPDIR)/src/share/demo/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC), \
   276       SRC := $(DEMO_SHARE_SRC)/jvmti/$1 $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC), \
   270       EXCLUDE_FILES := $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE), \
   277       EXCLUDE_FILES := $$(BUILD_DEMO_JVMTI_$1_EXTRA_SRC_EXCLUDE), \
   271       ZIP := $(JDK_OUTPUTDIR)/demo/jvmti/$1/src.zip))
   278       ZIP := $(JDK_OUTPUTDIR)/demo/jvmti/$1/src.zip))
   272 
   279 
   273   $(JDK_OUTPUTDIR)/demo/jvmti/$1/README.txt: $(JDK_TOPDIR)/src/share/demo/jvmti/$1/README.txt
   280   $(JDK_OUTPUTDIR)/demo/jvmti/$1/README.txt: $(DEMO_SHARE_SRC)/jvmti/$1/README.txt
   274 	$$(call install-file)
   281 	$$(call install-file)
   275 	$(CHMOD) -f ug+w $$@
   282 	$(CHMOD) -f ug+w $$@
   276 
   283 
   277   ifneq (, $$(wildcard $(JDK_TOPDIR)/src/share/demo/jvmti/$1/*.java))
   284   ifneq (, $$(wildcard $(DEMO_SHARE_SRC)/jvmti/$1/*.java))
   278     $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_JVMTI_$1_JAVA, \
   285     $$(eval $$(call SetupJavaCompilation,BUILD_DEMO_JVMTI_$1_JAVA, \
   279         SETUP := GENERATE_USINGJDKBYTECODE, \
   286         SETUP := GENERATE_USINGJDKBYTECODE, \
   280         SRC := $(JDK_TOPDIR)/src/share/demo/jvmti/$1, \
   287         SRC := $(DEMO_SHARE_SRC)/jvmti/$1, \
   281         BIN := $(JDK_OUTPUTDIR)/democlasses/jvmti/$1, \
   288         BIN := $(JDK_OUTPUTDIR)/democlasses/jvmti/$1, \
   282         COPY := $(PATTERNS_TO_COPY), \
   289         COPY := $(PATTERNS_TO_COPY), \
   283         JAR := $(JDK_OUTPUTDIR)/demo/jvmti/$1/$1.jar, \
   290         JAR := $(JDK_OUTPUTDIR)/demo/jvmti/$1/$1.jar, \
   284         EXTRA_MANIFEST_ATTR := Main-Class: \n, \
   291         EXTRA_MANIFEST_ATTR := Main-Class: \n, \
   285         MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf))
   292         MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf))
   327 $(eval $(call SetupJVMTIDemo,waiters, agent_util, , C++))
   334 $(eval $(call SetupJVMTIDemo,waiters, agent_util, , C++))
   328 $(eval $(call SetupJVMTIDemo,versionCheck, agent_util))
   335 $(eval $(call SetupJVMTIDemo,versionCheck, agent_util))
   329 
   336 
   330 ##################################################################################################
   337 ##################################################################################################
   331 
   338 
   332 # The jpda demo (com/sun/tools/example) is oddly enough stored in src/share/classes.
   339 $(JDK_OUTPUTDIR)/demo/jpda/com/sun/tools/example/README: \
   333 # At least, we do not need to compile the jpda demo, just jar/zip up the sources.
   340     $(JDK_TOPDIR)/src/demo/share/jpda/com/sun/tools/example/README
   334 JPDA_SOURCES := $(call CacheFind, $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example)
   341 	$(call install-file)
   335 # The number of files are few enough so that we can use echo safely below to list them.
   342 	$(CHMOD) -f ug+w $@
   336 JPDA_FILES := $(subst $(JDK_TOPDIR)/src/share/classes/,,$(JPDA_SOURCES))
   343 
   337 
   344 $(eval $(call SetupArchive,JPDA_JAR, \
   338 $(JDK_OUTPUTDIR)/demo/jpda/src.zip: $(JPDA_SOURCES)
   345     $(JDK_OUTPUTDIR)/demo/jpda/com/sun/tools/example/README, \
   339 	$(MKDIR) -p $(@D)
   346     SRCS := $(JDK_TOPDIR)/src/demo/share/jpda \
   340 	(cd $(JDK_TOPDIR)/src/share/classes && $(ZIP) -qru $@ com -i "com/sun/tools/example/*")
   347         $(JDK_TOPDIR)/src/jdk.jdi/share/classes \
   341 
   348         $(JDK_OUTPUTDIR)/demo/jpda/com/sun/tools/example, \
   342 $(JDK_OUTPUTDIR)/demo/jpda/examples.jar: $(JPDA_SOURCES)
   349     INCLUDES := com/sun/tools/example README, \
   343 	$(MKDIR) -p $(@D)
   350     SUFFIXES := .java .html .jj README, \
   344 	$(RM) $(@D)/_the.sources
   351     JAR := $(JDK_OUTPUTDIR)/demo/jpda/examples.jar, \
   345 	$(call ListPathsSafely,JPDA_FILES,\n, >> $(@D)/_the.sources)
   352     MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
   346 	$(SED) -e "s#@@RELEASE@@#$(RELEASE)#" \
   353     EXTRA_MANIFEST_ATTR := Main-Class:$$(SPACE), \
   347 	    -e "s#@@COMPANY_NAME@@#$(COMPANY_NAME)#" $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf > $(@D)/_the.manifest
   354     SKIP_METAINF := true))
   348 	$(ECHO) "Main-Class: " >> $(@D)/_the.manifest
   355 
   349 	(cd $(JDK_TOPDIR)/src/share/classes && $(JAR) cfm $@ $(@D)/_the.manifest @$(@D)/_the.sources)
   356 $(eval $(call SetupZipArchive,JPDA_ZIP, \
   350 	(cd $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example && $(JAR) uf $@ README)
   357     SRC := $(JDK_TOPDIR)/src/demo/share/jpda \
   351 
   358         $(JDK_TOPDIR)/src/jdk.jdi/share/classes, \
   352 $(JDK_OUTPUTDIR)/demo/jpda/com/sun/tools/example/README: $(JDK_TOPDIR)/src/share/classes/com/sun/tools/example/README
   359     INCLUDES := com/sun/tools/example, \
   353 	$(call install-file)
   360     SUFFIXES := .java .html .jj README, \
   354 	$(CHMOD) -f ug+w $@
   361     ZIP := $(JDK_OUTPUTDIR)/demo/jpda/src.zip))
   355 
   362 
   356 BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jpda/src.zip $(JDK_OUTPUTDIR)/demo/jpda/examples.jar \
   363 BUILD_DEMOS += $(JPDA_JAR) $(JPDA_ZIP)
   357     $(JDK_OUTPUTDIR)/demo/jpda/com/sun/tools/example/README
   364 
   358 
   365 ##################################################################################################
   359 ##################################################################################################
   366 
   360 
   367 $(JDK_OUTPUTDIR)/demo/management/index.html: $(DEMO_SHARE_SRC)/management/index.html
   361 $(JDK_OUTPUTDIR)/demo/management/index.html: $(JDK_TOPDIR)/src/share/demo/management/index.html
   368 	$(call install-file)
   362 	$(call install-file)
   369 	$(CHMOD) -f ug+w $@
   363 	$(CHMOD) -f ug+w $@
   370 
   364 
   371 $(JDK_OUTPUTDIR)/demo/jvmti/index.html: $(DEMO_SHARE_SRC)/jvmti/index.html
   365 $(JDK_OUTPUTDIR)/demo/jvmti/index.html: $(JDK_TOPDIR)/src/share/demo/jvmti/index.html
       
   366 	$(call install-file)
   372 	$(call install-file)
   367 	$(CHMOD) -f ug+w $@
   373 	$(CHMOD) -f ug+w $@
   368 
   374 
   369 BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/management/index.html \
   375 BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/management/index.html \
   370     $(JDK_OUTPUTDIR)/demo/jvmti/index.html
   376     $(JDK_OUTPUTDIR)/demo/jvmti/index.html
   371 
   377 
   372 ##################################################################################################
   378 ##################################################################################################
   373 
   379 
   374 # The netbeans project files are copied into the demo directory.
   380 # The netbeans project files are copied into the demo directory.
   375 ifeq ($(OPENJDK_TARGET_OS), solaris)
   381 ifeq ($(OPENJDK_TARGET_OS), solaris)
   376   BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/share/demo/nbproject/%, \
   382   BUILD_DEMOS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
   377     $(JDK_OUTPUTDIR)/demo/nbproject/%, \
   383     $(JDK_OUTPUTDIR)/demo/nbproject/%, \
   378     $(filter-out $(JDK_TOPDIR)/src/share/demo/nbproject/jfc/SwingApplet%, \
   384     $(filter-out $(DEMO_SHARE_SRC)/nbproject/jfc/SwingApplet%, \
   379     $(call CacheFind, $(JDK_TOPDIR)/src/share/demo/nbproject)))
   385     $(call CacheFind, $(DEMO_SHARE_SRC)/nbproject)))
   380 else
   386 else
   381   BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/share/demo/nbproject/%, \
   387   BUILD_DEMOS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
   382     $(JDK_OUTPUTDIR)/demo/nbproject/%, \
   388     $(JDK_OUTPUTDIR)/demo/nbproject/%, \
   383     $(call CacheFind, $(JDK_TOPDIR)/src/share/demo/nbproject))
   389     $(call CacheFind, $(DEMO_SHARE_SRC)/nbproject))
   384 endif
   390 endif
   385 
   391 
   386 $(JDK_OUTPUTDIR)/demo/nbproject/%: $(JDK_TOPDIR)/src/share/demo/nbproject/%
   392 $(JDK_OUTPUTDIR)/demo/nbproject/%: $(DEMO_SHARE_SRC)/nbproject/%
   387 	$(call install-file)
   393 	$(call install-file)
   388 	$(CHMOD) -f ug+w $@
   394 	$(CHMOD) -f ug+w $@
   389 
   395 
   390 ##################################################################################################
   396 ##################################################################################################
   391 
   397 
   392 $(JDK_OUTPUTDIR)/demo/README: $(JDK_TOPDIR)/src/share/demo/README
   398 $(JDK_OUTPUTDIR)/demo/README: $(DEMO_SHARE_SRC)/README
   393 	$(call install-file)
   399 	$(call install-file)
   394 
   400 
   395 BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/README
   401 BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/README
   396 
   402 
   397 ##################################################################################################
   403 ##################################################################################################
   398 
   404 
   399 ifeq ($(OPENJDK_TARGET_OS), solaris)
   405 ifeq ($(OPENJDK_TARGET_OS), solaris)
   400 
   406 
   401   $(JDK_OUTPUTDIR)/democlasses/jni/Poller/%: $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/%
   407   $(JDK_OUTPUTDIR)/democlasses/jni/Poller/%: $(DEMO_SOLARIS_SRC)/jni/Poller/%
   402 	$(call install-file)
   408 	$(call install-file)
   403 	$(CHMOD) -f ug+w $@
   409 	$(CHMOD) -f ug+w $@
   404 
   410 
   405   $(JDK_OUTPUTDIR)/demo/jni/Poller/README.txt: $(JDK_TOPDIR)/src/solaris/demo/jni/Poller/README.txt
   411   $(JDK_OUTPUTDIR)/demo/jni/Poller/README.txt: $(DEMO_SOLARIS_SRC)/jni/Poller/README.txt
   406 	$(call install-file)
   412 	$(call install-file)
   407 	$(CHMOD) -f ug+w $@
   413 	$(CHMOD) -f ug+w $@
   408 
   414 
   409   $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar: \
   415   $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar: \
   410       $(JDK_OUTPUTDIR)/democlasses/jni/Poller/README.txt $(JDK_OUTPUTDIR)/democlasses/jni/Poller/Poller.c
   416       $(JDK_OUTPUTDIR)/democlasses/jni/Poller/README.txt $(JDK_OUTPUTDIR)/democlasses/jni/Poller/Poller.c
   411 
   417 
   412   $(eval $(call SetupJavaCompilation,BUILD_DEMO_POLLER_JAR, \
   418   $(eval $(call SetupJavaCompilation,BUILD_DEMO_POLLER_JAR, \
   413       SETUP := GENERATE_USINGJDKBYTECODE, \
   419       SETUP := GENERATE_USINGJDKBYTECODE, \
   414       SRC := $(JDK_TOPDIR)/src/solaris/demo/jni/Poller, \
   420       SRC := $(DEMO_SOLARIS_SRC)/jni/Poller, \
   415       BIN := $(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
   421       BIN := $(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
   416       HEADERS := $(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
   422       HEADERS := $(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
   417       JAR := $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar, \
   423       JAR := $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar, \
   418       MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
   424       MANIFEST := $(JDK_TOPDIR)/make/data/mainmanifest/manifest.mf, \
   419       SRCZIP := $(JDK_OUTPUTDIR)/demo/jni/Poller/src.zip, \
   425       SRCZIP := $(JDK_OUTPUTDIR)/demo/jni/Poller/src.zip, \
   424 
   430 
   425   BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar $(JDK_OUTPUTDIR)/demo/jni/Poller/src.zip \
   431   BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/jni/Poller/Poller.jar $(JDK_OUTPUTDIR)/demo/jni/Poller/src.zip \
   426       $(JDK_OUTPUTDIR)/demo/jni/Poller/README.txt
   432       $(JDK_OUTPUTDIR)/demo/jni/Poller/README.txt
   427 
   433 
   428   $(eval $(call SetupNativeCompilation,BUILD_LIBPOLLER, \
   434   $(eval $(call SetupNativeCompilation,BUILD_LIBPOLLER, \
   429       SRC := $(JDK_TOPDIR)/src/solaris/demo/jni/Poller, \
   435       SRC := $(DEMO_SOLARIS_SRC)/jni/Poller, \
   430       LANG := C, \
   436       LANG := C, \
   431       OPTIMIZATION := LOW, \
   437       OPTIMIZATION := LOW, \
   432       CFLAGS := $(CFLAGS_JDKLIB) $(SHARED_LIBRARY_FLAGS) \
   438       CFLAGS := $(CFLAGS_JDKLIB) $(SHARED_LIBRARY_FLAGS) \
   433           -I$(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
   439           -I$(JDK_OUTPUTDIR)/democlasses/jni/Poller, \
   434       LDFLAGS := $(LDFLAGS_JDKLIB), \
   440       LDFLAGS := $(LDFLAGS_JDKLIB), \
   451 endif
   457 endif
   452 
   458 
   453 ##################################################################################################
   459 ##################################################################################################
   454 
   460 
   455 ifndef OPENJDK
   461 ifndef OPENJDK
   456   DB_DEMO_ZIPFILE := $(wildcard $(JDK_TOPDIR)/src/closed/share/db/*.zip)
   462   DB_ZIP_DIR := $(wildcard $(JDK_TOPDIR)/src/closed/db)
       
   463   DB_DEMO_ZIPFILE := $(wildcard $(DB_ZIP_DIR)/*.zip)
   457 
   464 
   458   $(JDK_OUTPUTDIR)/demo/_the.db.unzipped: $(DB_DEMO_ZIPFILE)
   465   $(JDK_OUTPUTDIR)/demo/_the.db.unzipped: $(DB_DEMO_ZIPFILE)
   459 	$(MKDIR) -p $(@D)
   466 	$(MKDIR) -p $(@D)
   460 	$(RM) -r $(JDK_OUTPUTDIR)/demo/db $(JDK_OUTPUTDIR)/demo/demo
   467 	$(RM) -r $(JDK_OUTPUTDIR)/demo/db $(JDK_OUTPUTDIR)/demo/demo
   461 	$(CD) $(JDK_OUTPUTDIR)/demo && $(UNZIP) -q -o $<
   468 	$(CD) $(JDK_OUTPUTDIR)/demo && $(UNZIP) -q -o $<
   463 	$(CD) $(JDK_OUTPUTDIR)/demo && $(RM) -r db-derby-*-bin
   470 	$(CD) $(JDK_OUTPUTDIR)/demo && $(RM) -r db-derby-*-bin
   464 	$(TOUCH) $@
   471 	$(TOUCH) $@
   465 
   472 
   466   # Copy this after the unzip above to avoid race with directory creation and mv command.
   473   # Copy this after the unzip above to avoid race with directory creation and mv command.
   467   $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html: \
   474   $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html: \
   468       $(JDK_TOPDIR)/src/closed/share/db/README-JDK-DEMOS.html \
   475       $(DB_ZIP_DIR)/README-JDK-DEMOS.html \
   469       | $(JDK_OUTPUTDIR)/demo/_the.db.unzipped
   476       | $(JDK_OUTPUTDIR)/demo/_the.db.unzipped
   470 	$(MKDIR) -p $(@D)
   477 	$(MKDIR) -p $(@D)
   471 	$(CAT) $< | $(SED) "s/XXXX/$(shell cat $(JDK_TOPDIR)/src/closed/share/db/COPYRIGHTYEAR)/" > $@
   478 	$(CAT) $< | $(SED) "s/XXXX/$(shell cat $(DB_ZIP_DIR)/COPYRIGHTYEAR)/" > $@
   472 
   479 
   473   BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/_the.db.unzipped $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html
   480   BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/_the.db.unzipped $(JDK_OUTPUTDIR)/demo/db/README-JDK-DEMOS.html
   474 endif
   481 endif
   475 
   482 
   476 ##################################################################################################
   483 ##################################################################################################