1 # Makefile for the base tests for GDB.
2 # Copyright (C) 1992, 1993, 1994, 1995 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; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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; \
87 #### host, target, and site specific Makefile frags come in here.
116 # List of test executables that we have available. They are kept in
117 # uuencoded format to avoid SCCS/RCS problems with binary files.
119 CROSS_EXECUTABLES = \
130 $(CC) -c $(CFLAGS) $<
131 $(CC) -E $(CFLAGS) $(srcdir)/compiler.c >$*.tmp
137 $(CC) $(CFLAGS) $(LDFLAGS) -o run run.o $(LIBS)
140 $(CC) $(CFLAGS) $(LDFLAGS) -o whatis whatis.o $(LIBS)
145 $(CC) $(CFLAGS) $(LDFLAGS) -o ptype ptype.o $(LIBS)
148 $(CC) $(CFLAGS) $(LDFLAGS) -o setvar setvar.o $(LIBS)
151 $(CC) $(CFLAGS) $(LDFLAGS) -o exprs exprs.o $(LIBS)
154 $(CC) $(CFLAGS) $(LDFLAGS) -o break break.o $(LIBS)
157 $(CC) $(CFLAGS) $(LDFLAGS) -o signals signals.o $(LIBS)
160 $(CC) $(CFLAGS) $(LDFLAGS) -o sigall sigall.o $(LIBS)
163 echo '#include "twice.c"' >twice-tmp.c
164 $(CC) $(CFLAGS) $(LDFLAGS) -I$(srcdir) -o twice twice-tmp.c $(LIBS)
167 watchpoint: watchpoint.o
168 $(CC) $(CFLAGS) $(LDFLAGS) -o watchpoint watchpoint.o $(LIBS)
171 $(CC) $(CFLAGS) $(LDFLAGS) -o recurse recurse.o $(LIBS)
173 opaque: opaque0.o opaque1.o
174 $(CC) $(CFLAGS) $(LDFLAGS) -o opaque opaque0.o opaque1.o $(LIBS)
176 coremaker: coremaker.o
177 $(CC) $(CFLAGS) $(LDFLAGS) -o coremaker coremaker.o $(LIBS)
180 $(CC) $(LDFLAGS) $(NODEBUG_FLAGS) -o nodebug nodebug.o $(LIBS)
182 # This gets compiled *without* -g, so don't add CFLAGS here.
185 $(CC) -c $(srcdir)/nodebug.c
187 # For VPATH and Sun Make, we have to make explicit dependencies.
188 # DEC make doesn't seem to understand the ".u" dependency w/VPATH either.
190 m68k-elf: $(srcdir)/m68k-elf.u
191 uudecode $(srcdir)/m68k-elf.u
193 m68k-aout: $(srcdir)/m68k-aout.u
194 uudecode $(srcdir)/m68k-aout.u
196 m68k-aout2: $(srcdir)/m68k-aout2.u
197 uudecode $(srcdir)/m68k-aout2.u
199 mips-ecoff: $(srcdir)/mips-ecoff.u
200 uudecode $(srcdir)/mips-ecoff.u
202 i486-elf: $(srcdir)/i486-elf.u
203 uudecode $(srcdir)/i486-elf.u
205 sparc-aout: $(srcdir)/sparc-aout.u
206 uudecode $(srcdir)/sparc-aout.u
208 i860-elf: $(srcdir)/i860-elf.u
209 uudecode $(srcdir)/i860-elf.u
211 sparc-elf: $(srcdir)/sparc-elf.u
212 uudecode $(srcdir)/sparc-elf.u
214 list: list0.o list1.o
215 $(CC) $(CFLAGS) $(LDFLAGS) -o list list0.o list1.o $(LIBS)
217 scope: scope0.o scope1.o
218 $(CC) $(CFLAGS) $(LDFLAGS) -o scope scope0.o scope1.o $(LIBS)
220 langs: langs0.o langs1.o langs2.o
221 $(CC) $(CFLAGS) $(LDFLAGS) -o langs langs0.o langs1.o langs2.o $(LIBS)
223 bitfields: bitfields.o
224 $(CC) $(CFLAGS) $(LDFLAGS) -o bitfields.tmp bitfields.o $(LIBS)
225 mv bitfields.tmp bitfields
230 $(CC) $(CFLAGS) $(LDFLAGS) -o funcargs funcargs.o $(LIBS)
233 $(CC) $(CFLAGS) $(LDFLAGS) -o return return.o $(LIBS)
236 $(CC) $(CFLAGS) $(LDFLAGS) -o mips_pro mips_pro.o $(LIBS)
238 printcmds: printcmds.o
239 $(CC) $(CFLAGS) $(LDFLAGS) -o printcmds printcmds.o $(LIBS)
241 # Try compiling this with prototypes, if that fails maybe the compiler
242 # is a pre-ANSI compiler, in which case don't use prototypes.
243 callfuncs.o: callfuncs.c
244 (echo set prototypes 1 >callfuncs.tmp; \
245 $(CC) -c $(CFLAGS) $(srcdir)/callfuncs.c 2>/dev/null) \
246 || (echo set prototypes 0 >callfuncs.tmp; \
247 $(CC) -c $(CFLAGS) -DNO_PROTOTYPES $(srcdir)/callfuncs.c)
248 $(CC) $(CFLAGS) -E $(srcdir)/compiler.c >>callfuncs.tmp
249 mv callfuncs.tmp callfuncs.ci
251 callfuncs: callfuncs.o
252 $(CC) $(CFLAGS) $(LDFLAGS) -o callfuncs callfuncs.o $(LIBS)
254 interrupt: interrupt.o
255 $(CC) $(CFLAGS) $(LDFLAGS) -o interrupt interrupt.o $(LIBS)
271 site.exp: ./config.status Makefile
272 @echo "Making a new config file..."
275 -@mv site.exp site.bak
276 @echo "## these variables are automatically generated by make ##" > ./tmp0
277 @echo "# Do not edit here. If you wish to override these values" >> ./tmp0
278 @echo "# add them to the last section" >> ./tmp0
279 @echo "set host_triplet ${host_canonical}" >> ./tmp0
280 @echo "set target_triplet ${target_canonical}" >> ./tmp0
281 @echo "set srcdir ${srcdir}" >> ./tmp0
282 @echo "set objdir `pwd`" >> ./tmp0
283 @echo "set tool gdb" >> ./tmp0
284 @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
285 @cat ./tmp0 > site.exp
286 @cat site.bak | sed \
287 -e '1,/^## All variables above are.*##/ d' >> site.exp
291 check: site.exp all just-check
293 rootme=`pwd`; export rootme; \
294 srcdir=${srcdir} ; export srcdir ; \
295 EXPECT=${EXPECT} ; export EXPECT ; \
296 if [ -f $${rootme}/../../expect/expect ] ; then \
297 TCL_LIBRARY=$${srcdir}/../../tcl/library ; \
298 export TCL_LIBRARY ; fi ; \
299 $(RUNTEST) $(RUNTESTFLAGS) --tool gdb --srcdir $(srcdir)
302 -rm -f *~ *.o a.out xgdb *.x $(EXECUTABLES) *.ci *.tmp
303 -rm -f core core.coremaker coremaker.core corefile
305 distclean realclean: clean
306 -rm -f *~ core *.log *.plog *.sum *.psum site.*
307 -rm -f Makefile config.status *-init.exp
308 -rm -fr *.log summary detail *.plog *.sum *.psum site.*
310 Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in $(host_makefile_frag) $(target_makefile_frag)
311 $(SHELL) ./config.status