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