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