1 # Makefile for regression testing the GNU debugger.
2 # Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
4 # This file is part of GDB.
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)
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.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; see the file COPYING. If not, write to
18 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
22 program_transform_name =
24 exec_prefix = $(prefix)
25 bindir = $(exec_prefix)/bin
26 libdir = $(exec_prefix)/lib
27 tooldir = $(libdir)/$(target_alias)
29 datadir = $(exec_prefix)/lib/dejagnu
30 mandir = $(prefix)/man
31 man1dir = $(mandir)/man1
32 man2dir = $(mandir)/man2
33 man3dir = $(mandir)/man3
34 man4dir = $(mandir)/man4
35 man5dir = $(mandir)/man5
36 man6dir = $(mandir)/man6
37 man7dir = $(mandir)/man7
38 man8dir = $(mandir)/man8
39 man9dir = $(mandir)/man9
40 infodir = $(prefix)/info
41 includedir = $(prefix)/include
42 gxx_includedir = $(tooldir)/g++-include
43 docdir = $(datadir)/doc
44 targetdir = $(datadir)/$(target_alias)
49 INSTALL_PROGRAM = $(INSTALL)
50 INSTALL_DATA = $(INSTALL)
53 # start-sanitize-chill
54 CHILLFLAGS = $(CFLAGS)
56 # This should probably be consistent with the top-level Makefile.in,
57 # gdb/Makefile.in, and gdb/testsuite/gdb.t2*/Makefile.in, so that "make check"
58 # has the same effect no matter where it is run.
64 EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \
65 echo $${rootme}/../../expect/expect ; \
66 else echo expect ; fi`
68 RUNTEST = $(RUNTEST_FOR_TARGET)
72 RUNTEST_FOR_TARGET = `\
73 if [ -f $${srcdir}/../../dejagnu/runtest ]; then \
74 echo $${srcdir}/../../dejagnu/runtest; \
76 if [ "$(host_canonical)" = "$(target_canonical)" ]; then \
79 t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \
84 if [ -f $${rootme}/../../gcc/xgcc ] ; then \
85 if [ -f $${rootme}/../../newlib/Makefile ]; then \
86 echo $${rootme}/../../gcc/xgcc -B$${rootme}/../../gcc/ -idirafter $${rootme}/../../newlib/targ-include -idirafter $${rootsrc}/../../newlib/libc/include -nostdinc -L$${rootme}/../../newlib -B$${rootme}/../../newlib/; \
88 echo $${rootme}/../../gcc/xgcc -B$${rootme}/../../gcc/; \
91 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
94 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
100 if [ -f $${rootme}/../../gcc/xgcc ] ; then \
101 if [ -f $${rootme}/../../newlib/Makefile ]; then \
102 echo $${rootme}/../../gcc/xgcc -B$${rootme}/../../gcc/ -idirafter $${rootme}/../../newlib/targ-include -idirafter $${rootsrc}/../../newlib/libc/include -nostdinc -L$${rootme}/../../newlib -B$${rootme}/../../newlib/; \
104 echo $${rootme}/../../gcc/xgcc -B$${rootme}/../../gcc/; \
107 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
110 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
114 # start-sanitize-chill
115 CHILLFLAGS = $(CFLAGS)
117 CHILL_FOR_TARGET = ` \
118 if [ -f $${rootme}/../../gcc/Makefile ] ; then \
119 echo $${rootme}/../../gcc/xgcc -B$${rootme}../../gcc/; \
121 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
124 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
127 CHILL = $(CHILL_FOR_TARGET)
130 if [ -f $${rootme}/../../gcc/ch/runtime/libchill.a ] ; then \
131 echo $${rootme}/../../gcc/ch/runtime/chillrt0.o \
132 $${rootme}/../../gcc/ch/runtime/libchill.a; \
139 if [ -f $${rootme}/../gdb ] ; then \
140 echo $${rootme}/../gdb ; \
142 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
145 t='$(program_transform_name)'; echo gdb | sed -e '' $$t; \
151 #### host, target, and site specific Makefile frags come in here.
153 # The use of $$(x_FOR_TARGET) reduces the command line length by not
154 # duplicating the lengthy definition.
156 TARGET_FLAGS_TO_PASS = \
158 "exec_prefix=$(exec_prefix)" \
159 "against=$(against)" \
160 'CC=$$(CC_FOR_TARGET)' \
161 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
163 $(start-sanitize-chill) \
164 "CHILLFLAGS=$(CHILLFLAGS)" \
165 'CHILL=$$(CHILL_FOR_TARGET)' \
166 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
167 "CHILL_LIB=$(CHILL_LIB)" \
168 $(end-sanitize-chill) \
169 'CXX=$$(CXX_FOR_TARGET)' \
170 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
171 "CXXFLAGS=$(CXXFLAGS)" \
172 "MAKEINFO=$(MAKEINFO)" \
173 "INSTALL=$(INSTALL)" \
174 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
175 "INSTALL_DATA=$(INSTALL_DATA)" \
176 "LDFLAGS=$(LDFLAGS)" \
178 "RUNTEST=$(RUNTEST)" \
179 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
194 site.exp: ./config.status Makefile
195 @echo "Making a new config file..."
198 -@mv site.exp site.bak
199 @echo "## these variables are automatically generated by make ##" > ./tmp0
200 @echo "# Do not edit here. If you wish to override these values" >> ./tmp0
201 @echo "# add them to the last section" >> ./tmp0
202 @echo "set GDBFLAGS \"${GDBFLAGS}\"" >> ./tmp0
203 @echo "set host_alias $(host_alias)" >> ./tmp0
204 @echo "set host_triplet ${host_canonical}" >> ./tmp0
205 @echo "set target_alias $(target_alias)" >> ./tmp0
206 @echo "set target_triplet ${target_canonical}" >> ./tmp0
207 @echo "set srcdir ${srcdir}" >> ./tmp0
208 @echo "set tool gdb" >> ./tmp0
209 @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
210 @cat ./tmp0 > site.exp
211 @cat site.bak | sed \
212 -e '1,/^## All variables above are.*##/ d' >> site.exp
217 check: site.exp all just-check
220 rootme=`pwd`; export rootme; \
221 srcdir=${srcdir} ; export srcdir ; \
222 EXPECT=${EXPECT} ; export EXPECT ; \
223 if [ -f $${rootme}/../../expect/expect ] ; then \
224 TCL_LIBRARY=$${srcdir}/../../tcl/library ; \
225 export TCL_LIBRARY ; fi ; \
226 $(RUNTEST) $(RUNTESTFLAGS) GDB=$(GDB)
229 @for i in $(DODIRS); do \
230 if [ -d ./$$i ] ; then \
231 if (rootme=`pwd`/ ; export rootme ; \
232 rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \
234 $(MAKE) $(TARGET_FLAGS_TO_PASS) $(DO)) ; then true ; \
243 for dir in ${SUBDIRS}; \
246 if [ -d $$dir ]; then \
247 (rootme=`pwd`/ ; export rootme ; \
248 rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \
249 cd $$dir; $(MAKE) $(TARGET_FLAGS_TO_PASS)); \
254 -rm -f *~ core *.o a.out xgdb *.x
255 for dir in ${SUBDIRS}; \
258 if [ -d $$dir ]; then \
259 (cd $$dir; $(MAKE) clean); \
263 distclean realclean: clean
264 -rm -f *~ core *.log *.plog *.sum *.psum site.*
265 -rm -f Makefile config.status *-init.exp
266 -rm -fr *.log summary detail *.plog *.sum *.psum site.*
267 for dir in ${SUBDIRS}; \
270 if [ -d $$dir ]; then \
271 (cd $$dir; $(MAKE) distclean); \
275 Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in $(host_makefile_frag) $(target_makefile_frag)
276 $(SHELL) ./config.status