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