1 #
  2 # Copyright (c) 2002, 2021, 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 
 33 ifndef SOURCE
 34 export SOURCE := 7
 35 endif
 36 ifndef TARGET
 37 export TARGET := 7
 38 endif
 39 ifndef JAVAC
 40 export JAVAC := javac
 41 endif
 42 ifndef JAVA
 43 export JAVA := java
 44 endif
 45 ifndef JAR
 46 export JAR := jar
 47 endif
 48 
 49 SOURCEPATH=src
 50 CLASSES=build
 51 DIST=dist
 52 RESOURCES=resources
 53 
 54 J2DBENCH_CLASSES = \
 55 	$(CLASSES)/j2dbench/J2DBench.class \
 56 	$(CLASSES)/j2dbench/Destinations.class \
 57 	$(CLASSES)/j2dbench/Group.class \
 58 	$(CLASSES)/j2dbench/Result.class \
 59 	$(CLASSES)/j2dbench/Modifier.class \
 60 	$(CLASSES)/j2dbench/Node.class \
 61 	$(CLASSES)/j2dbench/Option.class \
 62 	$(CLASSES)/j2dbench/ResultSet.class \
 63 	$(CLASSES)/j2dbench/TestEnvironment.class \
 64 	$(CLASSES)/j2dbench/Test.class \
 65 	$(CLASSES)/j2dbench/ui/EnableButton.class \
 66 	$(CLASSES)/j2dbench/ui/CompactLayout.class \
 67 	$(CLASSES)/j2dbench/tests/ImageTests.class \
 68 	$(CLASSES)/j2dbench/tests/RenderTests.class \
 69 	$(CLASSES)/j2dbench/tests/PixelTests.class \
 70 	$(CLASSES)/j2dbench/tests/MiscTests.class \
 71 	$(CLASSES)/j2dbench/tests/iio/IIOTests.class \
 72 	$(CLASSES)/j2dbench/tests/iio/InputTests.class \
 73 	$(CLASSES)/j2dbench/tests/iio/InputImageTests.class \
 74 	$(CLASSES)/j2dbench/tests/iio/InputStreamTests.class \
 75 	$(CLASSES)/j2dbench/tests/iio/OutputTests.class \
 76 	$(CLASSES)/j2dbench/tests/iio/OutputImageTests.class \
 77 	$(CLASSES)/j2dbench/tests/iio/OutputStreamTests.class \
 78 	$(CLASSES)/j2dbench/tests/text/TextConstructionTests.class \
 79 	$(CLASSES)/j2dbench/tests/text/TextMeasureTests.class \
 80 	$(CLASSES)/j2dbench/tests/text/TextRenderTests.class \
 81 	$(CLASSES)/j2dbench/tests/text/TextTests.class \
 82 	$(CLASSES)/j2dbench/tests/GraphicsTests.class
 83 
 84 J2DANALYZER_CLASSES = \
 85 	$(CLASSES)/j2dbench/report/IIOComparator.class \
 86 	$(CLASSES)/j2dbench/report/HTMLSeriesReporter.class \
 87 	$(CLASSES)/j2dbench/report/J2DAnalyzer.class \
 88 	$(CLASSES)/j2dbench/report/XMLHTMLReporter.class
 89 
 90 J2DBENCH_RESOURCES = \
 91 	$(CLASSES)/j2dbench/tests/iio/images \
 92 	$(CLASSES)/j2dbench/tests/cmm/images \
 93 	$(CLASSES)/j2dbench/tests/text/textdata
 94 
 95 SCM_DIRs = .hg .svn CVS RCS SCCS Codemgr_wsdata deleted_files
 96 
 97 all: mkdirs J2DBench.jar J2DAnalyzer.jar
 98 
 99 run: mkdirs J2DBench.jar
100 	$(JAVA) -jar $(DIST)/J2DBench.jar
101 
102 analyze: mkdirs J2DAnalyzer.jar
103 	$(JAVA) -jar $(DIST)/J2DAnalyzer.jar
104 
105 J2DBench.jar: \
106 	$(J2DBENCH_CLASSES) $(J2DBENCH_RESOURCES) \
107 	$(CLASSES)/j2dbench.manifest
108 	$(JAR) cvmf $(CLASSES)/j2dbench.manifest $(DIST)/J2DBench.jar -C $(CLASSES) j2dbench
109 
110 J2DAnalyzer.jar: $(J2DANALYZER_CLASSES) $(CLASSES)/j2danalyzer.manifest
111 	$(JAR) cvmf $(CLASSES)/j2danalyzer.manifest \
112 		$(DIST)/J2DAnalyzer.jar -C $(CLASSES) j2dbench/report
113 
114 $(CLASSES)/j2dbench/tests/iio/images: $(RESOURCES)/images
115 	cp -r $< $@
116 	cd $@ && rm -rf $(SCM_DIRs)
117 
118 $(CLASSES)/j2dbench/tests/text/textdata: $(RESOURCES)/textdata
119 	cp -r $< $@
120 	cd $@ && rm -rf $(SCM_DIRs)
121 
122 $(CLASSES)/j2dbench/tests/cmm/images: $(RESOURCES)/cmm_images
123 	cp -r $< $@
124 	cd $@ && rm -rf $(SCM_DIRs)
125 
126 $(CLASSES)/j2dbench.manifest:
127 	echo "Main-Class: j2dbench.J2DBench" > $@
128 
129 $(CLASSES)/j2danalyzer.manifest:
130 	echo "Main-Class: j2dbench.report.J2DAnalyzer" > $@
131 
132 $(DIST):
133 	mkdir $(DIST)
134 $(CLASSES):
135 	mkdir $(CLASSES)
136 
137 mkdirs: $(DIST) $(CLASSES)
138 
139 $(CLASSES)/j2dbench/%.class: $(SOURCEPATH)/j2dbench/%.java
140 	$(JAVAC) -g:none -source $(SOURCE) -target $(TARGET) -d $(CLASSES) -sourcepath $(SOURCEPATH) $<
141 
142 clean:
143 	rm -rf $(CLASSES)
144 	rm -rf $(DIST)