binutils214 stage 1/4. Bring in the build infrastructure (left untied from
[dragonfly.git] / gnu / usr.bin / binutils214 / gdb / Makefile
1 # $FreeBSD: src/gnu/usr.bin/binutils/gdb/Makefile,v 1.43.2.4 2002/06/25 05:04:46 obrien Exp $
2 # $DragonFly: src/gnu/usr.bin/binutils214/gdb/Attic/Makefile,v 1.1 2004/02/01 08:53:04 dillon Exp $
3
4 .include "../Makefile.inc0"
5
6 .PATH: ${SRCDIR}/binutils
7
8 .if ${MACHINE_ARCH} == "i386"
9 CFLAGS+=        -Dprint_insn_i386=print_insn_i386_att
10 .endif
11
12 NOSHARED?=yes
13 PROG=   gdb
14 XSRCS=  annotate.c ax-general.c ax-gdb.c bcache.c blockframe.c          \
15         breakpoint.c buildsym.c c-exp.y c-lang.c c-typeprint.c          \
16         c-valprint.c ch-exp.c ch-lang.c ch-typeprint.c ch-valprint.c    \
17         coffread.c command.c complaints.c copying.c core-regset.c       \
18         corefile.c corelow.c cp-valprint.c dcache.c dbxread.c           \
19         demangle.c dwarfread.c dwarf2read.c elfread.c environ.c eval.c  \
20         exec.c expprint.c f-exp.y f-lang.c f-typeprint.c f-valprint.c   \
21         findvar.c fork-child.c freebsd-uthread.c gdbarch.c gdbtypes.c   \
22         infcmd.c inflow.c infptrace.c infrun.c inftarg.c language.c     \
23         jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c nlmread.c       \
24         m2-lang.c m2-exp.y m2-typeprint.c m2-valprint.c main.c maint.c  \
25         mdebugread.c mem-break.c minsyms.c objfiles.c parse.c           \
26         printcmd.c remote.c remote-utils.c scm-exp.c scm-lang.c         \
27         scm-valprint.c solib.c source.c stabsread.c stack.c symfile.c   \
28         symmisc.c symtab.c target.c thread.c top.c tracepoint.c         \
29         typeprint.c utils.c valarith.c valops.c valprint.c values.c     \
30         version.c serial.c ser-unix.c ser-tcp.c
31 SRCS=   init.c ${XSRCS}
32
33 .if exists(${.CURDIR}/Makefile.${MACHINE_ARCH})
34 .include "${.CURDIR}/Makefile.${MACHINE_ARCH}"
35 .endif
36
37 #CFLAGS+=       -I${.CURDIR}/${RELTOP}/libbinutils
38 CFLAGS+=        -I${.CURDIR}/${MACHINE_ARCH}
39 CFLAGS+=        -I${SRCDIR}/binutils
40 CFLAGS+=        -I${SRCDIR}/bfd -I${.OBJDIR}/../libbfd
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+=         ${LIBGNUREGEX}
46 DPADD+=         ${RELTOP}/libiberty/libiberty.a
47 DPADD+=         ${LIBREADLINE}
48 DPADD+=         ${LIBTERMCAP}
49 LDADD+=         ${RELTOP}/libbfd/libbfd.a
50 LDADD+=         ${RELTOP}/libopcodes/libopcodes.a
51 LDADD+=         -lgnuregex
52 LDADD+=         ${RELTOP}/libiberty/libiberty.a
53 LDADD+=         -lreadline
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 # use phkmalloc
64 CFLAGS+= -DNO_MMALLOC
65 # uncomment the next line if you want to debug gdb
66 #CFLAGS+= -g
67 YFLAGS=
68
69 CLEANFILES=     init.c init.c-tmp
70
71 # We do this by grepping through sources.  If that turns out to be too slow,
72 # maybe we could just require every .o file to have an initialization routine
73 # of a given name (remote-udi.o -> _initialize_remote_udi, etc.).
74 #
75 # Formatting conventions:  The name of the _initialize_* routines must start
76 # in column zero, and must not be inside #if.
77 #
78 # Note that the set of files with init functions might change, or the names
79 # of the functions might change, so this files needs to depend on all the
80 # object files that will be linked into gdb.
81
82 init.c: ${XSRCS}
83         @${ECHO} Making ${.TARGET}
84         @rm -f init.c-tmp
85         @echo '/* Do not modify this file.  */' >init.c-tmp
86         @echo '/* It is created automatically by the Makefile.  */'>>init.c-tmp
87         @echo 'void initialize_all_files () {' >>init.c-tmp
88         @for i in ${.ALLSRC} ; do \
89           filename=`echo $$i | sed \
90             -e '/^Onindy.c/d' \
91             -e '/^nindy.c/d' \
92             -e '/ttyflush.c/d' \
93             -e '/xdr_ld.c/d' \
94             -e '/xdr_ptrace.c/d' \
95             -e '/xdr_rdb.c/d' \
96             -e '/udr.c/d' \
97             -e '/udip2soc.c/d' \
98             -e '/udi2go32.c/d' \
99             -e '/version.c/d' \
100             -e '/^[a-z0-9A-Z_]*_[SU].c/d' \
101             -e '/[a-z0-9A-Z_]*-exp.tab.c/d'` ; \
102           case $$filename in \
103             "") ;; \
104             *) sed <$$filename >>init.c-tmp -n \
105         -e '/^_initialize_[a-z_0-9A-Z]* *(/s/^\([a-z_0-9A-Z]*\).*/  {extern void \1 (); \1 ();}/p' ; ;; \
106           esac ; \
107         done
108         @echo '}' >>init.c-tmp
109         @mv init.c-tmp ${.TARGET}
110
111 .PRECIOUS: init.c
112
113 .include <bsd.prog.mk>