3 .include "../Makefile.inc0"
5 .PATH: ${SRCDIR}/binutils
8 XSRCS= annotate.c ax-general.c ax-gdb.c bcache.c blockframe.c \
9 breakpoint.c buildsym.c c-exp.y c-lang.c c-typeprint.c \
10 c-valprint.c ch-exp.c ch-lang.c ch-typeprint.c ch-valprint.c \
11 coffread.c command.c complaints.c copying.c corefile.c \
12 corelow.c core-regset.c cp-valprint.c dcache.c dbxread.c demangle.c \
13 dwarfread.c dwarf2read.c elfread.c environ.c eval.c exec.c \
14 expprint.c f-exp.y f-lang.c f-typeprint.c f-valprint.c \
15 findvar.c fork-child.c gdbarch.c gdbtypes.c infcmd.c inflow.c \
16 infptrace.c infrun.c inftarg.c language.c jv-exp.y jv-lang.c \
17 jv-valprint.c jv-typeprint.c nlmread.c m2-lang.c m2-exp.y \
18 m2-typeprint.c m2-valprint.c main.c maint.c mdebugread.c \
19 mem-break.c minsyms.c objfiles.c parse.c printcmd.c remote.c \
20 remote-utils.c scm-exp.c scm-lang.c scm-valprint.c solib.c \
21 source.c stabsread.c stack.c symfile.c symmisc.c symtab.c \
22 target.c thread.c top.c tracepoint.c typeprint.c utils.c \
23 valarith.c valops.c valprint.c values.c version.c serial.c \
24 ser-unix.c ser-tcp.c callback.c
27 .if exists(${.CURDIR}/Makefile.${MACHINE_ARCH})
28 .include "${.CURDIR}/Makefile.${MACHINE_ARCH}"
31 #CFLAGS+= -I${.CURDIR}/${RELTOP}/libbinutils
32 CFLAGS+= -I${.CURDIR}/${MACHINE_ARCH}
33 CFLAGS+= -I${SRCDIR}/binutils
34 CFLAGS+= -I${SRCDIR}/bfd
35 CFLAGS+= -I${GDBDIR}/gdb
36 CFLAGS+= -I${GDBDIR}/gdb/config
37 LDADD+= -L${RELTOP}/libbfd -lbfd
38 LDADD+= -L${RELTOP}/libopcodes -lopcodes
41 LDADD+= -L${RELTOP}/libiberty -liberty
43 DPADD+= ${RELTOP}/libbfd/libbfd.a
44 DPADD+= ${RELTOP}/libopcodes/libopcodes.a
45 DPADD+= ${LIBREADLINE}
46 DPADD+= ${LIBGNUREGEX}
47 DPADD+= ${RELTOP}/libiberty/libiberty.a
50 GDBDIR= ${.CURDIR}/../../../../contrib/gdb
52 .PATH: ${SRCDIR}/opcodes
54 CFLAGS+= -DFREEBSD_ELF
56 CFLAGS+= -I$(.CURDIR) -I${DESTDIR}/usr/include/readline
59 # uncomment the next line if you want to debug gdb
63 CLEANFILES= init.c init.c-tmp
65 # We do this by grepping through sources. If that turns out to be too slow,
66 # maybe we could just require every .o file to have an initialization routine
67 # of a given name (remote-udi.o -> _initialize_remote_udi, etc.).
69 # Formatting conventions: The name of the _initialize_* routines must start
70 # in column zero, and must not be inside #if.
72 # Note that the set of files with init functions might change, or the names
73 # of the functions might change, so this files needs to depend on all the
74 # object files that will be linked into gdb.
77 @${ECHO} Making ${.TARGET}
79 @echo '/* Do not modify this file. */' >init.c-tmp
80 @echo '/* It is created automatically by the Makefile. */'>>init.c-tmp
81 @echo 'void initialize_all_files () {' >>init.c-tmp
82 @for i in ${.ALLSRC} ; do \
83 filename=`echo $$i | sed \
88 -e '/xdr_ptrace.c/d' \
94 -e '/^[a-z0-9A-Z_]*_[SU].c/d' \
95 -e '/[a-z0-9A-Z_]*-exp.tab.c/d'` ; \
98 *) sed <$$filename >>init.c-tmp -n \
99 -e '/^_initialize_[a-z_0-9A-Z]* *(/s/^\([a-z_0-9A-Z]*\).*/ {extern void \1 (); \1 ();}/p' ; ;; \
102 @echo '}' >>init.c-tmp
103 @mv init.c-tmp ${.TARGET}
107 .include <bsd.prog.mk>