Commit | Line | Data |
---|---|---|
099c286e | 1 | # Makefile for regression testing the GNU debugger. |
ea68d58d | 2 | # Copyright (C) 1992, 93, 1994 Free Software Foundation, Inc. |
099c286e BC |
3 | |
4 | #This file is part of GDB. | |
5 | ||
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) | |
9 | #any later version. | |
10 | ||
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. | |
15 | ||
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. | |
19 | ||
bf3d2b75 MW |
20 | srcdir = . |
21 | prefix = /usr/local | |
099c286e | 22 | program_transform_name = |
bf3d2b75 MW |
23 | |
24 | exec_prefix = $(prefix) | |
25 | bindir = $(exec_prefix)/bin | |
26 | libdir = $(exec_prefix)/lib | |
27 | tooldir = $(libdir)/$(target_alias) | |
28 | ||
ebc0f582 | 29 | datadir = $(exec_prefix)/lib/dejagnu |
bf3d2b75 MW |
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) | |
45 | ||
46 | SHELL = /bin/sh | |
47 | ||
48 | INSTALL = install -c | |
49 | INSTALL_PROGRAM = $(INSTALL) | |
50 | INSTALL_DATA = $(INSTALL) | |
51 | ||
bf3d2b75 | 52 | CFLAGS = -g |
4d2ad0a8 | 53 | # start-sanitize-chill |
bf3d2b75 | 54 | CHILLFLAGS = $(CFLAGS) |
4d2ad0a8 | 55 | # end-sanitize-chill |
099c286e BC |
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. | |
59 | CXXFLAGS = -g -O | |
bf3d2b75 MW |
60 | |
61 | LINK= ln -s | |
62 | SUBDIRS= | |
4d2ad0a8 | 63 | RUNTEST = runtest |
29aa49d4 | 64 | RUNTESTFLAGS = |
bf3d2b75 | 65 | |
099c286e BC |
66 | EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \ |
67 | echo $${rootme}/../../expect/expect ; \ | |
68 | else echo expect ; fi` | |
69 | ||
099c286e BC |
70 | RUNTEST_FOR_TARGET = ` \ |
71 | if [ -f $${rootme}/../../dejagnu/site.exp ] ; then \ | |
72 | echo $${rootme}/../../dejagnu/runtest ; \ | |
bf3d2b75 MW |
73 | else \ |
74 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ | |
099c286e BC |
75 | echo $(RUNTEST); \ |
76 | else \ | |
77 | t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \ | |
78 | fi; \ | |
79 | fi` | |
80 | ||
81 | CC_FOR_TARGET = ` \ | |
82 | if [ -f $${rootme}/../../gcc/xgcc ] ; then \ | |
83 | echo $${rootme}/../../gcc/xgcc -B$${rootme}/../../gcc/; \ | |
84 | else \ | |
85 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ | |
86 | echo $(CC); \ | |
bf3d2b75 MW |
87 | else \ |
88 | t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \ | |
89 | fi; \ | |
90 | fi` | |
91 | ||
099c286e BC |
92 | CXX = gcc |
93 | CXX_FOR_TARGET = ` \ | |
94 | if [ -f $${rootme}/../../gcc/xgcc ] ; then \ | |
95 | echo $${rootme}/../../gcc/xgcc -B$${rootme}/../../gcc/; \ | |
bf3d2b75 MW |
96 | else \ |
97 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ | |
099c286e | 98 | echo $(CXX); \ |
bf3d2b75 MW |
99 | else \ |
100 | t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \ | |
101 | fi; \ | |
102 | fi` | |
bf3d2b75 | 103 | |
4d2ad0a8 | 104 | # start-sanitize-chill |
099c286e BC |
105 | CHILLFLAGS = $(CFLAGS) |
106 | CHILL = gcc | |
107 | CHILL_FOR_TARGET = ` \ | |
0b9158e6 PB |
108 | if [ -f $${rootme}/../../gcc/Makefile ] ; then \ |
109 | echo $${rootme}/../../gcc/xgcc -B$${rootme}../../gcc/; \ | |
099c286e BC |
110 | else \ |
111 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ | |
0b9158e6 | 112 | echo gcc; \ |
099c286e BC |
113 | else \ |
114 | t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \ | |
115 | fi; \ | |
116 | fi` | |
0b9158e6 | 117 | CHILL = $(CHILL_FOR_TARGET) |
099c286e | 118 | |
0b9158e6 PB |
119 | CHILL_LIB = ` \ |
120 | if [ -f $${rootme}/../../gcc/ch/runtime/libchill.a ] ; then \ | |
121 | echo $${rootme}/../../gcc/ch/runtime/chillrt0.o \ | |
122 | $${rootme}/../../gcc/ch/runtime/libchill.a; \ | |
bf3d2b75 | 123 | else \ |
0b9158e6 | 124 | echo -lchill; \ |
bf3d2b75 | 125 | fi` |
4d2ad0a8 | 126 | # end-sanitize-chill |
bf3d2b75 | 127 | |
d27960e7 | 128 | GDB = ` \ |
a1092b5d RS |
129 | if [ -f $${rootme}/../gdb ] ; \ |
130 | then echo $${rootme}|sed -e 's@/[^/]*$$@@'|sed -e 's@$$@/gdb@' ; \ | |
131 | else echo gdb; \ | |
d27960e7 RS |
132 | fi` |
133 | ||
a1092b5d | 134 | GDBFLAGS = -nx |
bf3d2b75 | 135 | |
bf3d2b75 MW |
136 | #### host, target, and site specific Makefile frags come in here. |
137 | ||
099c286e BC |
138 | # The use of $$(x_FOR_TARGET) reduces the command line length by not |
139 | # duplicating the lengthy definition. | |
140 | TARGET_FLAGS_TO_PASS = \ | |
141 | "prefix=$(prefix)" \ | |
142 | "exec_prefix=$(exec_prefix)" \ | |
143 | "against=$(against)" \ | |
144 | 'CC=$$(CC_FOR_TARGET)' \ | |
145 | "CC_FOR_TARGET=$(CC_FOR_TARGET)" \ | |
146 | "CFLAGS=$(CFLAGS)" \ | |
06f98d49 | 147 | $(start-sanitize-chill) \ |
099c286e BC |
148 | "CHILLFLAGS=$(CHILLFLAGS)" \ |
149 | 'CHILL=$$(CHILL_FOR_TARGET)' \ | |
150 | "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \ | |
151 | "CHILL_LIB=$(CHILL_LIB)" \ | |
06f98d49 | 152 | $(end-sanitize-chill) \ |
099c286e BC |
153 | 'CXX=$$(CXX_FOR_TARGET)' \ |
154 | "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \ | |
155 | "CXXFLAGS=$(CXXFLAGS)" \ | |
156 | "MAKEINFO=$(MAKEINFO)" \ | |
157 | "INSTALL=$(INSTALL)" \ | |
158 | "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ | |
159 | "INSTALL_DATA=$(INSTALL_DATA)" \ | |
160 | "LDFLAGS=$(LDFLAGS)" \ | |
161 | "LIBS=$(LIBS)" \ | |
162 | "RUNTEST=$(RUNTEST)" \ | |
163 | "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ | |
164 | "BISON=$(BISON)" | |
bf3d2b75 MW |
165 | |
166 | all: subdirs | |
167 | ||
168 | .NOEXPORT: | |
169 | INFODIRS=doc | |
170 | info: | |
bf3d2b75 | 171 | install-info: |
21ce979a | 172 | dvi: |
bf3d2b75 MW |
173 | |
174 | install: | |
bf3d2b75 MW |
175 | |
176 | uninstall: force | |
bf3d2b75 | 177 | |
cc49ffa0 | 178 | site.exp: ./config.status Makefile |
1ee369e8 RS |
179 | @echo "Making a new config file..." |
180 | -@rm -f ./tmp? | |
181 | @touch site.exp | |
182 | -@mv site.exp site.bak | |
183 | @echo "## these variables are automatically generated by make ##" > ./tmp0 | |
184 | @echo "# Do not edit here. If you wish to override these values" >> ./tmp0 | |
185 | @echo "# add them to the last section" >> ./tmp0 | |
a1092b5d | 186 | @echo "set GDBFLAGS \"${GDBFLAGS}\"" >> ./tmp0 |
90fba5fa BC |
187 | @echo "set host_os ${host_os}" >> ./tmp0 |
188 | @echo "set host_alias ${host_alias}" >> ./tmp0 | |
189 | @echo "set host_cpu ${host_cpu}" >> ./tmp0 | |
190 | @echo "set host_vendor ${host_vendor}" >> ./tmp0 | |
191 | @echo "set target_os ${target_os}" >> ./tmp0 | |
192 | @echo "set target_alias ${target_alias}" >> ./tmp0 | |
193 | @echo "set target_cpu ${target_cpu}" >> ./tmp0 | |
194 | @echo "set target_vendor ${target_vendor}" >> ./tmp0 | |
cc49ffa0 RS |
195 | @echo "set host_triplet ${host_canonical}" >> ./tmp0 |
196 | @echo "set target_triplet ${target_canonical}" >> ./tmp0 | |
1ee369e8 | 197 | @echo "set srcdir ${srcdir}" >> ./tmp0 |
90fba5fa | 198 | @echo "set objdir `pwd`" >> ./tmp0 |
cc49ffa0 | 199 | @echo "set tool gdb" >> ./tmp0 |
1ee369e8 RS |
200 | @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0 |
201 | @cat ./tmp0 > site.exp | |
202 | @cat site.bak | sed \ | |
203 | -e '1,/^## All variables above are.*##/ d' >> site.exp | |
cc49ffa0 | 204 | -@rm -f ./tmp? |
1ee369e8 | 205 | |
21ce979a | 206 | installcheck: |
ab8603ea RP |
207 | check: site.exp all just-check |
208 | just-check: | |
d27960e7 | 209 | rootme=`pwd`; export rootme; \ |
099c286e BC |
210 | srcdir=${srcdir} ; export srcdir ; \ |
211 | EXPECT=${EXPECT} ; export EXPECT ; \ | |
212 | if [ -f $${rootme}/../../expect/expect ] ; then \ | |
213 | TCL_LIBRARY=$${srcdir}/../../tcl/library ; \ | |
214 | export TCL_LIBRARY ; fi ; \ | |
215 | $(RUNTEST_FOR_TARGET) $(RUNTESTFLAGS) --tool gdb GDB=$(GDB) --srcdir $(srcdir) | |
29aa49d4 | 216 | |
bf3d2b75 MW |
217 | subdir_do: force |
218 | @for i in $(DODIRS); do \ | |
219 | if [ -d ./$$i ] ; then \ | |
220 | if (rootme=`pwd`/ ; export rootme ; \ | |
221 | rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \ | |
222 | cd ./$$i; \ | |
099c286e | 223 | $(MAKE) $(TARGET_FLAGS_TO_PASS) $(DO)) ; then true ; \ |
bf3d2b75 MW |
224 | else exit 1 ; fi ; \ |
225 | else true ; fi ; \ | |
226 | done | |
29aa49d4 RS |
227 | |
228 | force:; | |
bf3d2b75 MW |
229 | |
230 | ||
231 | subdirs: | |
232 | for dir in ${SUBDIRS}; \ | |
233 | do \ | |
234 | echo "$$dir:"; \ | |
235 | if [ -d $$dir ]; then \ | |
236 | (rootme=`pwd`/ ; export rootme ; \ | |
237 | rootsrc=`cd $(srcdir); pwd`/ ; export rootsrc ; \ | |
099c286e | 238 | cd $$dir; $(MAKE) $(TARGET_FLAGS_TO_PASS)); \ |
bf3d2b75 MW |
239 | fi; \ |
240 | done | |
241 | ||
29aa49d4 | 242 | clean mostlyclean: |
bf3d2b75 | 243 | -rm -f *~ core *.o a.out xgdb *.x |
29aa49d4 RS |
244 | for dir in ${SUBDIRS}; \ |
245 | do \ | |
246 | echo "$$dir:"; \ | |
247 | if [ -d $$dir ]; then \ | |
248 | (cd $$dir; $(MAKE) clean); \ | |
249 | fi; \ | |
250 | done | |
251 | ||
252 | distclean realclean: clean | |
099c286e | 253 | -rm -f *~ core *.log *.plog *.sum *.psum site.* |
bf3d2b75 | 254 | -rm -f Makefile config.status *-init.exp |
285ae57a | 255 | -rm -fr *.log summary detail *.plog *.sum *.psum site.* |
29aa49d4 RS |
256 | for dir in ${SUBDIRS}; \ |
257 | do \ | |
258 | echo "$$dir:"; \ | |
259 | (cd $$dir; $(MAKE) distclean); \ | |
260 | done | |
bf3d2b75 | 261 | |
ab8603ea | 262 | Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in $(host_makefile_frag) $(target_makefile_frag) |
bf3d2b75 | 263 | $(SHELL) ./config.status |