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