]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - gnu/usr.bin/binutils/gdb/Makefile
This commit was generated by cvs2svn to compensate for changes in r51591,
[FreeBSD/FreeBSD.git] / gnu / usr.bin / binutils / gdb / Makefile
1 # $FreeBSD$
2
3 .include "../Makefile.inc0"
4
5 .PATH: ${SRCDIR}/binutils
6
7 PROG=   gdb
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
25 SRCS=   init.c ${XSRCS}
26
27 .if exists(${.CURDIR}/Makefile.${MACHINE_ARCH})
28 .include "${.CURDIR}/Makefile.${MACHINE_ARCH}"
29 .endif
30
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
39 LDADD+=         -lreadline
40 LDADD+=         -lgnuregex
41 LDADD+=         -L${RELTOP}/libiberty -liberty
42 LDADD+=         -ltermcap
43 DPADD+=         ${RELTOP}/libbfd/libbfd.a
44 DPADD+=         ${RELTOP}/libopcodes/libopcodes.a
45 DPADD+=         ${LIBREADLINE}
46 DPADD+=         ${LIBGNUREGEX}
47 DPADD+=         ${RELTOP}/libiberty/libiberty.a
48 DPADD+=         ${LIBTERMCAP}
49
50 GDBDIR= ${.CURDIR}/../../../../contrib/gdb
51 .PATH:  ${GDBDIR}/gdb
52 .PATH:  ${SRCDIR}/opcodes
53
54 CFLAGS+=        -DFREEBSD_ELF
55
56 CFLAGS+= -I$(.CURDIR) -I${DESTDIR}/usr/include/readline
57 # use phkmalloc
58 CFLAGS+= -DNO_MMALLOC
59 # uncomment the next line if you want to debug gdb
60 #CFLAGS+= -g
61 YFLAGS=
62
63 CLEANFILES=     init.c init.c-tmp
64
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.).
68 #
69 # Formatting conventions:  The name of the _initialize_* routines must start
70 # in column zero, and must not be inside #if.
71 #
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.
75
76 init.c: ${XSRCS}
77         @${ECHO} Making ${.TARGET}
78         @rm -f init.c-tmp
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 \
84             -e '/^Onindy.c/d' \
85             -e '/^nindy.c/d' \
86             -e '/ttyflush.c/d' \
87             -e '/xdr_ld.c/d' \
88             -e '/xdr_ptrace.c/d' \
89             -e '/xdr_rdb.c/d' \
90             -e '/udr.c/d' \
91             -e '/udip2soc.c/d' \
92             -e '/udi2go32.c/d' \
93             -e '/version.c/d' \
94             -e '/^[a-z0-9A-Z_]*_[SU].c/d' \
95             -e '/[a-z0-9A-Z_]*-exp.tab.c/d'` ; \
96           case $$filename in \
97             "") ;; \
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' ; ;; \
100           esac ; \
101         done
102         @echo '}' >>init.c-tmp
103         @mv init.c-tmp ${.TARGET}
104
105 .PRECIOUS: init.c
106
107 .include <bsd.prog.mk>