1 #
   2 # Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved.
   3 #
   4 # Redistribution and use in source and binary forms, with or without
   5 # modification, are permitted provided that the following conditions
   6 # are met:
   7 #
   8 #   - Redistributions of source code must retain the above copyright
   9 #     notice, this list of conditions and the following disclaimer.
  10 #
  11 #   - Redistributions in binary form must reproduce the above copyright
  12 #     notice, this list of conditions and the following disclaimer in the
  13 #     documentation and/or other materials provided with the distribution.
  14 #
  15 #   - Neither the name of Oracle nor the names of its
  16 #     contributors may be used to endorse or promote products derived
  17 #     from this software without specific prior written permission.
  18 #
  19 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  20 # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  21 # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  22 # PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  23 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  24 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  25 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  26 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  27 # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  28 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  29 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30 #
  31 
  32 SOURCEPATH=src
  33 CLASSES=build
  34 DIST=dist
  35 RESOURCES=resources
  36 
  37 J2DBENCH_CLASSES = \
  38         $(CLASSES)/j2dbench/J2DBench.class \
  39         $(CLASSES)/j2dbench/Destinations.class \
  40         $(CLASSES)/j2dbench/Group.class \
  41         $(CLASSES)/j2dbench/Result.class \
  42         $(CLASSES)/j2dbench/Modifier.class \
  43         $(CLASSES)/j2dbench/Node.class \
  44         $(CLASSES)/j2dbench/Option.class \
  45         $(CLASSES)/j2dbench/ResultSet.class \
  46         $(CLASSES)/j2dbench/TestEnvironment.class \
  47         $(CLASSES)/j2dbench/Test.class \
  48         $(CLASSES)/j2dbench/ui/EnableButton.class \
  49         $(CLASSES)/j2dbench/ui/CompactLayout.class \
  50         $(CLASSES)/j2dbench/tests/ImageTests.class \
  51         $(CLASSES)/j2dbench/tests/RenderTests.class \
  52         $(CLASSES)/j2dbench/tests/PixelTests.class \
  53         $(CLASSES)/j2dbench/tests/MiscTests.class \
  54         $(CLASSES)/j2dbench/tests/iio/IIOTests.class \
  55         $(CLASSES)/j2dbench/tests/iio/InputTests.class \
  56         $(CLASSES)/j2dbench/tests/iio/InputImageTests.class \
  57         $(CLASSES)/j2dbench/tests/iio/InputStreamTests.class \
  58         $(CLASSES)/j2dbench/tests/iio/OutputTests.class \
  59         $(CLASSES)/j2dbench/tests/iio/OutputImageTests.class \
  60         $(CLASSES)/j2dbench/tests/iio/OutputStreamTests.class \
  61         $(CLASSES)/j2dbench/tests/text/TextConstructionTests.class \
  62         $(CLASSES)/j2dbench/tests/text/TextMeasureTests.class \
  63         $(CLASSES)/j2dbench/tests/text/TextRenderTests.class \
  64         $(CLASSES)/j2dbench/tests/text/TextTests.class \
  65         $(CLASSES)/j2dbench/tests/GraphicsTests.class
  66 
  67 J2DANALYZER_CLASSES = \
  68         $(CLASSES)/j2dbench/report/IIOComparator.class \
  69         $(CLASSES)/j2dbench/report/HTMLSeriesReporter.class \
  70         $(CLASSES)/j2dbench/report/J2DAnalyzer.class \
  71         $(CLASSES)/j2dbench/report/XMLHTMLReporter.class
  72 
  73 J2DBENCH_RESOURCES = \
  74         $(CLASSES)/j2dbench/tests/iio/images \
  75         $(CLASSES)/j2dbench/tests/text/textdata
  76 
  77 SCM_DIRs = .hg .svn CVS RCS SCCS Codemgr_wsdata deleted_files
  78 
  79 all: mkdirs J2DBench.jar J2DAnalyzer.jar
  80 
  81 run: mkdirs J2DBench.jar
  82         java -jar J2DBench.jar
  83 
  84 analyze: mkdirs J2DAnalyzer.jar
  85         java -jar J2DAnalyzer.jar
  86 
  87 J2DBench.jar: \
  88         $(J2DBENCH_CLASSES) $(J2DBENCH_RESOURCES) \
  89         $(CLASSES)/j2dbench.manifest
  90         jar cvmf $(CLASSES)/j2dbench.manifest $(DIST)/J2DBench.jar -C $(CLASSES) j2dbench
  91 
  92 J2DAnalyzer.jar: $(J2DANALYZER_CLASSES) $(CLASSES)/j2danalyzer.manifest
  93         jar cvmf $(CLASSES)/j2danalyzer.manifest \
  94                 $(DIST)/J2DAnalyzer.jar -C $(CLASSES) j2dbench/report
  95 
  96 $(CLASSES)/j2dbench/tests/iio/images: $(RESOURCES)/images
  97         cp -r $< $@
  98         cd $@ && rm -rf $(SCM_DIRs)
  99 
 100 $(CLASSES)/j2dbench/tests/text/textdata: $(RESOURCES)/textdata
 101         cp -r $< $@
 102         cd $@ && rm -rf $(SCM_DIRs)
 103 
 104 $(CLASSES)/j2dbench.manifest:
 105         echo "Main-Class: j2dbench.J2DBench" > $@
 106 
 107 $(CLASSES)/j2danalyzer.manifest:
 108         echo "Main-Class: j2dbench.report.J2DAnalyzer" > $@
 109 
 110 $(DIST):
 111         mkdir $(DIST)
 112 $(CLASSES):
 113         mkdir $(CLASSES)
 114 
 115 mkdirs: $(DIST) $(CLASSES)
 116 
 117 $(CLASSES)/j2dbench/%.class: $(SOURCEPATH)/j2dbench/%.java
 118         javac -source 1.5 -target 1.5 -d $(CLASSES) -sourcepath $(SOURCEPATH) $<
 119 
 120 clean:
 121         rm -rf $(CLASSES)
 122         rm -rf $(DIST)