1 # Makefile for regression testing the GNU debugger.
2 # Copyright (C) 1992, 93, 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 GNU CC; 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)
57 # This should probably be consistent with the top-level Makefile.in,
58 # gdb/Makefile.in, and gdb/testsuite/gdb.t2*/Makefile.in, so that "make check"
59 # has the same effect no matter where it is run.
67 EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \
68 echo $${rootme}/../../expect/expect ; \
69 else echo expect ; fi`
71 RUNTEST_FOR_TARGET = ` \
72 if [ -f $${rootme}/../../dejagnu/site.exp ] ; then \
73 echo $${rootme}/../../dejagnu/runtest ; \
75 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
78 t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \
83 if [ -f $${rootme}/../../gcc/xgcc ] ; then \
84 echo $${rootme}/../../gcc/xgcc -B$${rootme}/../../gcc/; \
86 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
89 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
95 if [ -f $${rootme}/../../gcc/xgcc ] ; then \
96 echo $${rootme}/../../gcc/xgcc -B$${rootme}/../../gcc/; \
98 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
101 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
105 # start-sanitize-chill
106 CHILLFLAGS = $(CFLAGS)
108 CHILL_FOR_TARGET = ` \
109 if [ -f $${rootme}/../../gcc/xgcc ] ; then \
110 echo $${rootme}/../../gcc/xgcc -B$${rootme}/../../gcc/ -L$${rootme}/../../chillrt/; \
112 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
115 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
122 if [ -f $${rootme}/../../gcc/Makefile ] ; then \
123 echo $${rootme}/../../gcc/xgcc -B$${rootme}../../gcc/ -L$${rootme}../../chillrt/; \
125 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
128 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
134 if [ -f $${rootme}/../gdb ] ; \
135 then echo $${rootme}|sed -e 's@/[^/]*$$@@'|sed -e 's@$$@/gdb@' ; \
141 #### host, target, and site specific Makefile frags come in here.
143 # The use of $$(x_FOR_TARGET) reduces the command line length by not
144 # duplicating the lengthy definition.
145 TARGET_FLAGS_TO_PASS = \
147 "exec_prefix=$(exec_prefix)" \
148 "against=$(against)" \
149 'CC=$$(CC_FOR_TARGET)' \
150 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
152 $(start-sanitize-chill) \
153 "CHILLFLAGS=$(CHILLFLAGS)" \
154 'CHILL=$$(CHILL_FOR_TARGET)' \
155 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
156 "CHILL_LIB=$(CHILL_LIB)" \
157 $(end-sanitize-chill) \
158 'CXX=$$(CXX_FOR_TARGET)' \
159 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
160 "CXXFLAGS=$(CXXFLAGS)" \
161 "MAKEINFO=$(MAKEINFO)" \
162 "INSTALL=$(INSTALL)" \
163 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
164 "INSTALL_DATA=$(INSTALL_DATA)" \
165 "LDFLAGS=$(LDFLAGS)" \
167 "RUNTEST=$(RUNTEST)" \
168 "RUNTESTFLAGS=$(RUNTESTFLAGS)" \
183 site.exp: ./config.status Makefile
184 @echo "Making a new config file..."
187 -@mv site.exp site.bak
188 @echo "## these variables are automatically generated by make ##" > ./tmp0
189 @echo "# Do not edit here. If you wish to override these values" >> ./tmp0
190 @echo "# add them to the last section" >> ./tmp0
191 @echo "set GDBFLAGS \"${GDBFLAGS}\"" >> ./tmp0
192 @echo "set host_os ${host_os}" >> ./tmp0
193 @echo "set host_alias ${host_alias}" >> ./tmp0
194 @echo "set host_cpu ${host_cpu}" >> ./tmp0
195 @echo "set host_vendor ${host_vendor}" >> ./tmp0
196 @echo "set target_os ${target_os}" >> ./tmp0
197 @echo "set target_alias ${target_alias}" >> ./tmp0
198 @echo "set target_cpu ${target_cpu}" >> ./tmp0
199 @echo "set target_vendor ${target_vendor}" >> ./tmp0
200 @echo "set host_triplet ${host_canonical}" >> ./tmp0
201 @echo "set target_triplet ${target_canonical}" >> ./tmp0
202 @echo "set srcdir ${srcdir}" >> ./tmp0
203 @echo "set objdir `pwd`" >> ./tmp0
204 @echo "set tool gdb" >> ./tmp0
205 @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
206 @cat ./tmp0 > site.exp
207 @cat site.bak | sed \
208 -e '1,/^## All variables above are.*##/ d' >> site.exp
212 check: site.exp all just-check
214 rootme=`pwd`; export rootme; \
215 srcdir=${srcdir} ; export srcdir ; \
216 EXPECT=${EXPECT} ; export EXPECT ; \
217 if [ -f $${rootme}/../../expect/expect ] ; then \
218 TCL_LIBRARY=$${srcdir}/../../tcl/library ; \
219 export TCL_LIBRARY ; fi ; \
220 $(RUNTEST_FOR_TARGET) $(RUNTESTFLAGS) --tool gdb GDB=$(GDB) --srcdir $(srcdir)
223 @for i in $(DODIRS); do \
224 if [ -d ./$$i ] ; then \
225 if (rootme=`pwd`/ ; export rootme ; \
226 rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \
228 $(MAKE) $(TARGET_FLAGS_TO_PASS) $(DO)) ; then true ; \
237 for dir in ${SUBDIRS}; \
240 if [ -d $$dir ]; then \
241 (rootme=`pwd`/ ; export rootme ; \
242 rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \
243 cd $$dir; $(MAKE) $(TARGET_FLAGS_TO_PASS)); \
248 -rm -f *~ core *.o a.out xgdb *.x
249 for dir in ${SUBDIRS}; \
252 if [ -d $$dir ]; then \
253 (cd $$dir; $(MAKE) clean); \
257 distclean realclean: clean
258 -rm -f *~ core *.log *.plog *.sum *.psum site.*
259 -rm -f Makefile config.status *-init.exp
260 -rm -fr *.log summary detail *.plog *.sum *.psum site.*
261 for dir in ${SUBDIRS}; \
264 (cd $$dir; $(MAKE) distclean); \
267 Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in $(host_makefile_frag) $(target_makefile_frag)
268 $(SHELL) ./config.status