1 # Makefile for regression testing the GNU debugger.
2 # Copyright (C) 1992, 93, 1994 Free Software Foundation, Inc.
4 # This file is part of GDB.
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)
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.
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.
22 program_transform_name =
24 exec_prefix = $(prefix)
25 bindir = $(exec_prefix)/bin
26 libdir = $(exec_prefix)/lib
27 tooldir = $(libdir)/$(target_alias)
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)
49 INSTALL_PROGRAM = $(INSTALL)
50 INSTALL_DATA = $(INSTALL)
53 # start-sanitize-chill
54 CHILLFLAGS = $(CFLAGS)
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.
65 EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \
66 echo $${rootme}/../../expect/expect ; \
67 else echo expect ; fi`
69 RUNTEST_FOR_TARGET = ` \
70 if [ -f $${rootme}/../../dejagnu/site.exp ] ; then \
71 echo $${rootme}/../../dejagnu/runtest ; \
73 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
76 t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \
83 if [ -f $${rootme}/../../gcc/xgcc ] ; then \
84 echo $${rootme}/../../gcc/xgcc -B$${rootme}/../../gcc/; \
86 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
89 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
93 CFLAGS_FOR_TARGET = $(CFLAGS)
96 if [ -f $${rootme}/../gdb ] ; \
97 then echo $${rootme}|sed -e 's@/[^/]*$$@@'|sed -e 's@$$@/gdb@' ; \
103 #### host, target, and site specific Makefile frags come in here.
133 # List of test executables that we have available. They are kept in
134 # uuencoded format to avoid SCCS/RCS problems with binary files.
136 CROSS_EXECUTABLES = \
146 all: $(EXECUTABLES) corefile
148 CC_CFLAGS_LD_FOR_TARGET = $(CC_FOR_TARGET) $(CFLAGS) $(LDFLAGS_FOR_TARGET)
150 CC_CFLAGS_FOR_TARGET = $(CC_FOR_TARGET) $(CFLAGS_FOR_TARGET)
153 $(CC_CFLAGS_LD_FOR_TARGET) -o run run.o $(LIBS)
156 $(CC_FOR_TARGET) $(CFLAGS) -c $(srcdir)/run.c
158 # We want to make sure comp-info.exp reflects the way that whatis was compiled;
159 # that's why this isn't a separate rule.
161 whatis whatis-info.exp: whatis.o
162 $(CC_CFLAGS_LD_FOR_TARGET) -o whatis.tmp whatis.o $(LIBS)
163 $(CC_FOR_TARGET) $(CFLAGS) -E $(srcdir)/whatis-info.c >whatis-info.tmp
164 mv whatis-info.tmp whatis-info.exp
167 .PRECIOUS: whatis whatis-info.exp
170 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/whatis.c
173 $(CC_CFLAGS_LD_FOR_TARGET) -o ptype ptype.o $(LIBS)
176 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/ptype.c
179 $(CC_CFLAGS_LD_FOR_TARGET) -o setvar setvar.o $(LIBS)
182 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/setvar.c
185 $(CC_CFLAGS_LD_FOR_TARGET) -o exprs exprs.o $(LIBS)
188 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/exprs.c
191 $(CC_CFLAGS_LD_FOR_TARGET) -o break break.o $(LIBS)
194 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/break.c
197 ${CC} ${CFLAGS} ${LDFLAGS_FOR_TARGET} -o signals signals.o ${LIBS}
200 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/signals.c
203 echo '#include "twice.c"' >twice-tmp.c
204 $(CC_CFLAGS_LD_FOR_TARGET) -I$(srcdir) -o twice twice-tmp.c $(LIBS)
207 watchpoint: watchpoint.o
208 $(CC_CFLAGS_LD_FOR_TARGET) -o watchpoint watchpoint.o $(LIBS)
210 watchpoint.o: watchpoint.c
211 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/watchpoint.c
214 $(CC_CFLAGS_LD_FOR_TARGET) -o recurse recurse.o $(LIBS)
217 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/recurse.c
219 # We want to make sure opaque-info.exp reflects the way that opaque
220 # was compiled; that's why this isn't a separate rule.
222 opaque opaque-info.exp: opaque0.o opaque1.o
223 $(CC_CFLAGS_LD_FOR_TARGET) -o opaque.tmp opaque0.o opaque1.o $(LIBS)
224 $(CC_CFLAGS_FOR_TARGET) -E $(srcdir)/opaque-info.c >opaque-info.tmp
225 mv opaque-info.tmp opaque-info.exp
229 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/opaque0.c
232 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/opaque1.c
234 coremaker: coremaker.o
235 $(CC_CFLAGS_LD_FOR_TARGET) -o coremaker coremaker.o $(LIBS)
237 coremaker.o: coremaker.c
238 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/coremaker.c
240 # Create a core file named "corefile" rather than just "core", to
241 # avoid problems with sys admin types that like to regularly prune all
242 # files named "core" from the system.
243 # bsd 386 systems append the name of the program to the corefile name.
247 -echo Expect a coredump from this next command...
248 -./coremaker >/dev/null 2>&1 || true
249 -if [ -f core ]; then mv core corefile; else true; fi
250 -if [ -f core.coremaker ]; then mv core.coremaker corefile; else true; fi
253 $(CC_FOR_TARGET) $(LDFLAGS_FOR_TARGET) -o nodebug nodebug.o $(LIBS)
255 # This gets compiled *without* -g, so don't add CFLAGS here.
258 $(CC_FOR_TARGET) -c $(srcdir)/nodebug.c
260 # For VPATH and Sun Make, we have to make explicit dependencies.
261 # DEC make doesn't seem to understand the ".u" dependency w/VPATH either.
263 m68k-elf: $(srcdir)/m68k-elf.u
264 uudecode $(srcdir)/m68k-elf.u
266 m68k-aout: $(srcdir)/m68k-aout.u
267 uudecode $(srcdir)/m68k-aout.u
269 m68k-aout2: $(srcdir)/m68k-aout2.u
270 uudecode $(srcdir)/m68k-aout2.u
272 mips-ecoff: $(srcdir)/mips-ecoff.u
273 uudecode $(srcdir)/mips-ecoff.u
275 i486-elf: $(srcdir)/i486-elf.u
276 uudecode $(srcdir)/i486-elf.u
278 sparc-aout: $(srcdir)/sparc-aout.u
279 uudecode $(srcdir)/sparc-aout.u
281 i860-elf: $(srcdir)/i860-elf.u
282 uudecode $(srcdir)/i860-elf.u
284 sparc-elf: $(srcdir)/sparc-elf.u
285 uudecode $(srcdir)/sparc-elf.u
288 $(CC_CFLAGS_LD_FOR_TARGET) -o t10 t10.o $(LIBS)
290 list: list0.o list1.o
291 $(CC_CFLAGS_LD_FOR_TARGET) -o list list0.o list1.o $(LIBS)
293 list0.o: list0.c list0.h
294 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/list0.c
297 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/list1.c
299 scope: scope0.o scope1.o
300 $(CC_CFLAGS_LD_FOR_TARGET) -o scope scope0.o scope1.o $(LIBS)
303 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/scope0.c
306 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/scope1.c
308 bitfields: bitfields.o
309 $(CC_CFLAGS_LD_FOR_TARGET) -o bitfields.tmp bitfields.o $(LIBS)
310 mv bitfields.tmp bitfields
314 bitfields.o: bitfields.c
315 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/bitfields.c
318 $(CC_CFLAGS_LD_FOR_TARGET) -o funcargs funcargs.o $(LIBS)
320 funcargs.o: funcargs.c
321 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/funcargs.c
324 $(CC_CFLAGS_LD_FOR_TARGET) -o return return.o $(LIBS)
327 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/return.c
330 $(CC_CFLAGS_LD_FOR_TARGET) -o mips_pro mips_pro.o $(LIBS)
332 mips_pro.o: mips_pro.c
333 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/mips_pro.c
335 printcmds: printcmds.o
336 $(CC_CFLAGS_LD_FOR_TARGET) -o printcmds printcmds.o $(LIBS)
338 printcmds.o: printcmds.c
339 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/printcmds.c
341 callfuncs: callfuncs.o
342 $(CC_CFLAGS_LD_FOR_TARGET) -o callfuncs callfuncs.o $(LIBS)
344 callfuncs.o: callfuncs.c
345 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/callfuncs.c
347 interrupt: interrupt.o
348 $(CC_CFLAGS_LD_FOR_TARGET) -o interrupt interrupt.o $(LIBS)
350 interrupt.o: interrupt.c
351 $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/interrupt.c
363 site.exp: ./config.status Makefile
364 @echo "Making a new config file..."
367 -@mv site.exp site.bak
368 @echo "## these variables are automatically generated by make ##" > ./tmp0
369 @echo "# Do not edit here. If you wish to override these values" >> ./tmp0
370 @echo "# add them to the last section" >> ./tmp0
371 @echo "set GDBFLAGS \"${GDBFLAGS}\"" >> ./tmp0
372 @echo "set host_os ${host_os}" >> ./tmp0
373 @echo "set host_alias ${host_alias}" >> ./tmp0
374 @echo "set host_cpu ${host_cpu}" >> ./tmp0
375 @echo "set host_vendor ${host_vendor}" >> ./tmp0
376 @echo "set target_os ${target_os}" >> ./tmp0
377 @echo "set target_alias ${target_alias}" >> ./tmp0
378 @echo "set target_cpu ${target_cpu}" >> ./tmp0
379 @echo "set target_vendor ${target_vendor}" >> ./tmp0
380 @echo "set host_triplet ${host_canonical}" >> ./tmp0
381 @echo "set target_triplet ${target_canonical}" >> ./tmp0
382 @echo "set srcdir ${srcdir}" >> ./tmp0
383 @echo "set objdir `pwd`" >> ./tmp0
384 @echo "set tool gdb" >> ./tmp0
385 @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
386 @cat ./tmp0 > site.exp
387 @cat site.bak | sed \
388 -e '1,/^## All variables above are.*##/ d' >> site.exp
392 check: site.exp all just-check
394 rootme=`pwd`; export rootme; \
395 srcdir=${srcdir} ; export srcdir ; \
396 EXPECT=${EXPECT} ; export EXPECT ; \
397 if [ -f $${rootme}/../../expect/expect ] ; then \
398 TCL_LIBRARY=$${srcdir}/../../tcl/library ; \
399 export TCL_LIBRARY ; fi ; \
400 $(RUNTEST_FOR_TARGET) $(RUNTESTFLAGS) --tool gdb GDB=$(GDB) --srcdir $(srcdir)
403 -rm -f *~ *.o a.out xgdb *.x $(EXECUTABLES)
404 -rm -f core core.coremaker corefile
406 distclean realclean: clean
407 -rm -f *~ core *.log *.plog *.sum *.psum site.*
408 -rm -f Makefile config.status *-init.exp
409 -rm -fr *.log summary detail *.plog *.sum *.psum site.*
411 Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in $(host_makefile_frag) $(target_makefile_frag)
412 $(SHELL) ./config.status