aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-09-16 23:57:57 +0000
committerAndrew Cagney <cagney@redhat.com>1997-09-16 23:57:57 +0000
commit8603b0f0ff1eb4e202e3ea8c1371bc038b6b9dad (patch)
tree8bdef1609b6d453b857ceafc32cafd5a73bb809a /sim/testsuite
parent665ff287fb1184dd0af5a31aaf3b7e713e7592f1 (diff)
downloadgdb-8603b0f0ff1eb4e202e3ea8c1371bc038b6b9dad.zip
gdb-8603b0f0ff1eb4e202e3ea8c1371bc038b6b9dad.tar.gz
gdb-8603b0f0ff1eb4e202e3ea8c1371bc038b6b9dad.tar.bz2
Generic rules for building simple simulator test programs.
Diffstat (limited to 'sim/testsuite')
-rw-r--r--sim/testsuite/common/Make-common.in48
1 files changed, 48 insertions, 0 deletions
diff --git a/sim/testsuite/common/Make-common.in b/sim/testsuite/common/Make-common.in
new file mode 100644
index 0000000..a51876a
--- /dev/null
+++ b/sim/testsuite/common/Make-common.in
@@ -0,0 +1,48 @@
+check: sanity $(TESTS)
+sanity:
+ @eval echo AS_FOR_TARGET = $(AS_FOR_TARGET)
+ @eval echo LD_FOR_TARGET = $(LD_FOR_TARGET)
+ @eval echo RUN_FOR_TARGET = $(RUN_FOR_TARGET)
+
+# Rules for running the tests
+
+.SUFFIXES: .ok .run .hi .ko
+.run.ok:
+ rm -f tmp-$* $*.hi
+ ulimit -t 5 ; \
+ $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$*
+ mv tmp-$* $*.ok
+.run.hi:
+ rm -f tmp-$* $*.hi diff-$*
+ ulimit -t 5 ; \
+ $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$*
+ echo 'Hello World!' | diff - tmp-$* > diff-$*
+ cat tmp-$* diff-$* > $*.hi
+.run.ko:
+ rm -f tmp-$* $*.ko
+ set +e ; \
+ ulimit -t 5 ; \
+ $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$* ; \
+ if [ $$? -eq 47 ] ; then \
+ exit 0 ; \
+ else \
+ exit 1 ; \
+ fi
+ mv tmp-$* $*.ko
+
+
+# Rules for building the test
+# Preference is for obtaining the executable (.run) from a prebuilt image
+
+.SUFFIXES: .uue .s .S .run
+.uue.run:
+ head $* | grep $*.run > /dev/null
+ uudecode $*.uue
+.run.u:
+ uuencode < $*.run $*.run > $*.u
+.o.run:
+ $(LD_FOR_TARGET) $(LDFLAGS_FOR_TARGET) -o $*.run $*.o
+.s.o:
+ $(AS_FOR_TARGET) $(ASFLAGS_FOR_TARGET) $(srcdir)/$*.s -o $*.o
+.S.o:
+ $(AS_FOR_TARGET) $(ASFLAGS_FOR_TARGET) $(srcdir)/$*.S -o $*.o