1 # $FreeBSD: src/gnu/usr.bin/binutils/gdb/Makefile,v 1.43.2.4 2002/06/25 05:04:46 obrien Exp $
3 .include "../Makefile.inc0"
5 .PATH: ${SRCDIR}/binutils
7 .if ${MACHINE_ARCH} == "i386"
8 CFLAGS+= -Dprint_insn_i386=print_insn_i386_att
13 XSRCS= annotate.c ax-general.c ax-gdb.c bcache.c blockframe.c \
14 breakpoint.c buildsym.c c-exp.y c-lang.c c-typeprint.c \
15 c-valprint.c ch-exp.c ch-lang.c ch-typeprint.c ch-valprint.c \
16 coffread.c command.c complaints.c copying.c core-regset.c \
17 corefile.c corelow.c cp-valprint.c dcache.c dbxread.c \
18 demangle.c dwarfread.c dwarf2read.c elfread.c environ.c eval.c \
19 exec.c expprint.c f-exp.y f-lang.c f-typeprint.c f-valprint.c \
20 findvar.c fork-child.c freebsd-uthread.c gdbarch.c gdbtypes.c \
21 infcmd.c inflow.c infptrace.c infrun.c inftarg.c language.c \
22 jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c nlmread.c \
23 m2-lang.c m2-exp.y m2-typeprint.c m2-valprint.c main.c maint.c \
24 mdebugread.c mem-break.c minsyms.c objfiles.c parse.c \
25 printcmd.c remote.c remote-utils.c scm-exp.c scm-lang.c \
26 scm-valprint.c solib.c source.c stabsread.c stack.c symfile.c \
27 symmisc.c symtab.c target.c thread.c top.c tracepoint.c \
28 typeprint.c utils.c valarith.c valops.c valprint.c values.c \
29 version.c serial.c ser-unix.c ser-tcp.c
32 .if exists(${.CURDIR}/Makefile.${MACHINE_ARCH})
33 .include "${.CURDIR}/Makefile.${MACHINE_ARCH}"
36 #CFLAGS+= -I${.CURDIR}/${RELTOP}/libbinutils
37 CFLAGS+= -I${.CURDIR}/${MACHINE_ARCH}
38 CFLAGS+= -I${SRCDIR}/binutils
39 CFLAGS+= -I${SRCDIR}/bfd
40 CFLAGS+= -I${GDBDIR}/gdb
41 CFLAGS+= -I${GDBDIR}/gdb/config
42 DPADD= ${RELTOP}/libbfd/libbfd.a
43 DPADD+= ${RELTOP}/libopcodes/libopcodes.a
44 DPADD+= ${LIBGNUREGEX}
45 DPADD+= ${RELTOP}/libiberty/libiberty.a
46 DPADD+= ${LIBREADLINE}
48 LDADD+= ${RELTOP}/libbfd/libbfd.a
49 LDADD+= ${RELTOP}/libopcodes/libopcodes.a
51 LDADD+= ${RELTOP}/libiberty/libiberty.a
55 GDBDIR= ${.CURDIR}/../../../../contrib/gdb
57 .PATH: ${SRCDIR}/opcodes
59 CFLAGS+= -DFREEBSD_ELF
61 CFLAGS+= -I$(.CURDIR) -I${DESTDIR}/usr/include/readline
64 # uncomment the next line if you want to debug gdb
68 CLEANFILES= init.c init.c-tmp
70 # We do this by grepping through sources. If that turns out to be too slow,
71 # maybe we could just require every .o file to have an initialization routine
72 # of a given name (remote-udi.o -> _initialize_remote_udi, etc.).
74 # Formatting conventions: The name of the _initialize_* routines must start
75 # in column zero, and must not be inside #if.
77 # Note that the set of files with init functions might change, or the names
78 # of the functions might change, so this files needs to depend on all the
79 # object files that will be linked into gdb.
82 @${ECHO} Making ${.TARGET}
84 @echo '/* Do not modify this file. */' >init.c-tmp
85 @echo '/* It is created automatically by the Makefile. */'>>init.c-tmp
86 @echo 'void initialize_all_files () {' >>init.c-tmp
87 @for i in ${.ALLSRC} ; do \
88 filename=`echo $$i | sed \
93 -e '/xdr_ptrace.c/d' \
99 -e '/^[a-z0-9A-Z_]*_[SU].c/d' \
100 -e '/[a-z0-9A-Z_]*-exp.tab.c/d'` ; \
103 *) sed <$$filename >>init.c-tmp -n \
104 -e '/^_initialize_[a-z_0-9A-Z]* *(/s/^\([a-z_0-9A-Z]*\).*/ {extern void \1 (); \1 ();}/p' ; ;; \
107 @echo '}' >>init.c-tmp
108 @mv init.c-tmp ${.TARGET}
112 .include <bsd.prog.mk>