1 # Makefile for regression testing the GNU debugger.
2 # Copyright (C) 1992, 1993, 1994, 1995 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; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 exec_prefix = @exec_prefix@
24 host_alias = @host_alias@
25 target_alias = @target_alias@
26 program_transform_name = @program_transform_name@
27 build_canonical = @build@
28 host_canonical = @host@
29 target_canonical = @target@
30 target_cpu = @gdb_target_cpu@
34 RPATH_ENVVAR = @RPATH_ENVVAR@
36 EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \
37 echo $${rootme}/../../expect/expect ; \
38 else echo expect ; fi`
40 RUNTEST = $(RUNTEST_FOR_TARGET)
44 RUNTEST_FOR_TARGET = `\
45 if [ -f $${srcdir}/../../dejagnu/runtest ]; then \
46 echo $${srcdir}/../../dejagnu/runtest; \
48 if [ "$(host_canonical)" = "$(target_canonical)" ]; then \
51 t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \
55 #### host, target, and site specific Makefile frags come in here.
57 # The use of $$(x_FOR_TARGET) reduces the command line length by not
58 # duplicating the lengthy definition.
60 TARGET_FLAGS_TO_PASS = \
62 "exec_prefix=$(exec_prefix)" \
63 "against=$(against)" \
64 'CC=$$(CC_FOR_TARGET)' \
65 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
66 "CFLAGS=$(TESTSUITE_CFLAGS)" \
67 "CHILLFLAGS=$(CHILLFLAGS)" \
68 'CHILL=$$(CHILL_FOR_TARGET)' \
69 "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \
70 "CHILL_LIB=$(CHILL_LIB)" \
71 'CXX=$$(CXX_FOR_TARGET)' \
72 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
73 "CXXFLAGS=$(CXXFLAGS)" \
74 "MAKEINFO=$(MAKEINFO)" \
75 "INSTALL=$(INSTALL)" \
76 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
77 "INSTALL_DATA=$(INSTALL_DATA)" \
78 "LDFLAGS=$(LDFLAGS)" \
80 "RUNTEST=$(RUNTEST)" \
81 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
84 @echo "Nothing to be done for all..."
96 site.exp: ./config.status Makefile
97 @echo "Making a new config file..."
100 -@mv site.exp site.bak
101 @echo "## these variables are automatically generated by make ##" > ./tmp0
102 @echo "# Do not edit here. If you wish to override these values" >> ./tmp0
103 @echo "# add them to the last section" >> ./tmp0
104 @echo "set host_alias $(host_alias)" >> ./tmp0
105 @echo "set host_triplet ${host_canonical}" >> ./tmp0
106 @echo "set target_alias $(target_alias)" >> ./tmp0
107 @echo "set target_triplet ${target_canonical}" >> ./tmp0
108 @echo "set build_triplet ${build_canonical}" >> ./tmp0
109 @echo "set srcdir ${srcdir}" >> ./tmp0
110 @echo "set tool gdb" >> ./tmp0
111 @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
112 @cat ./tmp0 > site.exp
113 @cat site.bak | sed \
114 -e '1,/^## All variables above are.*##/ d' >> site.exp
119 check: site.exp all just-check
122 rootme=`pwd`; export rootme; \
123 srcdir=${srcdir} ; export srcdir ; \
124 EXPECT=${EXPECT} ; export EXPECT ; \
125 $(RPATH_ENVVAR)=$$rootme/../../expect:$$rootme/../../libstdc++:$$rootme/../../tk/unix:$$rootme/../../tcl/unix:$$rootme/../../bfd:$$rootme/../../opcodes:$$$(RPATH_ENVVAR); \
126 export $(RPATH_ENVVAR); \
127 if [ -f $${rootme}/../../expect/expect ] ; then \
128 TCL_LIBRARY=$${srcdir}/../../tcl/library ; \
129 export TCL_LIBRARY ; fi ; \
130 $(RUNTEST) $(RUNTESTFLAGS)
133 @for i in $(DODIRS); do \
134 if [ -d ./$$i ] ; then \
135 if (rootme=`pwd`/ ; export rootme ; \
136 rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \
138 $(MAKE) $(TARGET_FLAGS_TO_PASS) $(DO)) ; then true ; \
146 for dir in ${SUBDIRS} ; \
149 if [ -d $$dir ] ; then \
150 (rootme=`pwd`/ ; export rootme ; \
151 rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \
152 cd $$dir; $(MAKE) $(TARGET_FLAGS_TO_PASS)); \
157 -rm -f *~ core *.o a.out xgdb *.x
158 if [ x"${SUBDIRS}" != x ] ; then \
159 for dir in ${SUBDIRS}; \
162 if [ -d $$dir ]; then \
163 (cd $$dir; $(MAKE) clean); \
168 distclean maintainer-clean realclean: clean
169 -rm -f *~ core *.log *.plog *.sum *.psum site.*
170 -rm -f Makefile config.status *-init.exp
171 -rm -fr *.log summary detail *.plog *.sum *.psum site.*
172 if [ x"${SUBDIRS}" != x ] ; then \
173 for dir in ${SUBDIRS}; \
176 if [ -d $$dir ]; then \
177 (cd $$dir; $(MAKE) distclean); \
182 Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in $(host_makefile_frag) $(target_makefile_frag)
183 $(SHELL) ./config.status