BSD-style build infrastructure for gdb-4.16

(Will replace ../gdb later on.)
This commit is contained in:
gwr 1997-09-26 04:37:02 +00:00
parent 7b31453c6f
commit 7000546255
20 changed files with 575 additions and 0 deletions

10
gnu/usr.bin/gdb/_i386.mk Normal file
View File

@ -0,0 +1,10 @@
# $NetBSD: _i386.mk,v 1.1.1.1 1997/09/26 04:37:02 gwr Exp $
# From gdb/config/i386/nbsd.mh
NM_FILE= config/i386/nm-nbsd.h
NDEP_FILES= i386nbsd-nat.o
# From gdb/config/i386/nbsd.mt
TM_FILE= config/i386/tm-nbsd.h
TDEP_FILES= i386-tdep.o i387-tdep.o solib.o

10
gnu/usr.bin/gdb/_m68k.mk Normal file
View File

@ -0,0 +1,10 @@
# $NetBSD: _m68k.mk,v 1.1.1.1 1997/09/26 04:37:02 gwr Exp $
# From gdb/config/m68k/nbsd.mh
NM_FILE= config/m68k/nm-nbsd.h
NDEP_FILES= m68knbsd-nat.o
# From gdb/config/m68k/nbsd.mt
TM_FILE= config/m68k/tm-nbsd.h
TDEP_FILES= m68k-tdep.o solib.o

10
gnu/usr.bin/gdb/_ns32k.mk Normal file
View File

@ -0,0 +1,10 @@
# $NetBSD: _ns32k.mk,v 1.1.1.1 1997/09/26 04:37:02 gwr Exp $
# gdb/config/ns32k/nbsd.mh
NM_FILE= config/ns32k/nm-nbsd.h
NDEP_FILES= ns32knbsd-nat.o
# gdb/config/ns32k/nbsd.mt
TM_FILE= config/ns32k/tm-nbsd.h
TDEP_FILES= ns32k-tdep.o solib.o

10
gnu/usr.bin/gdb/_sparc.mk Normal file
View File

@ -0,0 +1,10 @@
# $NetBSD: _sparc.mk,v 1.1.1.1 1997/09/26 04:37:02 gwr Exp $
# From gdb/config/sparc/nbsd.mh
NM_FILE= config/sparc/nm-nbsd.h
NDEP_FILES= sparcnbsd-nat.o
# From gdb/config/sparc/nbsd.mt
TM_FILE= config/sparc/tm-nbsd.h
TDEP_FILES= sparc-tdep.o solib.o

10
gnu/usr.bin/gdb/_vax.mk Normal file
View File

@ -0,0 +1,10 @@
# $NetBSD: _vax.mk,v 1.1.1.1 1997/09/26 04:37:02 gwr Exp $
# From gdb/config/vax/nbsd.mh
NM_FILE= config/vax/nm-nbsd.h
NDEP_FILES= vaxnbsd-nat.o
# From gdb/config/vax/nbsd.mt
TM_FILE= config/vax/tm-nbsd.h
TDEP_FILES= vax-tdep.o solib.o

91
gnu/usr.bin/gdb/config.h Normal file
View File

