| 1 | # Makefile for regression testing the GNU debugger. |
| 2 | # Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. |
| 3 | |
| 4 | # This file is part of GDB. |
| 5 | |
| 6 | # GDB is free software; you can redistribute it and/or modify |
| 7 | # it under the terms of the GNU General Public License as published by |
| 8 | # the Free Software Foundation; either version 2, or (at your option) |
| 9 | # any later version. |
| 10 | |
| 11 | # GDB is distributed in the hope that it will be useful, |
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | # GNU General Public License for more details. |
| 15 | |
| 16 | # You should have received a copy of the GNU General Public License |
| 17 | # along with this program; if not, write to the Free Software |
| 18 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 19 | |
| 20 | VPATH = @srcdir@ |
| 21 | srcdir = @srcdir@ |
| 22 | srcroot = $(srcdir)/.. |
| 23 | |
| 24 | prefix = @prefix@ |
| 25 | exec_prefix = @exec_prefix@ |
| 26 | |
| 27 | host_alias = @host_alias@ |
| 28 | target_alias = @target_alias@ |
| 29 | program_transform_name = @program_transform_name@ |
| 30 | build_canonical = @build@ |
| 31 | host_canonical = @host@ |
| 32 | target_canonical = @target@ |
| 33 | target_cpu = @target_cpu@ |
| 34 | |
| 35 | |
| 36 | SHELL = /bin/sh |
| 37 | SUBDIRS = @subdirs@ |
| 38 | RPATH_ENVVAR = @RPATH_ENVVAR@ |
| 39 | |
| 40 | TESTS = \ |
| 41 | exit47.ko \ |
| 42 | hello.hi \ |
| 43 | t-dbt.ok \ |
| 44 | t-mac.ok \ |
| 45 | t-mvtac.ok \ |
| 46 | t-mvtc.ok \ |
| 47 | t-msbu.ok \ |
| 48 | t-mulxu.ok \ |
| 49 | t-rac.ok \ |
| 50 | t-rachi.ok \ |
| 51 | t-rdt.ok \ |
| 52 | t-rep.ok \ |
| 53 | t-rte.ok \ |
| 54 | t-sadd.ok \ |
| 55 | t-sp.ok \ |
| 56 | t-sub2w.ok \ |
| 57 | t-sub.ok \ |
| 58 | t-subi.ok \ |
| 59 | # |
| 60 | |
| 61 | AS_FOR_TARGET = `\ |
| 62 | if [ -x ../../../gas/as-new ]; then \ |
| 63 | echo ../../../gas/as-new ; \ |
| 64 | else \ |
| 65 | echo $(target_alias)-as ; \ |
| 66 | fi` |
| 67 | |
| 68 | LD_FOR_TARGET = `\ |
| 69 | if [ -x ../../../ld/ld-new ]; then \ |
| 70 | echo ../../../ld/ld-new ; \ |
| 71 | else \ |
| 72 | echo $(target_alias)-ld ; \ |
| 73 | fi` |
| 74 | |
| 75 | RUN_FOR_TARGET = `\ |
| 76 | if [ -x ../../../sim/d10v/run ]; then \ |
| 77 | echo ../../../sim/d10v/run ; \ |
| 78 | else \ |
| 79 | echo $(target_alias)-run ; \ |
| 80 | fi` |
| 81 | |
| 82 | |
| 83 | check: sanity $(TESTS) |
| 84 | sanity: |
| 85 | @eval echo AS_FOR_TARGET=$(AS_FOR_TARGET) |
| 86 | @eval echo LD_FOR_TARGET=$(LD_FOR_TARGET) |
| 87 | @eval echo RUN_FOR_TARGET=$(RUN_FOR_TARGET) |
| 88 | |
| 89 | clean: |
| 90 | rm -f $(TESTS) |
| 91 | rm -f *.run *.o |
| 92 | rm -f core *.core |
| 93 | |
| 94 | # Rules for running the tests |
| 95 | |
| 96 | .SUFFIXES: .ok .run .hi .ko .ti |
| 97 | .run.ok: |
| 98 | rm -f tmp-$* $*.hi |
| 99 | ulimit -t 5 ; \ |
| 100 | $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$* |
| 101 | mv tmp-$* $*.ok |
| 102 | .run.hi: |
| 103 | rm -f tmp-$* $*.hi diff-$* |
| 104 | ulimit -t 5 ; \ |
| 105 | $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$* |
| 106 | echo 'Hello World!' | diff - tmp-$* > diff-$* |
| 107 | cat tmp-$* diff-$* > $*.hi |
| 108 | .run.ko: |
| 109 | rm -f tmp-$* $*.ko |
| 110 | set +e ; \ |
| 111 | ulimit -t 5 ; \ |
| 112 | $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$* ; \ |
| 113 | if [ $$? -eq 47 ] ; then \ |
| 114 | exit 0 ; \ |
| 115 | else \ |
| 116 | exit 1 ; \ |
| 117 | fi |
| 118 | mv tmp-$* $*.ko |
| 119 | .run.ti: |
| 120 | rm -f tmp-$* $*.ti |
| 121 | set +e ; \ |
| 122 | ulimit -t 5 ; \ |
| 123 | $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $(INTFLAGS_FOR_TARGET) $*.run > tmp-$* |
| 124 | test `cat tmp-$* | wc -l` -eq 10 < /dev/null |
| 125 | test `grep Tick tmp-$* | wc -l` -eq 10 < /dev/null |
| 126 | mv tmp-$* $*.ti |
| 127 | |
| 128 | |
| 129 | # Rules for building the test |
| 130 | # Preference is for obtaining the executable (.run) from a prebuilt image |
| 131 | |
| 132 | .SUFFIXES: .uue .s .S .run |
| 133 | .uue.run: |
| 134 | head $* | grep $*.run > /dev/null |
| 135 | uudecode $*.uue |
| 136 | .run.u: |
| 137 | uuencode < $*.run $*.run > $*.u |
| 138 | .o.run: |
| 139 | $(LD_FOR_TARGET) $(LDFLAGS_FOR_TARGET) -o $*.run $*.o |
| 140 | .s.o: |
| 141 | $(AS_FOR_TARGET) $(ASFLAGS_FOR_TARGET) -I$(srcdir) $(srcdir)/$*.s -o $*.o |
| 142 | .S.o: |
| 143 | $(AS_FOR_TARGET) $(ASFLAGS_FOR_TARGET) -I$(srcdir) $(srcdir)/$*.S -o $*.o |
| 144 | |
| 145 | |
| 146 | Makefile: Makefile.in config.status |
| 147 | $(SHELL) ./config.status |
| 148 | |
| 149 | config.status: configure |
| 150 | $(SHELL) ./config.status --recheck |