c48cfc07e2a12aa382794b7c130b395c8cb95886
[binutils-gdb.git] / gdb / testsuite / gdb.base / Makefile.in
1 # Makefile for the base tests for GDB.
2 # Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
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 this program; see the file COPYING. If not, write to
18 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19
20 srcdir = .
21 prefix = /usr/local
22 program_transform_name =
23
24 exec_prefix = $(prefix)
25 bindir = $(exec_prefix)/bin
26 libdir = $(exec_prefix)/lib
27 tooldir = $(libdir)/$(target_alias)
28
29 datadir = $(exec_prefix)/lib/dejagnu
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
52 CFLAGS = -g
53
54 RUNTESTFLAGS =
55
56 LINK= ln -s
57
58 EXPECT = ` \
59 if [ -f $${rootme}/../../../expect/expect ] ; then \
60 echo $${rootme}/../../../expect/expect ; \
61 else \
62 echo expect ; \
63 fi`
64
65 RUNTEST = ` \
66 if [ -f $${rootme}/../../dejagnu/site.exp ] ; then \
67 echo $${rootme}/../../dejagnu/runtest ; \
68 else \
69 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
70 echo runtest; \
71 else \
72 t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \
73 fi; \
74 fi`
75
76 CC = ` \
77 if [ -f $${rootme}/../../../gcc/xgcc ] ; then \
78 echo $${rootme}/../../../gcc/xgcc -B$${rootme}/../../../gcc/; \
79 else \
80 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
81 echo gcc; \
82 else \
83 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
84 fi; \
85 fi`
86
87
88 GDB = ` \
89 if [ -f $${rootme}/../../gdb ] ; then \
90 echo $${rootme}/../../gdb ; \
91 else \
92 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
93 echo gdb; \
94 else \
95 t='$(program_transform_name)'; echo gdb | sed -e '' $$t; \
96 fi; \
97 fi`
98
99 GDBFLAGS = -nx
100
101 #### host, target, and site specific Makefile frags come in here.
102
103 EXECUTABLES = \
104 bitfields \
105 break \
106 callfuncs \
107 coremaker \
108 exprs \
109 funcargs \
110 interrupt \
111 langs \
112 list \
113 mips_pro \
114 nodebug \
115 opaque \
116 opaque-info.exp \
117 printcmds \
118 ptype \
119 recurse \
120 return \
121 run \
122 scope \
123 setvar \
124 sigall \
125 signals \
126 twice \
127 watchpoint \
128 whatis \
129 whatis-info.exp \
130 $(CROSS_EXECUTABLES)
131
132 # List of test executables that we have available. They are kept in
133 # uuencoded format to avoid SCCS/RCS problems with binary files.
134
135 CROSS_EXECUTABLES = \
136 i486-elf \
137 i860-elf \
138 m68k-elf \
139 m68k-aout \
140 m68k-aout2 \
141 mips-ecoff \
142 sparc-aout \
143 sparc-elf
144
145 .c.o:
146 $(CC) -c $(CFLAGS) $<
147
148
149 all: $(EXECUTABLES)
150
151 run: run.o
152 $(CC) $(CFLAGS) $(LDFLAGS) -o run run.o $(LIBS)
153
154 # We want to make sure comp-info.exp reflects the way that whatis was compiled;
155 # that's why this isn't a separate rule.
156
157 whatis whatis-info.exp: whatis.o
158 $(CC) $(CFLAGS) $(LDFLAGS) -o whatis.tmp whatis.o $(LIBS)
159 $(CC) $(CFLAGS) -E $(srcdir)/whatis-info.c >whatis-info.tmp
160 mv whatis-info.tmp whatis-info.exp
161 mv whatis.tmp whatis
162
163 .PRECIOUS: whatis whatis-info.exp
164
165 ptype: ptype.o
166 $(CC) $(CFLAGS) $(LDFLAGS) -o ptype ptype.o $(LIBS)
167
168 setvar: setvar.o
169 $(CC) $(CFLAGS) $(LDFLAGS) -o setvar setvar.o $(LIBS)
170
171 exprs: exprs.o
172 $(CC) $(CFLAGS) $(LDFLAGS) -o exprs exprs.o $(LIBS)
173
174 break: break.o
175 $(CC) $(CFLAGS) $(LDFLAGS) -o break break.o $(LIBS)
176
177 signals: signals.o
178 $(CC) $(CFLAGS) $(LDFLAGS) -o signals signals.o $(LIBS)
179
180 sigall: sigall.o
181 $(CC) $(CFLAGS) $(LDFLAGS) -o sigall sigall.o $(LIBS)
182
183 twice: twice.c
184 echo '#include "twice.c"' >twice-tmp.c
185 $(CC) $(CFLAGS) $(LDFLAGS) -I$(srcdir) -o twice twice-tmp.c $(LIBS)
186 rm -f twice-tmp.c
187
188 watchpoint: watchpoint.o
189 $(CC) $(CFLAGS) $(LDFLAGS) -o watchpoint watchpoint.o $(LIBS)
190
191 recurse: recurse.o
192 $(CC) $(CFLAGS) $(LDFLAGS) -o recurse recurse.o $(LIBS)
193
194 # We want to make sure opaque-info.exp reflects the way that opaque
195 # was compiled; that's why this isn't a separate rule.
196
197 opaque opaque-info.exp: opaque0.o opaque1.o
198 $(CC) $(CFLAGS) $(LDFLAGS) -o opaque.tmp opaque0.o opaque1.o $(LIBS)
199 $(CC) $(CFLAGS) -E $(srcdir)/opaque-info.c >opaque-info.tmp
200 mv opaque-info.tmp opaque-info.exp
201 mv opaque.tmp opaque
202
203 coremaker: coremaker.o
204 $(CC) $(CFLAGS) $(LDFLAGS) -o coremaker coremaker.o $(LIBS)
205
206 nodebug: nodebug.o
207 $(CC) $(LDFLAGS) $(NODEBUG_FLAGS) -o nodebug nodebug.o $(LIBS)
208
209 # This gets compiled *without* -g, so don't add CFLAGS here.
210
211 nodebug.o: nodebug.c
212 $(CC) -c $(srcdir)/nodebug.c
213
214 # For VPATH and Sun Make, we have to make explicit dependencies.
215 # DEC make doesn't seem to understand the ".u" dependency w/VPATH either.
216
217 m68k-elf: $(srcdir)/m68k-elf.u
218 uudecode $(srcdir)/m68k-elf.u
219
220 m68k-aout: $(srcdir)/m68k-aout.u
221 uudecode $(srcdir)/m68k-aout.u
222
223 m68k-aout2: $(srcdir)/m68k-aout2.u
224 uudecode $(srcdir)/m68k-aout2.u
225
226 mips-ecoff: $(srcdir)/mips-ecoff.u
227 uudecode $(srcdir)/mips-ecoff.u
228
229 i486-elf: $(srcdir)/i486-elf.u
230 uudecode $(srcdir)/i486-elf.u
231
232 sparc-aout: $(srcdir)/sparc-aout.u
233 uudecode $(srcdir)/sparc-aout.u
234
235 i860-elf: $(srcdir)/i860-elf.u
236 uudecode $(srcdir)/i860-elf.u
237
238 sparc-elf: $(srcdir)/sparc-elf.u
239 uudecode $(srcdir)/sparc-elf.u
240
241 list: list0.o list1.o
242 $(CC) $(CFLAGS) $(LDFLAGS) -o list list0.o list1.o $(LIBS)
243
244 scope: scope0.o scope1.o
245 $(CC) $(CFLAGS) $(LDFLAGS) -o scope scope0.o scope1.o $(LIBS)
246
247 langs: langs0.o langs1.o langs2.o
248 $(CC) $(CFLAGS) $(LDFLAGS) -o langs langs0.o langs1.o langs2.o $(LIBS)
249
250 bitfields: bitfields.o
251 $(CC) $(CFLAGS) $(LDFLAGS) -o bitfields.tmp bitfields.o $(LIBS)
252 mv bitfields.tmp bitfields
253
254 .PRECIOUS: bitfields
255
256 funcargs: funcargs.o
257 $(CC) $(CFLAGS) $(LDFLAGS) -o funcargs funcargs.o $(LIBS)
258
259 return: return.o
260 $(CC) $(CFLAGS) $(LDFLAGS) -o return return.o $(LIBS)
261
262 mips_pro: mips_pro.o
263 $(CC) $(CFLAGS) $(LDFLAGS) -o mips_pro mips_pro.o $(LIBS)
264
265 printcmds: printcmds.o
266 $(CC) $(CFLAGS) $(LDFLAGS) -o printcmds printcmds.o $(LIBS)
267
268 callfuncs: callfuncs.o
269 $(CC) $(CFLAGS) $(LDFLAGS) -o callfuncs callfuncs.o $(LIBS)
270
271 interrupt: interrupt.o
272 $(CC) $(CFLAGS) $(LDFLAGS) -o interrupt interrupt.o $(LIBS)
273
274 .NOEXPORT:
275
276 INFODIRS=doc
277
278 info:
279
280 install-info:
281
282 dvi:
283
284 install:
285
286 uninstall: force
287
288 site.exp: ./config.status Makefile
289 @echo "Making a new config file..."
290 -@rm -f ./tmp?
291 @touch site.exp
292 -@mv site.exp site.bak
293 @echo "## these variables are automatically generated by make ##" > ./tmp0
294 @echo "# Do not edit here. If you wish to override these values" >> ./tmp0
295 @echo "# add them to the last section" >> ./tmp0
296 @echo "set GDBFLAGS \"${GDBFLAGS}\"" >> ./tmp0
297 @echo "set host_triplet ${host_canonical}" >> ./tmp0
298 @echo "set target_triplet ${target_canonical}" >> ./tmp0
299 @echo "set srcdir ${srcdir}" >> ./tmp0
300 @echo "set objdir `pwd`" >> ./tmp0
301 @echo "set tool gdb" >> ./tmp0
302 @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
303 @cat ./tmp0 > site.exp
304 @cat site.bak | sed \
305 -e '1,/^## All variables above are.*##/ d' >> site.exp
306 -@rm -f ./tmp?
307
308 installcheck:
309 check: site.exp all just-check
310 just-check:
311 rootme=`pwd`; export rootme; \
312 srcdir=${srcdir} ; export srcdir ; \
313 EXPECT=${EXPECT} ; export EXPECT ; \
314 if [ -f $${rootme}/../../expect/expect ] ; then \
315 TCL_LIBRARY=$${srcdir}/../../tcl/library ; \
316 export TCL_LIBRARY ; fi ; \
317 $(RUNTEST) $(RUNTESTFLAGS) --tool gdb GDB=$(GDB) --srcdir $(srcdir)
318
319 clean mostlyclean:
320 -rm -f *~ *.o a.out xgdb *.x $(EXECUTABLES)
321 -rm -f core core.coremaker coremaker.core corefile
322
323 distclean realclean: clean
324 -rm -f *~ core *.log *.plog *.sum *.psum site.*
325 -rm -f Makefile config.status *-init.exp
326 -rm -fr *.log summary detail *.plog *.sum *.psum site.*
327
328 Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in $(host_makefile_frag) $(target_makefile_frag)
329 $(SHELL) ./config.status
330