aboutsummaryrefslogtreecommitdiff
path: root/gnu/usr.bin/gdb
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2004-11-30 05:12:37 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2004-11-30 05:12:37 +0000
commit20a966130587924236e33243f763f5e3936ac7b0 (patch)
tree6f9ca2bc715a008f6966026447acb02f4fed17fb /gnu/usr.bin/gdb
parent4ac33532efb9dcf3aab988d18299d0d577a7b919 (diff)
downloadsrc-20a966130587924236e33243f763f5e3936ac7b0.tar.gz
src-20a966130587924236e33243f763f5e3936ac7b0.zip
Makefile (only) changes to allow building a cross debugger.
Notes
Notes: svn path=/head/; revision=138215
Diffstat (limited to 'gnu/usr.bin/gdb')
-rw-r--r--gnu/usr.bin/gdb/Makefile.inc6
-rw-r--r--gnu/usr.bin/gdb/arch/alpha/Makefile6
-rw-r--r--gnu/usr.bin/gdb/arch/amd64/Makefile10
-rw-r--r--gnu/usr.bin/gdb/arch/i386/Makefile8
-rw-r--r--gnu/usr.bin/gdb/arch/ia64/Makefile5
-rw-r--r--gnu/usr.bin/gdb/arch/sparc64/Makefile6
-rw-r--r--gnu/usr.bin/gdb/gdb/Makefile2
-rw-r--r--gnu/usr.bin/gdb/gdbtui/Makefile2
-rw-r--r--gnu/usr.bin/gdb/kgdb/Makefile2
-rw-r--r--gnu/usr.bin/gdb/libgdb/Makefile24
10 files changed, 50 insertions, 21 deletions
diff --git a/gnu/usr.bin/gdb/Makefile.inc b/gnu/usr.bin/gdb/Makefile.inc
index ebb6b15a5f44..2f5a448dbf17 100644
--- a/gnu/usr.bin/gdb/Makefile.inc
+++ b/gnu/usr.bin/gdb/Makefile.inc
@@ -36,6 +36,12 @@ CFLAGS+= -I${CNTRB_BU}/bfd
GENSRCS+= nm.h tm.h
+.if defined(GDB_CROSS_DEBUGGER)
+CFLAGS+= -DCROSS_DEBUGGER
+GDB_SUFFIX= -${TARGET_ARCH}
+NOMAN=
+.endif
+
.include "${TARGET_SUBDIR}/Makefile"
SRCS+= ${GENSRCS}
diff --git a/gnu/usr.bin/gdb/arch/alpha/Makefile b/gnu/usr.bin/gdb/arch/alpha/Makefile
index f66a970f272f..44633e4774e8 100644
--- a/gnu/usr.bin/gdb/arch/alpha/Makefile
+++ b/gnu/usr.bin/gdb/arch/alpha/Makefile
@@ -1,8 +1,10 @@
# $FreeBSD$
+.if !defined(GDB_CROSS_DEBUGGER)
LIBSRCS+= core-regset.c solib-legacy.c
-LIBSRCS+= alpha-mdebug-tdep.c alpha-tdep.c alphabsd-nat.c alphabsd-tdep.c \
- alphafbsd-tdep.c
+LIBSRCS+= alphabsd-nat.c
+.endif
+LIBSRCS+= alpha-mdebug-tdep.c alpha-tdep.c alphabsd-tdep.c alphafbsd-tdep.c
nm.h:
echo '#include "alpha/nm-fbsd.h"' > ${.TARGET}
diff --git a/gnu/usr.bin/gdb/arch/amd64/Makefile b/gnu/usr.bin/gdb/arch/amd64/Makefile
index 3e4616559a03..f86bc2c030df 100644
--- a/gnu/usr.bin/gdb/arch/amd64/Makefile
+++ b/gnu/usr.bin/gdb/arch/amd64/Makefile
@@ -1,10 +1,12 @@
# $FreeBSD$
GENSRCS+= xm.h
-LIBSRCS+= fbsd-proc.c gcore.c
-LIBSRCS+= amd64-nat.c amd64-tdep.c amd64bsd-nat.c amd64fbsd-nat.c \
- amd64fbsd-tdep.c i386-tdep.c i386bsd-tdep.c i386fbsd-tdep.c \
- i387-tdep.c
+.if !defined(GDB_CROSS_DEBUGGER)
+LIBSRCS+= fbsd-proc.c fbsd-threads.c gcore.c
+LIBSRCS+= amd64-nat.c amd64bsd-nat.c amd64fbsd-nat.c
+.endif
+LIBSRCS+= amd64-tdep.c amd64fbsd-tdep.c i386-tdep.c i386bsd-tdep.c \
+ i386fbsd-tdep.c i387-tdep.c
nm.h:
echo '#include "i386/nm-fbsd64.h"' > ${.TARGET}
diff --git a/gnu/usr.bin/gdb/arch/i386/Makefile b/gnu/usr.bin/gdb/arch/i386/Makefile
index ac2146b19edf..2f89ddbe5ed5 100644
--- a/gnu/usr.bin/gdb/arch/i386/Makefile
+++ b/gnu/usr.bin/gdb/arch/i386/Makefile
@@ -1,9 +1,11 @@
# $FreeBSD$
GENSRCS+= xm.h
-LIBSRCS+= fbsd-proc.c gcore.c
-LIBSRCS+= i386-nat.c i386-tdep.c i386bsd-nat.c i386bsd-tdep.c \
- i386fbsd-nat.c i386fbsd-tdep.c i387-tdep.c
+.if !defined(GDB_CROSS_DEBUGGER)
+LIBSRCS+= fbsd-proc.c fbsd-threads.c gcore.c
+LIBSRCS+= i386-nat.c i386bsd-nat.c i386fbsd-nat.c
+.endif
+LIBSRCS+= i386-tdep.c i386bsd-tdep.c i386fbsd-tdep.c i387-tdep.c
nm.h:
echo '#include "i386/nm-fbsd.h"' > ${.TARGET}
diff --git a/gnu/usr.bin/gdb/arch/ia64/Makefile b/gnu/usr.bin/gdb/arch/ia64/Makefile
index aa8679097927..191e13912229 100644
--- a/gnu/usr.bin/gdb/arch/ia64/Makefile
+++ b/gnu/usr.bin/gdb/arch/ia64/Makefile
@@ -1,7 +1,10 @@
# $FreeBSD$
+.if !defined(GDB_CROSS_DEBUGGER)
LIBSRCS+= fbsd-proc.c gcore.c
-LIBSRCS+= ia64-fbsd-nat.c ia64-fbsd-tdep.c ia64-tdep.c
+LIBSRCS+= ia64-fbsd-nat.c
+.endif
+LIBSRCS+= ia64-fbsd-tdep.c ia64-tdep.c
nm.h:
echo '#include "ia64/nm-fbsd.h"' > ${.TARGET}
diff --git a/gnu/usr.bin/gdb/arch/sparc64/Makefile b/gnu/usr.bin/gdb/arch/sparc64/Makefile
index d1e46c5aeb46..69cce7e08d0d 100644
--- a/gnu/usr.bin/gdb/arch/sparc64/Makefile
+++ b/gnu/usr.bin/gdb/arch/sparc64/Makefile
@@ -1,8 +1,10 @@
# $FreeBSD$
+.if !defined(GDB_CROSS_DEBUGGER)
LIBSRCS+= solib-legacy.c
-LIBSRCS+= sparc-nat.c sparc-tdep.c sparc64-nat.c sparc64-tdep.c \
- sparc64fbsd-nat.c sparc64fbsd-tdep.c
+LIBSRCS+= sparc-nat.c sparc64-nat.c sparc64fbsd-nat.c
+.endif
+LIBSRCS+= sparc-tdep.c sparc64-tdep.c sparc64fbsd-tdep.c
nm.h:
echo '#include "sparc/nm-fbsd.h"' > ${.TARGET}
diff --git a/gnu/usr.bin/gdb/gdb/Makefile b/gnu/usr.bin/gdb/gdb/Makefile
index 4269d8a6ea3e..b4ca070023c7 100644
--- a/gnu/usr.bin/gdb/gdb/Makefile
+++ b/gnu/usr.bin/gdb/gdb/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-PROG= gdb
+PROG= gdb${GDB_SUFFIX}
SRCS= gdb.c
BULIBS= ${OBJ_BU}/libbfd/libbfd.a ${OBJ_BU}/libopcodes/libopcodes.a \
diff --git a/gnu/usr.bin/gdb/gdbtui/Makefile b/gnu/usr.bin/gdb/gdbtui/Makefile
index 0f6f319eed46..898a26796f64 100644
--- a/gnu/usr.bin/gdb/gdbtui/Makefile
+++ b/gnu/usr.bin/gdb/gdbtui/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-PROG= gdbtui
+PROG= gdbtui${GDB_SUFFIX}
SRCS= tui-main.c
NOMAN=
diff --git a/gnu/usr.bin/gdb/kgdb/Makefile b/gnu/usr.bin/gdb/kgdb/Makefile
index b35871e103fa..4eb144215b93 100644
--- a/gnu/usr.bin/gdb/kgdb/Makefile
+++ b/gnu/usr.bin/gdb/kgdb/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-PROG= kgdb
+PROG= kgdb${GDB_SUFFIX}
SRCS= kthr.c main.c trgt.c trgt_${TARGET_ARCH}.c
WARNS?= 2
diff --git a/gnu/usr.bin/gdb/libgdb/Makefile b/gnu/usr.bin/gdb/libgdb/Makefile
index 5d142b4e42fb..25b7bac03ed3 100644
--- a/gnu/usr.bin/gdb/libgdb/Makefile
+++ b/gnu/usr.bin/gdb/libgdb/Makefile
@@ -1,5 +1,10 @@
# $FreeBSD$
+TARGET_ARCH?= ${MACHINE_ARCH}
+.if ${TARGET_ARCH} != ${MACHINE_ARCH}
+GDB_CROSS_DEBUGGER=
+.endif
+
LIB= gdb
INTERNALLIB=
SRCS= annotate.c arch-utils.c auxv.c ax-gdb.c ax-general.c \
@@ -16,11 +21,11 @@ SRCS= annotate.c arch-utils.c auxv.c ax-gdb.c ax-general.c \
elfread.c environ.c eval.c event-loop.c event-top.c exec.c \
expprint.c \
f-exp.y f-lang.c f-typeprint.c f-valprint.c findvar.c \
- fork-child.c frame-base.c frame-unwind.c frame.c \
+ ${_fork_child} frame-base.c frame-unwind.c frame.c \
gdb-events.c gdbarch.c gdbtypes.c gnu-v2-abi.c gnu-v3-abi.c \
hpacc-abi.c \
- inf-loop.c infcall.c infcmd.c inflow.c infptrace.c infrun.c \
- inftarg.c init.c interps.c \
+ inf-loop.c infcall.c infcmd.c inflow.c ${_infptrace} infrun.c \
+ ${_inftarg} init.c interps.c \
jv-exp.y jv-lang.c jv-typeprint.c jv-valprint.c \
kod-cisco.c kod.c \
language.c linespec.c \
@@ -47,12 +52,19 @@ SRCS= annotate.c arch-utils.c auxv.c ax-gdb.c ax-general.c \
valarith.c valops.c valprint.c values.c varobj.c \
wrapper.c ${LIBSRCS}
-GENSRCS= version.c
+TARGET_ARCH?= ${MACHINE_ARCH}
+.if ${TARGET_ARCH} != ${MACHINE_ARCH}
+GDB_CROSS_DEBUGGER=
+.endif
-.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
-LIBSRCS+= fbsd-threads.c
+.if !defined(GDB_CROSS_DEBUGGER)
+_fork_child= fork-child.c
+_infptrace= infptrace.c
+_inftarg= inftarg.c
.endif
+GENSRCS= version.c
+
version.c:
echo '#include "version.h"' > ${.TARGET}
echo 'const char version[] = ${VERSION};' >> ${.TARGET}