]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - gnu/usr.bin/binutils/gdb/Makefile
This commit was generated by cvs2svn to compensate for changes in r98121,
[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 core-regset.c       \
12         corefile.c corelow.c cp-valprint.c dcache.c dbxread.c           \
13         demangle.c dwarfread.c dwarf2read.c elfread.c environ.c eval.c  \
14         exec.c expprint.c f-exp.y f-lang.c f-typeprint.c f-valprint.c   \
15         findvar%UAfix.c fork-child.c freebsd-uthread.c gdbarch.c gdbtypes.c \
16         infcmd.c inflow.c infptrace.c infrun.c inftarg.c language.c     \
17         jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c nlmread.c       \
18         m2-lang.c m2-exp.y m2-typeprint.c m2-valprint.c main.c maint.c  \
19         mdebugread.c mem-break.c minsyms.c objfiles.c parse.c           \
20         printcmd.c remote.c remote-utils.c scm-exp.c scm-lang.c         \
21         scm-valprint.c solib.c source.c stabsread.c stack.c symfile.c   \
22         symmisc.c symtab.c target.c thread.c top.c tracepoint.c         \
23         typeprint.c utils.c valarith.c valops.c valprint.c values.c     \
24         version.c serial.c ser-unix.c ser-tcp.c
25 SRCS=   init.c ${XSRCS}
26 SRCS+=  wait.h
27
28 .if exists(${.CURDIR}/Makefile.${TARGET_ARCH})
29 .include "${.CURDIR}/Makefile.${TARGET_ARCH}"
30 .endif
31
32 WARNS=  0
33 .if ${TARGET_ARCH} != ${MACHINE_ARCH}
34 CFLAGS+=        -DCROSS_COMPILE=1
35 .endif
36 CFLAGS+=        -I${.CURDIR}/${TARGET_ARCH}
37 CFLAGS+=        -I${SRCDIR}/binutils
38 CFLAGS+=        -I${SRCDIR}/bfd
39 CFLAGS+=        -I${GDBDIR}/gdb
40 CFLAGS+=        -I${GDBDIR}/gdb/config
41 DPADD=          ${RELTOP}/libbfd/libbfd.a
42 DPADD+=         ${RELTOP}/libopcodes/libopcodes.a
43 DPADD+=         ${LIBREADLINE}
44 DPADD+=         ${LIBGNUREGEX}
45 DPADD+=         ${RELTOP}/libiberty/libiberty.a
46 DPADD+=         ${LIBTERMCAP}
47 LDADD+=         ${RELTOP}/libbfd/libbfd.a
48 LDADD+=         ${RELTOP}/libopcodes/libopcodes.a
49 LDADD+=         -lreadline
50 LDADD+=         -lgnuregex
51 LDADD+=         ${RELTOP}/libiberty/libiberty.a
52 LDADD+=         -ltermcap
53
54 GDBDIR= ${.CURDIR}/../../../../contrib/gdb
55 .PATH:  ${GDBDIR}/gdb
56 .PATH:  ${SRCDIR}/opcodes
57
58 CFLAGS+=        -DFREEBSD_ELF
59
60 CFLAGS+= -I$(.CURDIR) -I${DESTDIR}/usr/include/readline
61 YFLAGS=
62
63 CLEANFILES=     init.c init.c-tmp wait.h
64 CLEANFILES+=    findvar%UAfix.c
65
66 # We do this by grepping through sources.  If that turns out to be too slow,
67 # maybe we could just require every .o file to have an initialization routine
68 # of a given name (remote-udi.o -> _initialize_remote_udi, etc.).
69 #
70 # Formatting conventions:  The name of the _initialize_* routines must start
71 # in column zero, and must not be inside #if.
72 #
73 # Note that the set of files with init functions might change, or the names
74 # of the functions might change, so this files needs to depend on all the
75 # object files that will be linked into gdb.
76
77 init.c: ${XSRCS}
78         @${ECHO} Making ${.TARGET}
79         @rm -f init.c-tmp
80         @echo '/* Do not modify this file.  */' >init.c-tmp
81         @echo '/* It is created automatically by the Makefile.  */'>>init.c-tmp
82         @echo 'void initialize_all_files () {' >>init.c-tmp
83         @for i in ${.ALLSRC} ; do \
84           filename=`echo $$i | sed \
85             -e '/^Onindy.c/d' \
86             -e '/^nindy.c/d' \
87             -e '/ttyflush.c/d' \
88             -e '/xdr_ld.c/d' \
89             -e '/xdr_ptrace.c/d' \
90             -e '/xdr_rdb.c/d' \
91             -e '/udr.c/d' \
92             -e '/udip2soc.c/d' \
93             -e '/udi2go32.c/d' \
94             -e '/version.c/d' \
95             -e '/^[a-z0-9A-Z_]*_[SU].c/d' \
96             -e '/[a-z0-9A-Z_]*-exp.tab.c/d'` ; \
97           case $$filename in \
98             "") ;; \
99             *) sed <$$filename >>init.c-tmp -n \
100         -e '/^_initialize_[a-z_0-9A-Z]* *(/s/^\([a-z_0-9A-Z]*\).*/  {extern void \1 (); \1 ();}/p' ; ;; \
101           esac ; \
102         done
103         @echo '}' >>init.c-tmp
104         @mv init.c-tmp ${.TARGET}
105
106 .PRECIOUS: init.c
107
108 wait.h:
109         ln -sf ${.CURDIR}/../../../../sys/sys/wait.h ${.TARGET}
110
111 .include <bsd.prog.mk>