@ -0,0 +1,91 @@
/* config.h. Generated automatically by configure. */
/* config.in. Generated automatically from configure.in by autoheader. */
/* Define if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
/* #undef _ALL_SOURCE */
#endif
/* Define if the `long double' type works. */
#define HAVE_LONG_DOUBLE 1
/* Define if you have a working `mmap' system call. */
#define HAVE_MMAP 1
/* Define if on MINIX. */
/* #undef _MINIX */
/* Define if the system does not provide POSIX.1 features except
with this defined. */
/* #undef _POSIX_1_SOURCE */
/* Define if you need to in order for stat and other things to work. */
/* #undef _POSIX_SOURCE */
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
/* #undef STAT_MACROS_BROKEN */
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define if fpregset_t type is available. */
/* #undef HAVE_FPREGSET_T */
/* Define if gregset_t type is available. */
/* #undef HAVE_GREGSET_T */
/* Define if the "%Lg" format works to print long doubles. */
#define PRINTF_HAS_LONG_DOUBLE 1
/* Define if you have the getpagesize function. */
#define HAVE_GETPAGESIZE 1
/* Define if you have the sbrk function. */
#define HAVE_SBRK 1
/* Define if you have the setpgid function. */
#define HAVE_SETPGID 1
/* Define if you have the valloc function. */
#define HAVE_VALLOC 1
/* Define if you have the <endian.h> header file. */
/* #undef HAVE_ENDIAN_H */
/* Define if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define if you have the <link.h> header file. */
#define HAVE_LINK_H 1
/* Define if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define if you have the <sgtty.h> header file. */
#define HAVE_SGTTY_H 1
/* Define if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1
/* Define if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define if you have the <sys/procfs.h> header file. */
/* #undef HAVE_SYS_PROCFS_H */
/* Define if you have the <termio.h> header file. */
/* #undef HAVE_TERMIO_H */
/* Define if you have the <termios.h> header file. */
#define HAVE_TERMIOS_H 1
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define if you have the dl library (-ldl). */
/* #undef HAVE_LIBDL */

46
gnu/usr.bin/gdb/mkinit.sh Normal file
View File

@ -0,0 +1,46 @@
#!/bin/sh
#
# $NetBSD: mkinit.sh,v 1.1.1.1 1997/09/26 04:37:02 gwr Exp $
#
# Generate the init.c file on stdout.
# Arguments are names of *.o files.
# Run awk on the (edited) output of nm, i.e:
# 00000000 T _initialize_xxxx
# and turn it into a list of function calls.
# Which awk do we use? (awk,gawk,nawk?)
awk=${AWK:-awk}
# Does the compiler prepend an underscore?
if (nm version.o |grep -q ' _version')
then
sedarg='s/ _/ /'
else
sedarg=
fi
# echo "mkinit.sh: sedarg=$sedarg" >&2
echo '/* Do not modify this file. */'
echo '/* It is created automatically by the Makefile. */'
echo 'void initialize_all_files () {'
for f
do
nm -p $f
done |
sed -e "$sedarg" |
$awk '
function doit(str) {
printf(" {extern void %s (); %s ();}\n", str, str);
}
/ T _initialize_/ {
doit($3);
next;
}
{ next; }
'
echo '}'
exit 0

View File

@ -0,0 +1,5 @@
/* $NetBSD: version.c,v 1.1.1.1 1997/09/26 04:37:02 gwr Exp $ */
char *version = "4.16";
char *host_name = HOST_NAME;
char *target_name = TARGET_NAME;

3
gnu/usr.bin/gdb/xm.h Normal file
View File

@ -0,0 +1,3 @@
/* $NetBSD: xm.h,v 1.1.1.1 1997/09/26 04:37:02 gwr Exp $ */
#include "xm-nbsd.h"

View File

@ -0,0 +1,23 @@
echo Setting up the environment for debugging gdb.\n
set complaints 1
b fatal
b info_command
commands
silent
return
end
dir ../../dist/gdb
dir ../../dist/readline
dir ../../lib/bfd
dir ../../dist/bfd
dir ../../dist/opcodes
dir ../../dist/libiberty
dir ../../dist/include
set prompt (top-gdb)

162
gnu/usr.bin/gdb416/Makefile Normal file
View File

