jdk/make/javax/swing/beaninfo/SwingBeans.gmk
author jrose
Fri, 05 Nov 2010 12:18:30 -0700
changeset 7118 aa8f53fcb28f
parent 5506 202f599c92aa
child 7668 d4a77089c587
permissions -rw-r--r--
6996563: 6984311 changes forgot to update vmStructs.cpp for new field _operands Summary: Add missing line to vmStructs. Also fix bug with class dumper. Reviewed-by: twisti, kvn

#
# Copyright (c) 1998, 2008, 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.
#

#
# Makefile to build the BeanInfo generation tool (ie, a doclet), and
# then the beaninfo itself.  Swing versions prior to 1.2 are no longer
# built.
#
# This makefile could be a lot simpler if we made it more regular.
#

# identify this as a swingbeans product - used only to identify a
# unique name for OBJDIR
PRODUCT = swing-beans

#
# Main targets provided by this makefile.
# 
swing-1.2-beans:
	$(MAKE) DEBUG_FLAG=false make-swing-beans
swing-1.2-beans-debug:
	$(MAKE) DEBUG_FLAG=true make-swing-beans


# get the absolute path to the jar command.
PREFIX          = 1.2
JAVADOCFLAGS    += $(NO_PROPRIETARY_API_WARNINGS) $(LANGUAGE_VERSION)
SWINGPKG        = javax/swing
LOCAL_JAVAC_FLAGS = $(OTHER_JAVACFLAGS)
# since JAVADOC_CMD runs on ALT_BOOTDIR, the doclet and all its classes must be compiled to match
DOCLET_JAVAC_FLAGS = -source 6 -target 6

include FILES.gmk
include $(BUILDDIR)/common/Release.gmk

DOCLETSRC    = $(BUILDDIR)/tools/swing-beans
DOCLETDST    = $(TEMPDIR)

FILES_java   = GenSwingBeanInfo.java GenDocletBeanInfo.java DocBeanInfo.java
FILES_class  = $(FILES_java:%.java=$(DOCLETDST)/%.class)
FAKESRC	     = $(TOPDIR)/src/share/classes
BEANSRCDIR  =  $(TEMPDIR)/$(PREFIX)src
BEANCLASSDIR = $(TEMPDIR)/$(PREFIX)classes
FILES_beans =  $(BEANS:%=$(BEANSRCDIR)/%BeanInfo.java) \
	       $(BEANS_TEXT:%=$(BEANSRCDIR)/text/%BeanInfo.java)  \
	       $(BEANSRCDIR)/SwingBeanInfoBase.java \
	       $(BEANSRCDIR)/BeanInfoUtils.java
               
FILES_bclass = $(FILES_beans:$(BEANSRCDIR)/%.java=$(BEANCLASSDIR)/$(SWINGPKG)/%.class)
DOCLETFLAGS  = -doclet GenDocletBeanInfo
LOCAL_CLASSPATH = "$(CLASSBINDIR)$(CLASSPATH_SEPARATOR)$(BEANCLASSDIR)$(CLASSPATH_SEPARATOR)."

#
# Main target.
#
make-swing-beans: mkdoclet mkbeaninfo mkclasses mkpackaging

#
# Make the doclet.
#
mkdoclet: $(DOCLETDST) $(FILES_class) .SwingBeanInfo

$(OBJDIR) $(BEANCLASSDIR) $(BEANSRCDIR) $(DOCLETDST)::
	@$(ECHO) "Making directory..." $@
	@$(MKDIR) -p $@

$(DOCLETDST)/%.class: $(DOCLETSRC)/%.java
	$(JAVAC_CMD) $(LOCAL_JAVAC_FLAGS) $(DOCLET_JAVAC_FLAGS) -classpath "$(CLASSBINDIR)$(CLASSPATH_SEPARATOR)$(DOCLETSRC)" -d $(DOCLETDST) $?
	@$(java-vm-cleanup)

# To run, the doclet needs SwingBeanInfoBase class.  Also Notice the lie
# here, SwingBeanInfoBase.class goes elswhere.

.SwingBeanInfo: $(OBJDIR) $(BEANCLASSDIR) $(BEANSRCDIR) $(SWINGPKG)/BeanInfoUtils.class $(SWINGPKG)/SwingBeanInfoBase.class 

$(SWINGPKG)/BeanInfoUtils.class: $(BEANSRCDIR)/BeanInfoUtils.java
	$(JAVAC_CMD) $(LOCAL_JAVAC_FLAGS) $(DOCLET_JAVAC_FLAGS) -d $(BEANCLASSDIR) $<
	@$(java-vm-cleanup)

$(SWINGPKG)/SwingBeanInfoBase.class: $(BEANSRCDIR)/SwingBeanInfoBase.java $(BEANSRCDIR)/BeanInfoUtils.java
	$(JAVAC_CMD) $(LOCAL_JAVAC_FLAGS) $(DOCLET_JAVAC_FLAGS) -classpath $(BEANCLASSDIR) -d $(BEANCLASSDIR) $<
	@$(java-vm-cleanup)

