]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - gnu/usr.bin/binutils/gdb/Makefile
This commit was generated by cvs2svn to compensate for changes in r95421,
[FreeBSD/FreeBSD.git] / gnu / usr.bin / binutils / gdb / Makefile
1 # $FreeBSD$
2
3 .include "../Makefile.inc0"
4
5 .PATH: ${SRCDIR}/binutils
6
7 .if ${MACHINE_ARCH} == "i386"
8 CFLAGS+=        -Dprint_insn_i386=print_insn_i386_att
9 .endif
10
11 PROG=   gdb
12 XSRCS=  annotate.c ax-general.c ax-gdb.c bcache.c blockframe.c          \
13         breakpoint.c buildsym.c c-exp.y c-lang.c c-typeprint.c          \
14         c-valprint.c ch-exp.c ch-lang.c ch-typeprint.c ch-valprint.c    \
15         coffread.c command.c complaints.c copying.c core-regset.c       \
16         corefile.c corelow.c cp-valprint.c dcache.c dbxread.c           \
17         demangle.c dwarfread.c dwarf2read.c elfread.c environ.c eval.c  \
18         exec.c expprint.c f-exp.y f-lang.c f-typeprint.c f-valprint.c   \
19         findvar%UAfix.c fork-child.c freebsd-uthread.c gdbarch.c gdbtypes.c \
20         infcmd.c inflow.c infptrace.c infrun.c inftarg.c language.c     \
21         jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c nlmread.c       \
22         m2-lang.c m2-exp.y m2-typeprint.c m2-valprint.c main.c maint.c  \
23         mdebugread.c mem-break.c minsyms.c objfiles.c parse.c           \
24         printcmd.c remote.c remote-utils.c scm-exp.c scm-lang.c         \
25         scm-valprint.c solib.c source.c stabsread.c stack.c symfile.c   \
26         symmisc.c symtab.c target.c thread.c top.c tracepoint.c         \
27         typeprint.c utils.c valarith.c valops.c valprint.c values.c     \
28         version.c serial.c ser-unix.c ser-tcp.c
29 SRCS=   init.c ${XSRCS}
30 SRCS+=  wait.h
31
32 .if exists(${.CURDIR}/Makefile.${MACHINE_ARCH})
33 .include "${.CURDIR}/Makefile.${MACHINE_ARCH}"
34 .endif
35
36 WARNS=  0
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+=         ${LIBREADLINE}
46 DPADD+=         ${LIBGNUREGEX}
47 DPADD+=         ${RELTOP}/libiberty/libiberty.a
48 DPADD+=         ${LIBTERMCAP}
49 LDADD+=         ${RELTOP}/libbfd/libbfd.a
50 LDADD+=         ${RELTOP}/libopcodes/libopcodes.a
51 LDADD+=         -lreadline
52 LDADD+=         -lgnuregex
53 LDADD+=         ${RELTOP}/libiberty/libiberty.a
54 LDADD+=         -ltermcap
55
56 GDBDIR= ${.CURDIR}/../../../../contrib/gdb
57 .PATH:  ${GDBDIR}/gdb
58 .PATH:  ${SRCDIR}/opcodes
59
60 CFLAGS+=        -DFREEBSD_ELF
61
62 CFLAGS+= -I$(.CURDIR) -I${DESTDIR}/usr/include/readline
63 YFLAGS=
64
65 CLEANFILES=     init.c init.c-tmp wait.h
66 CLEANFILES+=    findvar%UAfix.c
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 wait.h:
111         ln -sf ${.CURDIR}/../../../../sys/sys/wait.h ${.TARGET}
112
113 .include <bsd.prog.mk>