1 # Makefile for the base tests for GDB.
2 # Copyright (C) 1992, 1993, 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
)
59 if [ -f $${rootme}/../../../expect/expect ] ; then \
60 echo $${rootme}/../../../expect/expect ; \
66 if [ -f $${rootme}/../../dejagnu/site.exp ] ; then \
67 echo $${rootme}/../../dejagnu/runtest ; \
69 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
72 t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \
77 if [ -f $${rootme}/../../../gcc/xgcc ] ; then \
78 echo $${rootme}/../../../gcc/xgcc -B$${rootme}/../../../gcc/; \
80 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
83 t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
89 if [ -f $${rootme}/../../gdb ] ; then \
90 echo $${rootme}/../../gdb ; \
92 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
95 t='$(program_transform_name)'; echo gdb | sed -e '' $$t; \
101 #### host, target, and site specific Makefile frags come in here.
132 # List of test executables that we have available. They are kept in
133 # uuencoded format to avoid SCCS/RCS problems with binary files.
135 CROSS_EXECUTABLES
= \
146 $(CC
) -c
$(CFLAGS
) $<
152 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o run run.o
$(LIBS
)
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.
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
163 .PRECIOUS
: whatis whatis-info.exp
166 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o ptype ptype.o
$(LIBS
)
169 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o setvar setvar.o
$(LIBS
)
172 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o exprs exprs.o
$(LIBS
)
175 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o break break.o
$(LIBS
)
178 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o signals signals.o
$(LIBS
)
181 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o sigall sigall.o
$(LIBS
)
184 echo
'#include "twice.c"' >twice-tmp.c
185 $(CC
) $(CFLAGS
) $(LDFLAGS
) -I
$(srcdir) -o twice twice-tmp.c
$(LIBS
)
188 watchpoint
: watchpoint.o
189 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o watchpoint watchpoint.o
$(LIBS
)
192 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o recurse recurse.o
$(LIBS
)
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.
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
203 coremaker
: coremaker.o
204 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o coremaker coremaker.o
$(LIBS
)
207 $(CC
) $(LDFLAGS
) $(NODEBUG_FLAGS
) -o nodebug nodebug.o
$(LIBS
)
209 # This gets compiled *without* -g, so don't add CFLAGS here.
212 $(CC
) -c
$(srcdir)/nodebug.c
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.
217 m68k-elf
: $(srcdir)/m68k-elf.u
218 uudecode
$(srcdir)/m68k-elf.u
220 m68k-aout
: $(srcdir)/m68k-aout.u
221 uudecode
$(srcdir)/m68k-aout.u
223 m68k-aout2
: $(srcdir)/m68k-aout2.u
224 uudecode
$(srcdir)/m68k-aout2.u
226 mips-ecoff
: $(srcdir)/mips-ecoff.u
227 uudecode
$(srcdir)/mips-ecoff.u
229 i486-elf
: $(srcdir)/i486-elf.u
230 uudecode
$(srcdir)/i486-elf.u
232 sparc-aout
: $(srcdir)/sparc-aout.u
233 uudecode
$(srcdir)/sparc-aout.u
235 i860-elf
: $(srcdir)/i860-elf.u
236 uudecode
$(srcdir)/i860-elf.u
238 sparc-elf
: $(srcdir)/sparc-elf.u
239 uudecode
$(srcdir)/sparc-elf.u
241 list
: list0.o list1.o
242 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o list list0.o list1.o
$(LIBS
)
244 scope
: scope0.o scope1.o
245 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o scope scope0.o scope1.o
$(LIBS
)
247 langs
: langs0.o langs1.o langs2.o
248 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o langs langs0.o langs1.o langs2.o
$(LIBS
)
250 bitfields
: bitfields.o
251 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o bitfields.tmp bitfields.o
$(LIBS
)
252 mv bitfields.tmp bitfields
257 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o funcargs funcargs.o
$(LIBS
)
260 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o return return.o
$(LIBS
)
263 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o mips_pro mips_pro.o
$(LIBS
)
265 printcmds
: printcmds.o
266 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o printcmds printcmds.o
$(LIBS
)
268 callfuncs
: callfuncs.o
269 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o callfuncs callfuncs.o
$(LIBS
)
271 interrupt
: interrupt.o
272 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o interrupt interrupt.o
$(LIBS
)
288 site.exp
: .
/config.status Makefile
289 @echo
"Making a new config file..."
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
309 check: site.exp
all 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)
320 -rm -f
*~
*.o a.out xgdb
*.x
$(EXECUTABLES
)
321 -rm -f core core.coremaker coremaker.core corefile
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.
*
328 Makefile
: $(srcdir)/Makefile.in
$(srcdir)/configure.in
$(host_makefile_frag
) $(target_makefile_frag
)
329 $(SHELL
) .
/config.status