@ -0,0 +1,162 @@
# $NetBSD: Makefile,v 1.1.1.1 1997/09/26 04:37:02 gwr Exp $
# PROG= gdb # No, this needs custom rules.
# Use <bsd.prog.mk> somehow?
PROGNAME=gdb
TOP= $(.CURDIR)/../..
dist= $(TOP)/dist
srcdir= $(dist)/gdb
.PATH: $(srcdir)
# Override this to build a cross-debugger.
TARGET_ARCH?=$(MACHINE_ARCH)
# Compiler options.
CFLAGS=-g
# Find out where libreadline.a lives.
RL_CURDIR=$(TOP)/lib/readline
RL_OBJDIR!=cd $(RL_CURDIR); $(MAKE) echo_objdir
LIBREADLINE=$(RL_OBJDIR)/libreadline.a
# Note: nm.h, tm.h are in $(.OBJDIR),
# and config.h, xm.h are in $(.CURDIR)
INCLS+= -I$(.OBJDIR) -I$(.CURDIR)
# GDB_CFLAGS
INCLS+= -I$(srcdir) -I$(srcdir)/config
# READLINE_CFLAGS
INCLS+= -I$(dist)/readline
# BFD_CFLAGS: Make sure we get the installed bfd.h
INCLS+= -I$(TOP)/lib/bfd
INCLS+= -I$(dist)/bfd
INCLS+= -I$(dist)/include
# misc. -DHAVE_TERMIOS
# KERNEL_DEBUG no longer used. See ADDITIONAL_OPTIONS*
DEFS= -DNO_MMALLOC
CPPFLAGS= $(INCLS) $(DEFS)
.include "_$(TARGET_ARCH).mk"
# Any NetBSD: (i386 m68k ns32k sparc vax)
NDEP_CMN?= infptrace.o inftarg.o fork-child.o corelow.o kcore-nbsd.o
XDEP_FILES= ser-tcp.o ser-unix.o
REMOTE_OBS = remote.o dcache.o remote-utils.o
DEPFILES = $(TDEP_FILES) $(XDEP_FILES) \
$(NDEP_CMN) $(NDEP_FILES) $(REMOTE_OBS)
YYOBJ= c-exp.tab.o f-exp.tab.o m2-exp.tab.o
# This exists only for easy comparison with the GNU Makefile.
COMMON_OBS = version.o blockframe.o breakpoint.o findvar.o stack.o thread.o \
source.o values.o eval.o valops.o valarith.o valprint.o printcmd.o \
symtab.o symfile.o symmisc.o infcmd.o infrun.o command.o \
expprint.o environ.o gdbtypes.o copying.o $(DEPFILES) \
mem-break.o target.o parse.o language.o $(YYOBJ) buildsym.o \
exec.o bcache.o objfiles.o minsyms.o maint.o demangle.o \
dbxread.o coffread.o elfread.o \
dwarfread.o mipsread.o stabsread.o corefile.o \
c-lang.o ch-exp.o ch-lang.o f-lang.o m2-lang.o \
scm-exp.o scm-lang.o scm-valprint.o complaints.o typeprint.o \
c-typeprint.o ch-typeprint.o f-typeprint.o m2-typeprint.o \
c-valprint.o cp-valprint.o ch-valprint.o f-valprint.o m2-valprint.o \
nlmread.o serial.o mdebugread.o os9kread.o top.o utils.o callback.o
OBJS = main.o $(COMMON_OBS) annotate.o inflow.o gnu-regex.o
LDADD+= $(LIBREADLINE)
DPADD+= $(LIBREADLINE)
LDADD+= -lbfd
DPADD+= ${DESTDIR}/usr/lib/libbfd.a
LDADD+= -lkvm
DPADD+= $(LIBKVM)
LDADD+= -ltermcap
DPADD+= $(LIBTERMCAP)
# Note custom rules - did NOT set PROG
all: gdb
.include <bsd.prog.mk>
CLEANFILES+= init.c init.o
gdb : $(OBJS) $(DPADD)
-rm -f init.c
sh $(.CURDIR)/mkinit.sh $(OBJS) > init.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c init.c
$(CC) -o $@ $(OBJS) init.o $(LDADD)
# Need these headers before any objects.
$(OBJS) : nm.h tm.h xm.h
CLEANFILES+= nm.h
nm.h : $(srcdir)/$(NM_FILE)
-rm -f $@
cp -p $(srcdir)/$(NM_FILE) $@
CLEANFILES+= tm.h
tm.h : $(srcdir)/$(TM_FILE)
-rm -f $@
cp -p $(srcdir)/$(TM_FILE) $@
version.o : version.c
$(CC) $(CFLAGS) $(CPPFLAGS) \
-DHOST_NAME=\"$(MACHINE_ARCH)-netbsd\" \
-DTARGET_NAME=\"$(TARGET_ARCH)-netbsd\" \
-c $(.IMPSRC)
CLEANFILES+= c-exp.tab.h c-exp.c
c-exp.c c-exp.tab.h : c-exp.y
${YACC} -d -p c_ -b c-exp $(.IMPSRC)
c-exp.o : c-exp.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c $(.IMPSRC)
CLEANFILES+= f-exp.tab.h f-exp.c
f-exp.c f-exp.tab.h : f-exp.y
${YACC} -d -p f_ -b f-exp $(.IMPSRC)
f-exp.o : f-exp.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c $(.IMPSRC)
CLEANFILES+= m2-exp.tab.h m2-exp.c
m2-exp.c m2-exp.tab.h : m2-exp.y
${YACC} -d -p m2_ -b m2-exp $(.IMPSRC)
m2-exp.o : m2-exp.c
$(CC) $(CFLAGS) $(CPPFLAGS) -c $(.IMPSRC)
clean:
-rm -f gdb
-rm -f $(CLEANFILES)
-rm -f $(OBJS)
DPSRCS = ${OBJS:.o=.c}
depend: .depend
.depend: ${DPSRCS}
${CC} -MM $(CPPFLAGS) ${.ALLSRC} > .depend.tmp
-mv -f .depend.tmp $@
proginstall:: ${DESTDIR}${BINDIR}/${PROGNAME}
.if !defined(UPDATE)
.PHONY: ${DESTDIR}${BINDIR}/${PROGNAME}
.endif
.if !defined(BUILD)
${DESTDIR}${BINDIR}/${PROGNAME}: .MADE
.endif
.PRECIOUS: ${DESTDIR}${BINDIR}/${PROGNAME}
${DESTDIR}${BINDIR}/${PROGNAME}: ${PROGNAME}
${INSTALL} ${COPY} ${STRIPFLAG} -o ${BINOWN} -g ${BINGRP} \
-m ${BINMODE} ${.ALLSRC} ${.TARGET}
.if exists(.depend)
.include ".depend"
.endif