#
# Stage 1: Generate *BeanInfo.java files.
#
mkbeaninfo: $(BEANSRCDIR) .delete.beanlist $(FILES_beans) .javadoc.beanlist

.delete.beanlist: 
	@$(RM) $(TEMPDIR)/.beans.list

.javadoc.beanlist:
	if [ -s $(TEMPDIR)/.beans.list ]; \
	then $(JAVADOC_CMD) $(DOCLETFLAGS) -x $(DEBUG_FLAG) -d $(BEANSRCDIR) -t $(DOCLETSRC)/SwingBeanInfo.template -docletpath $(DOCLETDST) \
	    $(shell if [ -s $(TEMPDIR)/.beans.list ]; then $(CAT) $(TEMPDIR)/.beans.list; fi); \
	fi
	@$(java-vm-cleanup)

$(BEANSRCDIR)/text/%BeanInfo.java: $(FAKESRC)/$(SWINGPKG)/text/%.java
	@$(ECHO) $< >> $(TEMPDIR)/.beans.list

$(BEANSRCDIR)/%BeanInfo.java: $(FAKESRC)/$(SWINGPKG)/%.java
	@$(ECHO) $< >> $(TEMPDIR)/.beans.list

$(BEANSRCDIR)/SwingBeanInfoBase.java: $(DOCLETSRC)/beaninfo/SwingBeanInfoBase.java
	$(CP) $< $@

$(BEANSRCDIR)/BeanInfoUtils.java: $(DOCLETSRC)/beaninfo/BeanInfoUtils.java
	$(CP) $< $@

#
# Compile the generated *BeanInfo.java files.
#
mkclasses: .delete.classlist $(BEANCLASSDIR)/$(SWINGPKG)/SwingBeanInfoBase.class \
	$(BEANCLASSDIR)/$(SWINGPKG)/text/JTextComponentBeanInfo.class \
	.create.classlist $(FILES_bclass) .compile.classlist

$(BEANCLASSDIR)/$(SWINGPKG)/SwingBeanInfoBase.class:: \
	$(BEANSRCDIR)/SwingBeanInfoBase.java

$(BEANCLASSDIR)/$(SWINGPKG)/text/JTextComponentBeanInfo.class:: \
	$(BEANSRCDIR)/JTextComponentBeanInfo.java

$(FILES_bclass):: $(FILES_beans)

# all the sources are in one directory, so make sure that the list does
# not have the /text direcotry in it. Kludgy, this is...
.create.classlist:
	@$(ECHO) $(subst /text/,/,$(FILES_beans)) >> $(TEMPDIR)/.classes.list

.delete.classlist:
	@$(ECHO) "Deleting classes.list..."
	@$(RM) $(TEMPDIR)/.classes.list

.compile.classlist:
	if [ -s $(TEMPDIR)/.classes.list ] ; then \
	    $(JAVAC_CMD) $(LOCAL_JAVAC_FLAGS) -classpath $(LOCAL_CLASSPATH) -d $(BEANCLASSDIR) \
	    $(shell if [ -s $(TEMPDIR)/.classes.list ] ; then $(CAT) $(TEMPDIR)/.classes.list; fi ) ; \
	fi
	@$(java-vm-cleanup)

#
# Packaging
#
mkpackaging: 
	$(RM) -r $(BEANCLASSDIR)/$(SWINGPKG)/beaninfo/images
	$(MKDIR) -p $(BEANCLASSDIR)/$(SWINGPKG)/beaninfo/images
	$(CP) $(DOCLETSRC)/beaninfo/images/*.gif $(BEANCLASSDIR)/$(SWINGPKG)/beaninfo/images
	$(BOOT_JAR_CMD) cf $(TEMPDIR)/tmp.jar \
	     -C $(BEANCLASSDIR) javax \
	     -C $(BEANCLASSDIR) sun \
	     $(BOOT_JAR_JFLAGS)
	$(MV) $(TEMPDIR)/tmp.jar $(JDK_IMAGE_DIR)/lib/dt.jar
	@$(java-vm-cleanup)

#
# Cleanliness.
#
swingbeans.clean swingbeans.clobber::
	$(RM) -r 1.2src 1.2classes
	$(RM) -r java javax
	$(RM) *.class
	$(RM) $(TEMPDIR)/.beans.list $(TEMPDIR)/.classes.list beaninfo.jar

#
# Utility.
#


#
# Debugging targets for looking at variables.
#
show-vars:
	@$(ECHO) FILES_beans = $(FILES_beans)
	@$(ECHO) FILES_bclass = $(FILES_bclass)

.PRECIOUS: $(FILES_beans) 

.PHONY: swing-1.2-beans swing-1.2-beans-debug \
	make-swing-beans mkdoclet .SwingBeanInfo mkbeaninfo .delete.beanlist \
	.javadoc.beanlist mkclasses .create.classlist .delete.classlist \
	.compile.classlist mkpackaging mkpackaging swingbeans.clean \
	swingbeans.clobber show-vars