procfs.c: Remove unused functions and make many functions static
[deliverable/binutils-gdb.git] / gdb / testsuite / Makefile.in
CommitLineData
c906108c 1# Makefile for regression testing the GNU debugger.
0b302171
JB
2# Copyright 1992-1996, 1998-2000, 2002-2005, 2007-2012 Free Software
3# Foundation, Inc.
c906108c
SS
4
5# This file is part of GDB.
6
d53a7b30 7# This program is free software; you can redistribute it and/or modify
c906108c 8# it under the terms of the GNU General Public License as published by
d53a7b30
JB
9# the Free Software Foundation; either version 3 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
c906108c
SS
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.
d53a7b30 16#
c906108c 17# You should have received a copy of the GNU General Public License
d53a7b30 18# along with this program. If not, see <http://www.gnu.org/licenses/>.
c906108c
SS
19
20VPATH = @srcdir@
21srcdir = @srcdir@
22prefix = @prefix@
23exec_prefix = @exec_prefix@
b8b4e42b 24abs_builddir = @abs_builddir@
c906108c 25
be2a5f71 26target_alias = @target_noncanonical@
c906108c
SS
27program_transform_name = @program_transform_name@
28build_canonical = @build@
29host_canonical = @host@
30target_canonical = @target@
c906108c
SS
31
32SHELL = @SHELL@
93076499 33EXEEXT = @EXEEXT@
c906108c
SS
34SUBDIRS = @subdirs@
35RPATH_ENVVAR = @RPATH_ENVVAR@
1d41d745 36ALL_SUBDIRS = gdb.ada gdb.arch gdb.asm gdb.base gdb.cell gdb.cp gdb.disasm \
30e62689 37 gdb.dwarf2 gdb.fortran gdb.gdb gdb.hp \
f8eba3c6 38 gdb.java gdb.linespec gdb.mi gdb.modula2 gdb.multi \
1d41d745 39 gdb.objc gdb.opencl gdb.opt gdb.pascal gdb.python gdb.server \
30e62689 40 gdb.stabs gdb.reverse gdb.threads gdb.trace gdb.xml \
f4b49756 41 $(SUBDIRS)
c906108c
SS
42
43EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \
44 echo $${rootme}/../../expect/expect ; \
45 else echo expect ; fi`
46
47RUNTEST = $(RUNTEST_FOR_TARGET)
48
49RUNTESTFLAGS =
50
6bc80edc
TT
51FORCE_PARALLEL =
52
c906108c
SS
53RUNTEST_FOR_TARGET = `\
54 if [ -f $${srcdir}/../../dejagnu/runtest ]; then \
55 echo $${srcdir}/../../dejagnu/runtest; \
56 else \
57 if [ "$(host_canonical)" = "$(target_canonical)" ]; then \
58 echo runtest; \
59 else \
dcfff61f 60 t='$(program_transform_name)'; echo runtest | sed -e $$t; \
c906108c
SS
61 fi; \
62 fi`
63
64#### host, target, and site specific Makefile frags come in here.
65
66# The use of $$(x_FOR_TARGET) reduces the command line length by not
67# duplicating the lengthy definition.
68
69TARGET_FLAGS_TO_PASS = \
70 "prefix=$(prefix)" \
71 "exec_prefix=$(exec_prefix)" \
72 "against=$(against)" \
73 'CC=$$(CC_FOR_TARGET)' \
74 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
75 "CFLAGS=$(TESTSUITE_CFLAGS)" \
c906108c
SS
76 'CXX=$$(CXX_FOR_TARGET)' \
77 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
78 "CXXFLAGS=$(CXXFLAGS)" \
79 "MAKEINFO=$(MAKEINFO)" \
80 "INSTALL=$(INSTALL)" \
81 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
82 "INSTALL_DATA=$(INSTALL_DATA)" \
83 "LDFLAGS=$(LDFLAGS)" \
84 "LIBS=$(LIBS)" \
85 "RUNTEST=$(RUNTEST)" \
86 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
87
88all:
89 @echo "Nothing to be done for all..."
90
91.NOEXPORT:
92INFODIRS=doc
93info:
94install-info:
95dvi:
9453113a
DJ
96pdf:
97install-pdf:
085dd6e6
JM
98html:
99install-html:
c906108c
SS
100
101install:
102
103uninstall: force
104
b8b4e42b
JK
105# Use absolute `site.exp' path everywhere to suppress VPATH lookups for it.
106# Bare `site.exp' is used as a target here if user requests it explicitly.
107# $(RUNTEST) is looking up `site.exp' only in the current directory.
108
109$(abs_builddir)/site.exp site.exp: ./config.status Makefile
c906108c
SS
110 @echo "Making a new config file..."
111 -@rm -f ./tmp?
112 @touch site.exp
113 -@mv site.exp site.bak
114 @echo "## these variables are automatically generated by make ##" > ./tmp0
115 @echo "# Do not edit here. If you wish to override these values" >> ./tmp0
116 @echo "# add them to the last section" >> ./tmp0
c906108c
SS
117 @echo "set host_triplet ${host_canonical}" >> ./tmp0
118 @echo "set target_alias $(target_alias)" >> ./tmp0
119 @echo "set target_triplet ${target_canonical}" >> ./tmp0
120 @echo "set build_triplet ${build_canonical}" >> ./tmp0
121 @echo "set srcdir ${srcdir}" >> ./tmp0
122 @echo "set tool gdb" >> ./tmp0
f3525b70 123 @echo 'source $${srcdir}/lib/append_gdb_boards_dir.exp' >> ./tmp0
c906108c
SS
124 @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
125 @cat ./tmp0 > site.exp
126 @cat site.bak | sed \
127 -e '1,/^## All variables above are.*##/ d' >> site.exp
128 -@rm -f ./tmp?
129
130installcheck:
131
6bc80edc
TT
132# For GNU make, try to run the tests in parallel. If RUNTESTFLAGS is
133# not empty, then by default the tests will be serialized. This can
134# be overridden by setting FORCE_PARALLEL to any non-empty value.
135# For a non-GNU make, do not parallelize.
136@GMAKE_TRUE@CHECK_TARGET = $(if $(FORCE_PARALLEL),check-parallel,$(if $(RUNTESTFLAGS),check-single,check-parallel))
137@GMAKE_FALSE@CHECK_TARGET = check-single
138
139check: $(CHECK_TARGET)
140
141# All the hair to invoke dejagnu. A given invocation can just append
142# $(RUNTESTFLAGS)
143DO_RUNTEST = \
c906108c
SS
144 rootme=`pwd`; export rootme; \
145 srcdir=${srcdir} ; export srcdir ; \
146 EXPECT=${EXPECT} ; export EXPECT ; \
93076499 147 EXEEXT=${EXEEXT} ; export EXEEXT ; \
c906108c
SS
148 $(RPATH_ENVVAR)=$$rootme/../../expect:$$rootme/../../libstdc++:$$rootme/../../tk/unix:$$rootme/../../tcl/unix:$$rootme/../../bfd:$$rootme/../../opcodes:$$$(RPATH_ENVVAR); \
149 export $(RPATH_ENVVAR); \
150 if [ -f $${rootme}/../../expect/expect ] ; then \
151 TCL_LIBRARY=$${srcdir}/../../tcl/library ; \
152 export TCL_LIBRARY ; fi ; \
6bc80edc
TT
153 $(RUNTEST)
154
b8b4e42b 155check-single: all $(abs_builddir)/site.exp
6bc80edc
TT
156 $(DO_RUNTEST) $(RUNTESTFLAGS)
157
158# A list of all directories named "gdb.*" which also hold a .exp file.
159# We filter out gdb.base and add fake entries, because that directory
160# takes the longest to process, and so we split it in half.
161TEST_DIRS = gdb.base1 gdb.base2 $(filter-out gdb.base,$(sort $(notdir $(patsubst %/,%,$(dir $(wildcard $(srcdir)/gdb.*/*.exp))))))
162
163TEST_TARGETS = $(addprefix check-,$(TEST_DIRS))
164
165# We explicitly re-invoke make here for two reasons. First, it lets
166# us add a -k option, which makes the parallel check mimic the
167# behavior of the serial check; and second, it means that we can still
168# regenerate the sum and log files even if a sub-make fails -- which
169# it usually does because dejagnu exits with an error if any test
170# fails.
171check-parallel:
172 $(MAKE) -k $(TEST_TARGETS); \
173 $(SHELL) $(srcdir)/dg-extract-results.sh \
174 $(addsuffix /gdb.sum,$(TEST_DIRS)) > gdb.sum; \
175 $(SHELL) $(srcdir)/dg-extract-results.sh -L \
176 $(addsuffix /gdb.log,$(TEST_DIRS)) > gdb.log
177
26e197f6
JK
178@GMAKE_TRUE@$(filter-out check-gdb.base%,$(TEST_TARGETS)): check-gdb.%: all $(abs_builddir)/site.exp
179@GMAKE_TRUE@ @if test ! -d gdb.$*; then mkdir gdb.$*; fi
180@GMAKE_TRUE@ $(DO_RUNTEST) --directory=gdb.$* --outdir=gdb.$* $(RUNTESTFLAGS)
6bc80edc
TT
181
182# Each half (roughly) of the .exp files from gdb.base.
183BASE1_FILES = $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/gdb.base/[a-m]*.exp))
184BASE2_FILES = $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/gdb.base/[n-z]*.exp))
185
186# Handle each half of gdb.base.
b8b4e42b 187check-gdb.base%: all $(abs_builddir)/site.exp
6bc80edc
TT
188 @if test ! -d gdb.base$*; then mkdir gdb.base$*; fi
189 $(DO_RUNTEST) $(BASE$*_FILES) --outdir gdb.base$* $(RUNTESTFLAGS)
190
c906108c
SS
191subdir_do: force
192 @for i in $(DODIRS); do \
193 if [ -d ./$$i ] ; then \
194 if (rootme=`pwd`/ ; export rootme ; \
195 rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \
196 cd ./$$i; \
197 $(MAKE) $(TARGET_FLAGS_TO_PASS) $(DO)) ; then true ; \
198 else exit 1 ; fi ; \
199 else true ; fi ; \
200 done
201
202force:;
203
204subdirs:
696d5a5b 205 for dir in ${ALL_SUBDIRS} ; \
c906108c
SS
206 do \
207 echo "$$dir:" ; \
208 if [ -d $$dir ] ; then \
209 (rootme=`pwd`/ ; export rootme ; \
210 rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \
211 cd $$dir; $(MAKE) $(TARGET_FLAGS_TO_PASS)); \
212 fi; \
213 done
214
215clean mostlyclean:
1d41d745
MS
216 -rm -f *~ core *.o a.out xgdb *.x *.grt bigcore.corefile .gdb_history
217 -rm -f core.* *.tf *.cl *.py tracecommandsscript copy1.txt zzz-gdbscript
696d5a5b
DJ
218 if [ x"${ALL_SUBDIRS}" != x ] ; then \
219 for dir in ${ALL_SUBDIRS}; \
c906108c
SS
220 do \
221 echo "$$dir:"; \
222 if [ -d $$dir ]; then \
223 (cd $$dir; $(MAKE) clean); \
224 fi; \
225 done ; \
226 else true; fi
227
228distclean maintainer-clean realclean: clean
229 -rm -f *~ core
230 -rm -f Makefile config.status *-init.exp
231 -rm -fr *.log summary detail *.plog *.sum *.psum site.*
696d5a5b
DJ
232 if [ x"${ALL_SUBDIRS}" != x ] ; then \
233 for dir in ${ALL_SUBDIRS}; \
c906108c
SS
234 do \
235 echo "$$dir:"; \
236 if [ -d $$dir ]; then \
237 (cd $$dir; $(MAKE) distclean); \
238 fi; \
239 done ; \
240 else true; fi
241
a4ce5b0d 242Makefile : Makefile.in config.status $(host_makefile_frag)
c906108c
SS
243 $(SHELL) config.status
244
245config.status: configure
246 $(SHELL) config.status --recheck
6bf58e63
TT
247
248TAGS: force
967d1f9b
TT
249 find $(srcdir) -name '*.exp' -print | \
250 etags --regex='/proc[ \t]+\([^ \t]+\)/\1/' -
This page took 1.61722 seconds and 4 git commands to generate.