* utils.c (create_subprog_decl): If this is for the 'main' entry
[official-gcc.git] / libjava / testsuite / Makefile.am
blobfe42040d364d3afa82a722cb305d20402e2f7475
1 ## Process this file with automake to produce Makefile.in.
3 AUTOMAKE_OPTIONS = foreign dejagnu
5 # May be used by various substitution variables.
6 gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
8 # autoconf2.13's target_alias
9 target_noncanonical = @target_noncanonical@
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`
16 RUNTEST = "`if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
17                echo $(top_srcdir)/../dejagnu/runtest ; \
18             else echo runtest; fi` $(AM_RUNTESTFLAGS)"
20 ## Tell dejagnu whether the interpreter is enabled.
21 AM_RUNTESTFLAGS = INTERPRETER=$(INTERPRETER)
23 MYGCJH = gjavah
25 .PHONY: compile-tests
27 check-am: compile-tests
29 compile-tests:
30 if JAVA_MAINTAINER_MODE
31         for test in `cd $(srcdir) > /dev/null; \
32                      find libjava.cni libjava.jni libjava.jvmti libjava.lang \
33                           libjava.loader libjava.verify -name \*.java`; do \
34           testjar=$(srcdir)/`echo $$test | sed -e 's/\.java$$/\.jar/'`; \
35           testdep=; \
36           genheader=; \
37           case "$$test" in \
38             libjava.loader/dummy.java) \
39               testjar=$(srcdir)/libjava.loader/dummy.class;; \
40             libjava.loader/MyLoader.java) \
41               continue;; \
42             libjava.loader/*.java) \
43               testdep="libjava.loader/MyLoader.java";; \
44             libjava.jni/register2.java) \
45               ;; \
46             libjava.jni/*.java|libjava.jvmti/interp/*.java) \
47               genheader=-jni;; \
48             libjava.jvmti/*.java|libjava.cni/*.java) \
49               genheader=-cni;; \
50           esac; \
51           if test -f $$testjar; then \
52             if ! test $(srcdir)/$$test -nt $$testjar; then \
53               test -z "$$testdep" && continue; \
54               test $(srcdir)/$$testdep -nt $$testjar || continue; \
55             fi; \
56           fi; \
57           echo Compiling $$test; \
58           testtmpdir=`echo $$test | sed -e 's,/,_,g'`T; \
59           rm -rf $$testtmpdir; $(mkdir_p) $$testtmpdir; \
60           if test -n "$$testdep"; then \
61             $(GCJ) -C -g -w --encoding=UTF-8 -bootclasspath \
62               $(top_builddir)/libgcj-$(gcc_version).jar::$$testtmpdir \
63               -d $$testtmpdir $(srcdir)/$$testdep || exit; \
64           fi; \
65           $(GCJ) -C -g -w --encoding=UTF-8 -bootclasspath \
66             $(top_builddir)/libgcj-$(gcc_version).jar:$$testtmpdir \
67             -d $$testtmpdir $(srcdir)/$$test || exit; \
68           case "$$test" in \
69             libjava.loader/dummy.java) \
70               cp $$testtmpdir/dummy.class $$testjar;; \
71             *) \
72               $(JAR) cf $$testjar \
73                 `ls $$testtmpdir/*.class \
74                  | sed -e 's,^,-C ,;s,/\([^/]*\.class\)$$, \1,'` || exit ;; \
75           esac; \
76           if test -n "$$genheader"; then \
77             $(MYGCJH) $$genheader $$testtmpdir/*.class \
78               -bootclasspath $(top_builddir)/libgcj-$(gcc_version).jar \
79               -d $$testtmpdir/ || exit; \
80             mv $$testtmpdir/*.h $(srcdir)/`dirname $$test`/ 2>/dev/null; \
81           fi; \
82           rm -rf $$testtmpdir; \
83         done
84 endif