4 .include "../Makefile.inc0"
6 GDBDIR= ${.CURDIR}/../../../../contrib/gdb
7 .PATH: ${GDBDIR}/gdb ${GDBDIR}/gdb/cli ${GDBDIR}/gdb/mi
8 .PATH: ${SRCDIR}/opcodes ${SRCDIR}/binutils
10 # For FSF GDB files, use their CPU (arch) name; for our files use ours.
11 .if ${TARGET_ARCH} == "sparc64"
13 .elif ${TARGET_ARCH} == "amd64"
16 GDB_CPU= ${TARGET_ARCH}
21 XSRCS= annotate.c arch-utils.c ax-general.c ax-gdb.c bcache.c \
22 blockframe.c breakpoint.c buildsym.c complaints.c completer.c \
23 copying.c corefile.c corelow.c dcache.c doublest.c event-loop.c \
24 event-top.c environ.c eval.c exec.c expprint.c fork-child.c \
25 frame.c gdb-events.c gdbarch.c gdbtypes.c infcmd.c inflow.c \
26 infptrace.c inf-loop.c infrun.c inftarg.c language.c linespec.c \
27 main.c maint.c mdebugread.c mem-break.c memattr.c minsyms.c \
28 objfiles.c parse.c printcmd.c regcache.c remote.c \
29 remote-utils.c signals.c source.c stabsread.c stack.c symfile.c \
30 symmisc.c symtab.c target.c thread.c top.c tracepoint.c \
31 typeprint.c ui-file.c ui-out.c utils.c valarith.c valops.c \
32 varobj.c valprint.c values.c wrapper.c \
33 cli-cmds.c cli-cmds.h cli-decode.c cli-decode.h cli-out.c \
34 cli-script.c cli-script.h cli-setshow.c cli-setshow.h \
35 cli-utils.c cli-utils.h \
36 mi-cmd-break.c mi-cmd-disas.c mi-cmd-stack.c mi-cmd-var.c \
37 mi-cmds.c mi-console.c mi-getopt.c mi-main.c mi-out.c mi-parse.c\
38 serial.c ser-unix.c ser-tcp.c \
39 c-exp.y c-lang.c c-typeprint.c c-valprint.c \
40 ch-exp.c ch-lang.c ch-typeprint.c ch-valprint.c \
41 cp-abi.c gnu-v2-abi.c gnu-v3-abi.c cp-valprint.c demangle.c \
42 f-exp.y f-lang.c f-typeprint.c f-valprint.c findvar.c \
43 jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c nlmread.c \
44 m2-lang.c m2-exp.y m2-typeprint.c m2-valprint.c \
45 scm-exp.c scm-lang.c scm-valprint.c \
46 coffread.c dbxread.c dwarfread.c dwarf2read.c elfread.c \
47 solib.c solib-svr4.c solib-legacy.c
48 XSRCS+= freebsd-uthread.c kvm-fbsd.c kvm-fbsd-machine.h solib-fbsd-kld.c
49 SRCS= init.c ${XSRCS} nm.h tm.h xm.h gdbversion.c xregex.h
51 .include "${.CURDIR}/Makefile.${TARGET_ARCH}"
54 .if ${TARGET_ARCH} != ${MACHINE_ARCH}
55 CFLAGS+= -DCROSS_COMPILE=1
57 CFLAGS+= -DDEFAULT_BFD_ARCH=bfd_${GDB_CPU}_arch
58 CFLAGS+= -I${.CURDIR}/${TARGET_ARCH}
59 CFLAGS+= -I${SRCDIR}/binutils -I${SRCDIR}/bfd
60 CFLAGS+= -I${GDBDIR}/gdb -I${GDBDIR}/gdb/config
65 DPADD= ${LIBKVM} ${LIBM}
66 DPADD+= ${RELTOP}/libbfd/libbfd.a ${RELTOP}/libopcodes/libopcodes.a
67 DPADD+= ${LIBGNUREGEX}
68 DPADD+= ${RELTOP}/libiberty/libiberty.a
69 DPADD+= ${LIBREADLINE} ${LIBTERMCAP}
71 LDADD+= ${RELTOP}/libbfd/libbfd.a ${RELTOP}/libopcodes/libopcodes.a
73 LDADD+= ${RELTOP}/libiberty/libiberty.a
74 LDADD+= -lreadline -ltermcap
76 CLEANFILES= init.c init.c-tmp nm.h tm.h xm.h gdbversion.c xregex.h kvm-fbsd-machine.h
78 # We do this by grepping through sources. If that turns out to be too slow,
79 # maybe we could just require every .o file to have an initialization routine
80 # of a given name (remote-udi.o -> _initialize_remote_udi, etc.).
82 # Formatting conventions: The name of the _initialize_* routines must start
83 # in column zero, and must not be inside #if.
85 # Note that the set of files with init functions might change, or the names
86 # of the functions might change, so this files needs to depend on all the
87 # object files that will be linked into gdb.
90 @${ECHO} Making ${.TARGET}
92 @echo '/* Do not modify this file. */' >init.c-tmp
93 @echo '/* It is created automatically by the Makefile. */'>>init.c-tmp
94 @echo '#include "defs.h"' >>init.c-tmp
95 @echo '#include "call-cmds.h"' >>init.c-tmp
96 @echo 'void initialize_all_files () {' >>init.c-tmp
97 @for i in ${.ALLSRC} ; do \
98 filename=`echo $$i | sed \
103 -e '/xdr_ptrace.c/d' \
109 -e '/^[a-z0-9A-Z_]*_[SU].c/d' \
110 -e '/[a-z0-9A-Z_]*-exp.tab.c/d'` ; \
113 *) sed <$$filename >>init.c-tmp -n \
114 -e '/^_initialize_[a-z_0-9A-Z]* *(/s/^\([a-z_0-9A-Z]*\).*/ {extern void \1 (); \1 ();}/p' ; ;; \
117 @echo '}' >>init.c-tmp
118 @mv init.c-tmp ${.TARGET}
123 echo '#include "${GDB_CPU}/tm-fbsd.h"' > ${.TARGET}
124 .if exists(${.CURDIR}/fbsd-kgdb-${TARGET_ARCH}.h)
125 echo '#include "fbsd-kgdb-${TARGET_ARCH}.h"' >> ${.TARGET}
128 .for H in nm-fbsd xm-${GDB_CPU}
130 ln -sf ${GDBDIR}/gdb/config/${GDB_CPU}/${H}.h ${.TARGET}
134 ln -sf ${.CURDIR}/kvm-fbsd-${TARGET_ARCH}.h ${.TARGET}
136 GDB_VERSION= "5.2.1 (FreeBSD)"
137 gdbversion.c: Makefile
138 @echo '#include "version.h"' > ${.TARGET}
139 @echo 'const char version[] = ${GDB_VERSION};' >>${.TARGET}
140 @echo 'const char host_name[] = "${MACHINE_ARCH}-undermydesk-freebsd";' >>${.TARGET}
141 @echo 'const char target_name[] = "${TARGET_ARCH}-undermydesk-freebsd";' >>${.TARGET}
144 @echo '#include <gnu/regex.h>' >${.TARGET}
146 .include <bsd.prog.mk>