OSDN Git Service

config/ChangeLog:
[pf3gnuchains/gcc-fork.git] / libjava / testsuite / Makefile.am
1 ## Process this file with automake to produce Makefile.in.
2
3 AUTOMAKE_OPTIONS = foreign dejagnu
4
5 # May be used by various substitution variables.
6 gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
7
8 # autoconf2.13's target_alias
9 target_noncanonical = @target_noncanonical@
10
11 # Setup the testing framework, if you have one
12 EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \
13             echo $(top_builddir)/../expect/expect ; \
14           else echo expect ; fi`
15
16 RUNTEST = "`if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
17                echo $(top_srcdir)/../dejagnu/runtest ; \
18             else echo runtest; fi` $(AM_RUNTESTFLAGS)"
19
20 ## Tell dejagnu whether the interpreter is enabled.
21 AM_RUNTESTFLAGS = INTERPRETER=$(INTERPRETER)
22
23 MYGCJH = gjavah
24
25 .PHONY: compile-tests
26
27 # We need more things in site.exp, but automake completely controls the
28 # creation of that file; there's no way to append to it without messing up
29 # the dependency chains.  So we overrule automake.  This rule is exactly
30 # what it would have generated, plus our own additions.
31 site.exp: Makefile
32         @echo 'Making a new site.exp file...'
33         @echo '## these variables are automatically generated by make ##' >site.tmp
34         @echo '# Do not edit here.  If you wish to override these values' >>site.tmp
35         @echo '# edit the last section' >>site.tmp
36         @echo 'set srcdir $(srcdir)' >>site.tmp
37         @echo "set objdir `pwd`" >>site.tmp
38         @echo 'set build_alias "$(build_alias)"' >>site.tmp
39         @echo 'set build_triplet $(build_triplet)' >>site.tmp
40         @echo 'set host_alias "$(host_alias)"' >>site.tmp
41         @echo 'set host_triplet $(host_triplet)' >>site.tmp
42         @echo 'set target_alias "$(target_alias)"' >>site.tmp
43         @echo 'set target_triplet $(target_triplet)' >>site.tmp
44         @echo 'set libiconv "$(LIBICONV)"' >>site.tmp
45         @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
46         @test ! -f site.exp || \
47           sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
48         @-rm -f site.bak
49         @test ! -f site.exp || mv site.exp site.bak
50         @mv site.tmp site.exp
51
52 check-am: compile-tests
53
54 compile-tests:
55 if JAVA_MAINTAINER_MODE
56         for test in `cd $(srcdir) > /dev/null; \
57                      find libjava.cni libjava.jni libjava.jvmti libjava.lang \
58                           libjava.loader libjava.verify -name \*.java`; do \
59           testjar=$(srcdir)/`echo $$test | sed -e 's/\.java$$/\.jar/'`; \
60           testdep=; \
61           genheader=; \
62           case "$$test" in \
63             libjava.loader/dummy.java) \
64               testjar=$(srcdir)/libjava.loader/dummy.class;; \
65             libjava.loader/MyLoader.java) \
66               continue;; \
67             libjava.loader/*.java) \
68               testdep="libjava.loader/MyLoader.java";; \
69             libjava.jni/register2.java) \
70               ;; \
71             libjava.jni/*.java|libjava.jvmti/interp/*.java) \
72               genheader=-jni;; \
73             libjava.jvmti/*.java|libjava.cni/*.java) \
74               genheader=-cni;; \
75           esac; \
76           if test -f $$testjar; then \
77             if ! test $(srcdir)/$$test -nt $$testjar; then \
78               test -z "$$testdep" && continue; \
79               test $(srcdir)/$$testdep -nt $$testjar || continue; \
80             fi; \
81           fi; \
82           echo Compiling $$test; \
83           testtmpdir=`echo $$test | sed -e 's,/,_,g'`T; \
84           rm -rf $$testtmpdir; $(mkdir_p) $$testtmpdir; \
85           if test -n "$$testdep"; then \
86             $(GCJ) -C -g -w --encoding=UTF-8 -bootclasspath \
87               $(top_builddir)/libgcj-$(gcc_version).jar::$$testtmpdir \
88               -d $$testtmpdir $(srcdir)/$$testdep || exit; \
89           fi; \
90           $(GCJ) -C -g -w --encoding=UTF-8 -bootclasspath \
91             $(top_builddir)/libgcj-$(gcc_version).jar:$$testtmpdir \
92             -d $$testtmpdir $(srcdir)/$$test || exit; \
93           case "$$test" in \
94             libjava.loader/dummy.java) \
95               cp $$testtmpdir/dummy.class $$testjar;; \
96             *) \
97               $(JAR) cf $$testjar \
98                 `ls $$testtmpdir/*.class \
99                  | sed -e 's,^,-C ,;s,/\([^/]*\.class\)$$, \1,'` || exit ;; \
100           esac; \
101           if test -n "$$genheader"; then \
102             $(MYGCJH) $$genheader $$testtmpdir/*.class \
103               -bootclasspath $(top_builddir)/libgcj-$(gcc_version).jar \
104               -d $$testtmpdir/ || exit; \
105             mv $$testtmpdir/*.h $(srcdir)/`dirname $$test`/ 2>/dev/null; \
106           fi; \
107           rm -rf $$testtmpdir; \
108         done
109 endif