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