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