]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - gnu/usr.bin/gdb/gdb/Makefile
This commit was generated by cvs2svn to compensate for changes in r41980,
[FreeBSD/FreeBSD.git] / gnu / usr.bin / gdb / gdb / Makefile
1 #       $Id: Makefile,v 1.37 1998/09/14 22:49:01 jdp Exp $
2
3 PROG = gdb
4
5 GDBDIR= ${.CURDIR}/../../../../contrib/gdb
6 .if ${OBJFORMAT} == elf
7 BFDDIR= ${.CURDIR}/../../binutils/libbfd/${MACHINE_ARCH}
8 BINDIR= /usr/libexec/elf
9 .else
10 BFDDIR= ${.CURDIR}/../bfd
11 BINDIR= /usr/libexec/aout
12 .endif
13 .PATH:  ${GDBDIR}/gdb
14 .PATH:  ${GDBDIR}/opcodes
15
16 .if ${OBJFORMAT} == elf
17 CFLAGS+=        -DFREEBSD_ELF
18 .endif
19
20 XSRCS = annotate.c blockframe.c breakpoint.c buildsym.c c-lang.c \
21         c-typeprint.c c-valprint.c ch-lang.c ch-typeprint.c \
22         ch-valprint.c coffread.c command.c complaints.c copying.c \
23         core-regset.c corelow.c cp-valprint.c \
24         dcache.c dbxread.c demangle.c dwarfread.c \
25         elfread.c environ.c eval.c exec.c expprint.c \
26         findvar.c fork-child.c freebsd-nat.c gdbtypes.c \
27         i386-tdep.c infcmd.c inflow.c infptrace.c \
28         infrun.c inftarg.c language.c \
29         m2-lang.c m2-typeprint.c m2-valprint.c main.c maint.c \
30         mem-break.c minsyms.c objfiles.c parse.c \
31         printcmd.c remote.c remote-utils.c solib.c source.c \
32         stabsread.c stack.c symfile.c symmisc.c \
33         symtab.c target.c thread.c top.c \
34         typeprint.c utils.c valarith.c valops.c \
35         valprint.c values.c version.c \
36         serial.c ser-unix.c ser-tcp.c mdebugread.c \
37         c-exp.y f-exp.y m2-exp.y i387-tdep.c \
38         kvm-fbsd.c bcache.c \
39         corefile.c ch-exp.c f-lang.c scm-exp.c scm-lang.c \
40         scm-valprint.c f-typeprint.c f-valprint.c nlmread.c \
41         callback.c
42 XSRCS+= i386-dis.c dis-buf.c disassemble.c
43 SRCS=   init.c ${XSRCS}
44
45 CFLAGS+= -I$(.CURDIR) -I${DESTDIR}/usr/include/readline -I${BFDDIR}
46 # use phkmalloc
47 CFLAGS+= -DNO_MMALLOC
48 # uncomment the next line if you want to debug gdb
49 #CFLAGS+= -g
50 YFLAGS=
51
52 CLEANFILES=     init.c init.c-tmp
53
54 .if ${OBJFORMAT} == elf
55
56 .if exists(${.OBJDIR}/../../binutils/libbfd)
57 LIBBFD= ${.OBJDIR}/../../binutils/libbfd/libbfd.a
58 .else
59 LIBBFD= ${.CURDIR}/../../binutils/libbfd/libbfd.a
60 .endif
61
62 .if exists(${.OBJDIR}/../../binutils/libiberty)
63 LIBIBERTY=      ${.OBJDIR}/../../binutils/libiberty/libiberty.a
64 .else
65 LIBIBERTY=      ${.CURDIR}/../../binutils/libiberty/libiberty.a
66 .endif
67
68 .else
69
70 .if exists(${.OBJDIR}/../bfd)
71 LIBBFD= ${.OBJDIR}/../bfd/libbfd.a
72 .else
73 LIBBFD= ${.CURDIR}/../bfd/libbfd.a
74 .endif
75
76 .if exists(${.OBJDIR}/../libiberty)
77 LIBIBERTY= ${.OBJDIR}/../libiberty/libiberty.a
78 .else
79 LIBIBERTY= ${.CURDIR}/../libiberty/libiberty.a
80 .endif
81
82 .endif # OBJFORMAT
83
84 DPADD=  ${LIBBFD} ${LIBREADLINE} ${LIBGNUREGEX} ${LIBIBERTY} ${LIBTERMCAP}
85 LDADD=  ${LIBBFD} -lreadline     -lgnuregex     ${LIBIBERTY} -ltermcap
86 DPADD+= ${LIBIBERTY}
87 LDADD+= ${LIBIBERTY}
88
89 # We do this by grepping through sources.  If that turns out to be too slow,
90 # maybe we could just require every .o file to have an initialization routine
91 # of a given name (remote-udi.o -> _initialize_remote_udi, etc.).
92 #
93 # Formatting conventions:  The name of the _initialize_* routines must start
94 # in column zero, and must not be inside #if.
95 #
96 # Note that the set of files with init functions might change, or the names
97 # of the functions might change, so this files needs to depend on all the
98 # object files that will be linked into gdb.
99
100 init.c: ${XSRCS}
101         @echo Making ${.TARGET}
102         @rm -f init.c-tmp
103         @echo '/* Do not modify this file.  */' >init.c-tmp
104         @echo '/* It is created automatically by the Makefile.  */'>>init.c-tmp
105         @echo 'void initialize_all_files () {' >>init.c-tmp
106         @for i in ${.ALLSRC} ; do \
107           filename=`echo $$i | sed \
108             -e '/^Onindy.c/d' \
109             -e '/^nindy.c/d' \
110             -e '/ttyflush.c/d' \
111             -e '/xdr_ld.c/d' \
112             -e '/xdr_ptrace.c/d' \
113             -e '/xdr_rdb.c/d' \
114             -e '/udr.c/d' \
115             -e '/udip2soc.c/d' \
116             -e '/udi2go32.c/d' \
117             -e '/version.c/d' \
118             -e '/^[a-z0-9A-Z_]*_[SU].c/d' \
119             -e '/[a-z0-9A-Z_]*-exp.tab.c/d'` ; \
120           case $$filename in \
121             "") ;; \
122             *) sed <$$filename >>init.c-tmp -n \
123         -e '/^_initialize_[a-z_0-9A-Z]* *(/s/^\([a-z_0-9A-Z]*\).*/  {extern void \1 (); \1 ();}/p' ; ;; \
124           esac ; \
125         done
126         @echo '}' >>init.c-tmp
127         @mv init.c-tmp ${.TARGET}
128
129 .PRECIOUS: init.c
130
131 .include <bsd.prog.mk>