# Makefile for regression testing the GNU debugger. # Copyright (C) 1992, 93, 1994 Free Software Foundation, Inc. # This file is part of GDB. # GDB is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # GDB is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; see the file COPYING. If not, write to # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. srcdir = . prefix = /usr/local program_transform_name = exec_prefix = $(prefix) bindir = $(exec_prefix)/bin libdir = $(exec_prefix)/lib tooldir = $(libdir)/$(target_alias) datadir = $(exec_prefix)/lib/dejagnu mandir = $(prefix)/man man1dir = $(mandir)/man1 man2dir = $(mandir)/man2 man3dir = $(mandir)/man3 man4dir = $(mandir)/man4 man5dir = $(mandir)/man5 man6dir = $(mandir)/man6 man7dir = $(mandir)/man7 man8dir = $(mandir)/man8 man9dir = $(mandir)/man9 infodir = $(prefix)/info includedir = $(prefix)/include gxx_includedir = $(tooldir)/g++-include docdir = $(datadir)/doc targetdir = $(datadir)/$(target_alias) SHELL = /bin/sh INSTALL = install -c INSTALL_PROGRAM = $(INSTALL) INSTALL_DATA = $(INSTALL) CFLAGS = -g # start-sanitize-chill CHILLFLAGS = $(CFLAGS) # end-sanitize-chill # This should probably be consistent with the top-level Makefile.in, # gdb/Makefile.in, and gdb/testsuite/gdb.t2*/Makefile.in, so that "make check" # has the same effect no matter where it is run. CXXFLAGS = -g -O LINK= ln -s RUNTEST = runtest EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \ echo $${rootme}/../../expect/expect ; \ else echo expect ; fi` RUNTEST_FOR_TARGET = ` \ if [ -f $${rootme}/../../dejagnu/site.exp ] ; then \ echo $${rootme}/../../dejagnu/runtest ; \ else \ if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ echo $(RUNTEST); \ else \ t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \ fi; \ fi` RUNTESTFLAGS = CC_FOR_TARGET = ` \ if [ -f $${rootme}/../../gcc/xgcc ] ; then \ echo $${rootme}/../../gcc/xgcc -B$${rootme}/../../gcc/; \ else \ if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ echo $(CC); \ else \ t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \ fi; \ fi` CFLAGS_FOR_TARGET = $(CFLAGS) GDB = ` \ if [ -f $${rootme}/../gdb ] ; \ then echo $${rootme}|sed -e 's@/[^/]*$$@@'|sed -e 's@$$@/gdb@' ; \ else echo gdb; \ fi` GDBFLAGS = -nx #### host, target, and site specific Makefile frags come in here. EXECUTABLES = \ bitfields \ break \ callfuncs \ coremaker \ exprs \ funcargs \ interrupt \ list \ mips_pro \ nodebug \ opaque \ opaque-info.exp \ printcmds \ ptype \ recurse \ return \ run \ scope \ setvar \ signals \ t10 \ twice \ watchpoint \ whatis \ whatis-info.exp \ $(CROSS_EXECUTABLES) # List of test executables that we have available. They are kept in # uuencoded format to avoid SCCS/RCS problems with binary files. CROSS_EXECUTABLES = \ i486-elf \ i860-elf \ m68k-elf \ m68k-aout \ m68k-aout2 \ mips-ecoff \ sparc-aout \ sparc-elf all: $(EXECUTABLES) corefile CC_CFLAGS_LD_FOR_TARGET = $(CC_FOR_TARGET) $(CFLAGS) $(LDFLAGS_FOR_TARGET) CC_CFLAGS_FOR_TARGET = $(CC_FOR_TARGET) $(CFLAGS_FOR_TARGET) run: run.o $(CC_CFLAGS_LD_FOR_TARGET) -o run run.o $(LIBS) run.o: run.c $(CC_FOR_TARGET) $(CFLAGS) -c $(srcdir)/run.c # We want to make sure comp-info.exp reflects the way that whatis was compiled; # that's why this isn't a separate rule. whatis whatis-info.exp: whatis.o $(CC_CFLAGS_LD_FOR_TARGET) -o whatis.tmp whatis.o $(LIBS) $(CC_FOR_TARGET) $(CFLAGS) -E $(srcdir)/whatis-info.c >whatis-info.tmp mv whatis-info.tmp whatis-info.exp mv whatis.tmp whatis .PRECIOUS: whatis whatis-info.exp whatis.o: whatis.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/whatis.c ptype: ptype.o $(CC_CFLAGS_LD_FOR_TARGET) -o ptype ptype.o $(LIBS) ptype.o: ptype.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/ptype.c setvar: setvar.o $(CC_CFLAGS_LD_FOR_TARGET) -o setvar setvar.o $(LIBS) setvar.o: setvar.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/setvar.c exprs: exprs.o $(CC_CFLAGS_LD_FOR_TARGET) -o exprs exprs.o $(LIBS) exprs.o: exprs.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/exprs.c break: break.o $(CC_CFLAGS_LD_FOR_TARGET) -o break break.o $(LIBS) break.o: break.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/break.c signals: signals.o ${CC} ${CFLAGS} ${LDFLAGS_FOR_TARGET} -o signals signals.o ${LIBS} signals.o: signals.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/signals.c twice: twice.c echo '#include "twice.c"' >twice-tmp.c $(CC_CFLAGS_LD_FOR_TARGET) -I$(srcdir) -o twice twice-tmp.c $(LIBS) rm -f twice-tmp.c watchpoint: watchpoint.o $(CC_CFLAGS_LD_FOR_TARGET) -o watchpoint watchpoint.o $(LIBS) watchpoint.o: watchpoint.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/watchpoint.c recurse: recurse.o $(CC_CFLAGS_LD_FOR_TARGET) -o recurse recurse.o $(LIBS) recurse.o: recurse.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/recurse.c # We want to make sure opaque-info.exp reflects the way that opaque # was compiled; that's why this isn't a separate rule. opaque opaque-info.exp: opaque0.o opaque1.o $(CC_CFLAGS_LD_FOR_TARGET) -o opaque.tmp opaque0.o opaque1.o $(LIBS) $(CC_CFLAGS_FOR_TARGET) -E $(srcdir)/opaque-info.c >opaque-info.tmp mv opaque-info.tmp opaque-info.exp mv opaque.tmp opaque opaque0.o: opaque0.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/opaque0.c opaque1.o: opaque1.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/opaque1.c coremaker: coremaker.o $(CC_CFLAGS_LD_FOR_TARGET) -o coremaker coremaker.o $(LIBS) coremaker.o: coremaker.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/coremaker.c # Create a core file named "corefile" rather than just "core", to # avoid problems with sys admin types that like to regularly prune all # files named "core" from the system. # bsd 386 systems append the name of the program to the corefile name. corefile: coremaker -rm -f core -echo Expect a coredump from this next command... -./coremaker >/dev/null 2>&1 || true -if [ -f core ]; then mv core corefile; else true; fi -if [ -f core.coremaker ]; then mv core.coremaker corefile; else true; fi nodebug: nodebug.o $(CC_FOR_TARGET) $(LDFLAGS_FOR_TARGET) -o nodebug nodebug.o $(LIBS) # This gets compiled *without* -g, so don't add CFLAGS here. nodebug.o: nodebug.c $(CC_FOR_TARGET) -c $(srcdir)/nodebug.c # For VPATH and Sun Make, we have to make explicit dependencies. # DEC make doesn't seem to understand the ".u" dependency w/VPATH either. m68k-elf: $(srcdir)/m68k-elf.u uudecode $(srcdir)/m68k-elf.u m68k-aout: $(srcdir)/m68k-aout.u uudecode $(srcdir)/m68k-aout.u m68k-aout2: $(srcdir)/m68k-aout2.u uudecode $(srcdir)/m68k-aout2.u mips-ecoff: $(srcdir)/mips-ecoff.u uudecode $(srcdir)/mips-ecoff.u i486-elf: $(srcdir)/i486-elf.u uudecode $(srcdir)/i486-elf.u sparc-aout: $(srcdir)/sparc-aout.u uudecode $(srcdir)/sparc-aout.u i860-elf: $(srcdir)/i860-elf.u uudecode $(srcdir)/i860-elf.u sparc-elf: $(srcdir)/sparc-elf.u uudecode $(srcdir)/sparc-elf.u t10: t10.o $(CC_CFLAGS_LD_FOR_TARGET) -o t10 t10.o $(LIBS) list: list0.o list1.o $(CC_CFLAGS_LD_FOR_TARGET) -o list list0.o list1.o $(LIBS) list0.o: list0.c list0.h $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/list0.c list1.o: list1.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/list1.c scope: scope0.o scope1.o $(CC_CFLAGS_LD_FOR_TARGET) -o scope scope0.o scope1.o $(LIBS) scope0.o: scope0.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/scope0.c scope1.o: scope1.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/scope1.c bitfields: bitfields.o $(CC_CFLAGS_LD_FOR_TARGET) -o bitfields.tmp bitfields.o $(LIBS) mv bitfields.tmp bitfields .PRECIOUS: bitfields bitfields.o: bitfields.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/bitfields.c funcargs: funcargs.o $(CC_CFLAGS_LD_FOR_TARGET) -o funcargs funcargs.o $(LIBS) funcargs.o: funcargs.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/funcargs.c return: return.o $(CC_CFLAGS_LD_FOR_TARGET) -o return return.o $(LIBS) return.o: return.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/return.c mips_pro: mips_pro.o $(CC_CFLAGS_LD_FOR_TARGET) -o mips_pro mips_pro.o $(LIBS) mips_pro.o: mips_pro.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/mips_pro.c printcmds: printcmds.o $(CC_CFLAGS_LD_FOR_TARGET) -o printcmds printcmds.o $(LIBS) printcmds.o: printcmds.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/printcmds.c callfuncs: callfuncs.o $(CC_CFLAGS_LD_FOR_TARGET) -o callfuncs callfuncs.o $(LIBS) callfuncs.o: callfuncs.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/callfuncs.c interrupt: interrupt.o $(CC_CFLAGS_LD_FOR_TARGET) -o interrupt interrupt.o $(LIBS) interrupt.o: interrupt.c $(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/interrupt.c .NOEXPORT: INFODIRS=doc info: install-info: dvi: install: uninstall: force site.exp: ./config.status Makefile @echo "Making a new config file..." -@rm -f ./tmp? @touch site.exp -@mv site.exp site.bak @echo "## these variables are automatically generated by make ##" > ./tmp0 @echo "# Do not edit here. If you wish to override these values" >> ./tmp0 @echo "# add them to the last section" >> ./tmp0 @echo "set GDBFLAGS \"${GDBFLAGS}\"" >> ./tmp0 @echo "set host_os ${host_os}" >> ./tmp0 @echo "set host_alias ${host_alias}" >> ./tmp0 @echo "set host_cpu ${host_cpu}" >> ./tmp0 @echo "set host_vendor ${host_vendor}" >> ./tmp0 @echo "set target_os ${target_os}" >> ./tmp0 @echo "set target_alias ${target_alias}" >> ./tmp0 @echo "set target_cpu ${target_cpu}" >> ./tmp0 @echo "set target_vendor ${target_vendor}" >> ./tmp0 @echo "set host_triplet ${host_canonical}" >> ./tmp0 @echo "set target_triplet ${target_canonical}" >> ./tmp0 @echo "set srcdir ${srcdir}" >> ./tmp0 @echo "set objdir `pwd`" >> ./tmp0 @echo "set tool gdb" >> ./tmp0 @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0 @cat ./tmp0 > site.exp @cat site.bak | sed \ -e '1,/^## All variables above are.*##/ d' >> site.exp -@rm -f ./tmp? installcheck: check: site.exp all just-check just-check: rootme=`pwd`; export rootme; \ srcdir=${srcdir} ; export srcdir ; \ EXPECT=${EXPECT} ; export EXPECT ; \ if [ -f $${rootme}/../../expect/expect ] ; then \ TCL_LIBRARY=$${srcdir}/../../tcl/library ; \ export TCL_LIBRARY ; fi ; \ $(RUNTEST_FOR_TARGET) $(RUNTESTFLAGS) --tool gdb GDB=$(GDB) --srcdir $(srcdir) clean mostlyclean: -rm -f *~ *.o a.out xgdb *.x $(EXECUTABLES) -rm -f core core.coremaker corefile distclean realclean: clean -rm -f *~ core *.log *.plog *.sum *.psum site.* -rm -f Makefile config.status *-init.exp -rm -fr *.log summary detail *.plog *.sum *.psum site.* Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in $(host_makefile_frag) $(target_makefile_frag) $(SHELL) ./config.status