jdk/make/tools/swing-nimbus/Makefile
changeset 3742 5e1b8bc3cb1a
parent 3741 4021567cd4ca
child 3743 906063616ec2
equal deleted inserted replaced
3741:4021567cd4ca 3742:5e1b8bc3cb1a
     1 #
       
     2 # Copyright 1998-2005 Sun Microsystems, Inc.  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.  Sun designates this
       
     8 # particular file as subject to the "Classpath" exception as provided
       
     9 # by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
       
    22 # CA 95054 USA or visit www.sun.com if you need additional information or
       
    23 # have any questions.
       
    24 #
       
    25 
       
    26 #
       
    27 # Makefile for building the Nimbus generator
       
    28 #
       
    29 
       
    30 BUILDDIR = ../..
       
    31 PACKAGE = org.jdesktop.synthdesigner.generator
       
    32 PRODUCT = tools
       
    33 PROGRAM = nimbus_generator
       
    34 include $(BUILDDIR)/common/Defs.gmk
       
    35 
       
    36 BUILDTOOL_SOURCE_ROOT = classes
       
    37 BUILDTOOL_MAIN        = $(PKGDIR)/Generator.java
       
    38 
       
    39 #
       
    40 # Files
       
    41 #
       
    42 
       
    43 MAIN_CLASS_FILE = $(BUILDTOOLCLASSDIR)/$(BUILDTOOL_MAIN:%.java=%.class)
       
    44 SOURCE_FILES    = $(shell $(FIND) $(BUILDTOOL_SOURCE_ROOT) -name '*.java' -print)
       
    45 
       
    46 TEMPLATE_FILES  = $(SHARE_SRC)/classes/javax/swing/plaf/nimbus/Defaults.template \
       
    47                   $(SHARE_SRC)/classes/javax/swing/plaf/nimbus/PainterImpl.template \
       
    48                   $(SHARE_SRC)/classes/javax/swing/plaf/nimbus/StateImpl.template
       
    49 TEMPLATE_DEST   = $(BUILDTOOLCLASSDIR)/org/jdesktop/synthdesigner/generator/resources
       
    50 
       
    51 JIBX_FILES      = $(BUILDTOOL_SOURCE_ROOT)/org/jdesktop/swingx/designer/Designer.jibx.xml \
       
    52                   $(BUILDTOOL_SOURCE_ROOT)/org/jdesktop/synthdesigner/synthmodel/SynthModel.jibx.xml
       
    53 JIBX_LIBS_CP    = $(JIBX_LIBS_PATH)/bcel.jar$(CLASSPATH_SEPARATOR)$(JIBX_LIBS_PATH)/xpp3.jar$(CLASSPATH_SEPARATOR)$(JIBX_LIBS_PATH)/jibx-bind.jar$(CLASSPATH_SEPARATOR)$(JIBX_LIBS_PATH)/jibx-run.jar
       
    54 JIBX_LIBS_LIST  = $(subst $(CLASSPATH_SEPARATOR), ,$(JIBX_LIBS_CP))
       
    55 
       
    56 
       
    57 #
       
    58 # Rules
       
    59 #
       
    60 
       
    61 include $(BUILDDIR)/common/BuildToolJar.gmk
       
    62 
       
    63 $(MAIN_CLASS_FILE): $(SOURCE_FILES) $(JIBX_LIBS_LIST)
       
    64 	@$(MKDIR) -p $(BUILDTOOLCLASSDIR)
       
    65 	$(BOOT_JAVAC_CMD) -classpath "$(JIBX_LIBS_CP)" \
       
    66 	    -d $(BUILDTOOLCLASSDIR) -sourcepath $(BUILDTOOL_SOURCE_ROOT) \
       
    67 	    $(SOURCE_FILES)
       
    68 
       
    69 $(TEMPLATE_DEST): $(TEMPLATE_FILES)
       
    70 	$(MKDIR) -p $(TEMPLATE_DEST)
       
    71 	$(RM) $(TEMPLATE_DEST)/*.template
       
    72 	$(CP) $(TEMPLATE_FILES) $(TEMPLATE_DEST)
       
    73 
       
    74 $(BUILDTOOL_MANIFEST_FILE): $(MAIN_CLASS_FILE)
       
    75 	$(ECHO) "Main-Class: $(BUILTTOOL_MAINCLASS)" > $@
       
    76 	$(ECHO) "Class-Path: $(JIBX_LIBS_LIST:$(JIBX_LIBS_PATH)/%=%)" >> $@
       
    77 	$(CP) $(JIBX_LIBS_LIST) $(BUILDTOOLJARDIR)
       
    78 
       
    79 $(BUILDTOOL_JAR_FILE): $(MAIN_CLASS_FILE) $(TEMPLATE_DEST) \
       
    80     $(JIBX_FILES) $(BUILDTOOL_MANIFEST_FILE)
       
    81 	@$(prep-target)
       
    82 	$(BOOT_JAVA_CMD) \
       
    83 	  -classpath "$(JIBX_LIBS_CP)$(CLASSPATH_SEPARATOR)$(BUILDTOOLCLASSDIR)" \
       
    84 	  org.jibx.binding.Compile $(JIBX_FILES)
       
    85 	$(BOOT_JAR_CMD) cfm $@ $(BUILDTOOL_MANIFEST_FILE) \
       
    86 	    -C $(BUILDTOOLCLASSDIR) org \
       
    87 	    $(BOOT_JAR_JFLAGS) || $(RM) $@
       
    88 	@$(java-vm-cleanup)
       
    89 
       
    90 clean clobber::
       
    91 	$(RM) -r $(TEMPLATE_DEST)