View File

@ -0,0 +1,10 @@
# $NetBSD: _i386.mk,v 1.1.1.1 1997/09/26 04:37:02 gwr Exp $
# From gdb/config/i386/nbsd.mh
NM_FILE= config/i386/nm-nbsd.h
NDEP_FILES= i386nbsd-nat.o
# From gdb/config/i386/nbsd.mt
TM_FILE= config/i386/tm-nbsd.h
TDEP_FILES= i386-tdep.o i387-tdep.o solib.o

View File

@ -0,0 +1,10 @@
# $NetBSD: _m68k.mk,v 1.1.1.1 1997/09/26 04:37:02 gwr Exp $
# From gdb/config/m68k/nbsd.mh
NM_FILE= config/m68k/nm-nbsd.h
NDEP_FILES= m68knbsd-nat.o
# From gdb/config/m68k/nbsd.mt
TM_FILE= config/m68k/tm-nbsd.h
TDEP_FILES= m68k-tdep.o solib.o

View File

@ -0,0 +1,10 @@
# $NetBSD: _ns32k.mk,v 1.1.1.1 1997/09/26 04:37:02 gwr Exp $
# gdb/config/ns32k/nbsd.mh
NM_FILE= config/ns32k/nm-nbsd.h
NDEP_FILES= ns32knbsd-nat.o
# gdb/config/ns32k/nbsd.mt
TM_FILE= config/ns32k/tm-nbsd.h
TDEP_FILES= ns32k-tdep.o solib.o

View File

@ -0,0 +1,10 @@
# $NetBSD: _sparc.mk,v 1.1.1.1 1997/09/26 04:37:02 gwr Exp $
# From gdb/config/sparc/nbsd.mh
NM_FILE= config/sparc/nm-nbsd.h
NDEP_FILES= sparcnbsd-nat.o
# From gdb/config/sparc/nbsd.mt
TM_FILE= config/sparc/tm-nbsd.h
TDEP_FILES= sparc-tdep.o solib.o

View File

