mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2024-12-04 10:24:13 +00:00
Generic rules for building simple simulator test programs.
This commit is contained in:
parent
665ff287fb
commit
8603b0f0ff
48
sim/testsuite/common/Make-common.in
Normal file
48
sim/testsuite/common/Make-common.in
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user