This commit was generated by cvs2svn to track changes on a CVS vendor
[external/binutils.git] / gdb / testsuite / Makefile.in
1 # Makefile for regression testing the GNU debugger.
2 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000
3 # Free Software Foundation, Inc.
4
5 # This file is part of GDB.
6
7 # GDB is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
11
12 # GDB is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
21 VPATH = @srcdir@
22 srcdir = @srcdir@
23 prefix = @prefix@
24 exec_prefix = @exec_prefix@
25
26 host_alias = @host_alias@
27 target_alias = @target_alias@
28 program_transform_name = @program_transform_name@
29 build_canonical = @build@
30 host_canonical = @host@
31 target_canonical = @target@
32 target_cpu = @gdb_target_cpu@
33
34 SHELL = @SHELL@
35 EXEEXT = @EXEEXT@
36 SUBDIRS = @subdirs@
37 RPATH_ENVVAR = @RPATH_ENVVAR@
38
39 EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \
40           echo $${rootme}/../../expect/expect ; \
41           else echo expect ; fi`
42
43 RUNTEST = $(RUNTEST_FOR_TARGET)
44
45 RUNTESTFLAGS =
46
47 RUNTEST_FOR_TARGET = `\
48   if [ -f $${srcdir}/../../dejagnu/runtest ]; then \
49     echo $${srcdir}/../../dejagnu/runtest; \
50   else \
51     if [ "$(host_canonical)" = "$(target_canonical)" ]; then \
52       echo runtest; \
53     else \
54       t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \
55     fi; \
56   fi`
57
58 #### host, target, and site specific Makefile frags come in here.
59
60 # The use of $$(x_FOR_TARGET) reduces the command line length by not
61 # duplicating the lengthy definition.
62
63 TARGET_FLAGS_TO_PASS = \
64         "prefix=$(prefix)" \
65         "exec_prefix=$(exec_prefix)" \
66         "against=$(against)" \
67         'CC=$$(CC_FOR_TARGET)' \
68         "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
69         "CFLAGS=$(TESTSUITE_CFLAGS)" \
70         'CXX=$$(CXX_FOR_TARGET)' \
71         "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
72         "CXXFLAGS=$(CXXFLAGS)" \
73         "MAKEINFO=$(MAKEINFO)" \
74         "INSTALL=$(INSTALL)" \
75         "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
76         "INSTALL_DATA=$(INSTALL_DATA)" \
77         "LDFLAGS=$(LDFLAGS)" \
78         "LIBS=$(LIBS)" \
79         "RUNTEST=$(RUNTEST)" \
80         "RUNTESTFLAGS=$(RUNTESTFLAGS)"
81
82 all:
83         @echo "Nothing to be done for all..."
84
85 .NOEXPORT:
86 INFODIRS=doc
87 info:
88 install-info:
89 dvi:
90 html:
91 install-html:
92
93 install:
94
95 uninstall: force
96
97 site.exp: ./config.status Makefile
98         @echo "Making a new config file..."
99         -@rm -f ./tmp?
100         @touch site.exp
101         -@mv site.exp site.bak
102         @echo "## these variables are automatically generated by make ##" > ./tmp0
103         @echo "# Do not edit here. If you wish to override these values" >> ./tmp0
104         @echo "# add them to the last section" >> ./tmp0
105         @echo "set host_alias $(host_alias)" >> ./tmp0
106         @echo "set host_triplet ${host_canonical}" >> ./tmp0
107         @echo "set target_alias $(target_alias)" >> ./tmp0
108         @echo "set target_triplet ${target_canonical}" >> ./tmp0
109         @echo "set build_triplet ${build_canonical}" >> ./tmp0
110         @echo "set srcdir ${srcdir}" >> ./tmp0
111         @echo "set tool gdb" >> ./tmp0
112         @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
113                 @cat ./tmp0 > site.exp
114         @cat site.bak | sed \
115                         -e '1,/^## All variables above are.*##/ d' >> site.exp
116         -@rm -f ./tmp?
117
118 installcheck:
119
120 check: site.exp all just-check
121
122 just-check:
123         rootme=`pwd`; export rootme; \
124         srcdir=${srcdir} ; export srcdir ; \
125         EXPECT=${EXPECT} ; export EXPECT ; \
126         EXEEXT=${EXEEXT} ; export EXEEXT ; \
127         $(RPATH_ENVVAR)=$$rootme/../../expect:$$rootme/../../libstdc++:$$rootme/../../tk/unix:$$rootme/../../tcl/unix:$$rootme/../../bfd:$$rootme/../../opcodes:$$$(RPATH_ENVVAR); \
128         export $(RPATH_ENVVAR); \
129         if [ -f $${rootme}/../../expect/expect ] ; then  \
130           TCL_LIBRARY=$${srcdir}/../../tcl/library ; \
131           export TCL_LIBRARY ; fi ; \
132         $(RUNTEST) $(RUNTESTFLAGS) 
133
134 subdir_do: force
135         @for i in $(DODIRS); do \
136                 if [ -d ./$$i ] ; then \
137                         if (rootme=`pwd`/ ; export rootme ; \
138                             rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \
139                                 cd ./$$i; \
140                                 $(MAKE) $(TARGET_FLAGS_TO_PASS) $(DO)) ; then true ; \
141                         else exit 1 ; fi ; \
142                 else true ; fi ; \
143         done
144
145 force:;
146
147 subdirs:
148         for dir in ${SUBDIRS} ; \
149         do \
150                 echo "$$dir:" ; \
151                 if [ -d $$dir ] ; then \
152                         (rootme=`pwd`/ ; export rootme ; \
153                          rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \
154                          cd $$dir; $(MAKE) $(TARGET_FLAGS_TO_PASS)); \
155                 fi; \
156         done
157
158 clean mostlyclean:
159         -rm -f *~ core *.o a.out xgdb *.x *.grt
160         if [ x"${SUBDIRS}" != x ] ; then \
161             for dir in ${SUBDIRS}; \
162             do \
163                     echo "$$dir:"; \
164                     if [ -d $$dir ]; then \
165                             (cd $$dir; $(MAKE) clean); \
166                     fi; \
167             done ; \
168         else true; fi
169
170 distclean maintainer-clean realclean: clean
171         -rm -f *~ core
172         -rm -f Makefile config.status *-init.exp
173         -rm -fr *.log summary detail *.plog *.sum *.psum site.*
174         if [ x"${SUBDIRS}" != x ] ; then \
175             for dir in ${SUBDIRS}; \
176             do \
177                     echo "$$dir:"; \
178                     if [ -d $$dir ]; then \
179                             (cd $$dir; $(MAKE) distclean); \
180                     fi; \
181             done ; \
182         else true; fi
183
184 Makefile : Makefile.in config.status $(host_makefile_frag) $(target_makefile_frag)
185         $(SHELL) config.status
186
187 config.status: configure
188         $(SHELL) config.status --recheck