@ -0,0 +1,10 @@
# $NetBSD: _vax.mk,v 1.1.1.1 1997/09/26 04:37:02 gwr Exp $
# From gdb/config/vax/nbsd.mh
NM_FILE= config/vax/nm-nbsd.h
NDEP_FILES= vaxnbsd-nat.o
# From gdb/config/vax/nbsd.mt
TM_FILE= config/vax/tm-nbsd.h
TDEP_FILES= vax-tdep.o solib.o

View File

@ -0,0 +1,91 @@
/* config.h. Generated automatically by configure. */
/* config.in. Generated automatically from configure.in by autoheader. */
/* Define if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
#ifndef _ALL_SOURCE
/* #undef _ALL_SOURCE */
#endif
/* Define if the `long double' type works. */
#define HAVE_LONG_DOUBLE 1
/* Define if you have a working `mmap' system call. */
#define HAVE_MMAP 1
/* Define if on MINIX. */
/* #undef _MINIX */
/* Define if the system does not provide POSIX.1 features except
with this defined. */
/* #undef _POSIX_1_SOURCE */
/* Define if you need to in order for stat and other things to work. */
/* #undef _POSIX_SOURCE */
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
/* #undef STAT_MACROS_BROKEN */
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define if fpregset_t type is available. */
/* #undef HAVE_FPREGSET_T */
/* Define if gregset_t type is available. */
/* #undef HAVE_GREGSET_T */
/* Define if the "%Lg" format works to print long doubles. */
#define PRINTF_HAS_LONG_DOUBLE 1
/* Define if you have the getpagesize function. */
#define HAVE_GETPAGESIZE 1
/* Define if you have the sbrk function. */
#define HAVE_SBRK 1
/* Define if you have the setpgid function. */
#define HAVE_SETPGID 1
/* Define if you have the valloc function. */
#define HAVE_VALLOC 1
/* Define if you have the <endian.h> header file. */
/* #undef HAVE_ENDIAN_H */
/* Define if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
/* Define if you have the <link.h> header file. */
#define HAVE_LINK_H 1
/* Define if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define if you have the <sgtty.h> header file. */
#define HAVE_SGTTY_H 1
/* Define if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1
/* Define if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define if you have the <sys/procfs.h> header file. */
/* #undef HAVE_SYS_PROCFS_H */
/* Define if you have the <termio.h> header file. */
/* #undef HAVE_TERMIO_H */
/* Define if you have the <termios.h> header file. */
#define HAVE_TERMIOS_H 1
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define if you have the dl library (-ldl). */
/* #undef HAVE_LIBDL */

View File

@ -0,0 +1,46 @@
#!/bin/sh
#
# $NetBSD: mkinit.sh,v 1.1.1.1 1997/09/26 04:37:02 gwr Exp $
#
# Generate the init.c file on stdout.
# Arguments are names of *.o files.
# Run awk on the (edited) output of nm, i.e:
# 00000000 T _initialize_xxxx
# and turn it into a list of function calls.
# Which awk do we use? (awk,gawk,nawk?)
awk=${AWK:-awk}
# Does the compiler prepend an underscore?
if (nm version.o |grep -q ' _version')
then
sedarg='s/ _/ /'
else
sedarg=
fi
# echo "mkinit.sh: sedarg=$sedarg" >&2
echo '/* Do not modify this file. */'
echo '/* It is created automatically by the Makefile. */'
echo 'void initialize_all_files () {'
for f
do
nm -p $f
done |
sed -e "$sedarg" |
$awk '
function doit(str) {
printf(" {extern void %s (); %s ();}\n", str, str);
}
/ T _initialize_/ {
doit($3);
next;
}
{ next; }
'
echo '}'
exit 0

View File

@ -0,0 +1,5 @@
/* $NetBSD: version.c,v 1.1.1.1 1997/09/26 04:37:02 gwr Exp $ */
char *version = "4.16";
char *host_name = HOST_NAME;
char *target_name = TARGET_NAME;

3
gnu/usr.bin/gdb416/xm.h Normal file
View File

@ -0,0 +1,3 @@
/* $NetBSD: xm.h,v 1.1.1.1 1997/09/26 04:37:02 gwr Exp $ */
#include "xm-nbsd.h"