3 .include "../Makefile.inc0"
5 .PATH: ${SRCDIR}/binutils
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
28 .if exists(${.CURDIR}/Makefile.${TARGET_ARCH})
29 .include "${.CURDIR}/Makefile.${TARGET_ARCH}"
33 .if ${TARGET_ARCH} != ${MACHINE_ARCH}
34 CFLAGS+= -DCROSS_COMPILE=1
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
47 LDADD+= ${RELTOP}/libbfd/libbfd.a
48 LDADD+= ${RELTOP}/libopcodes/libopcodes.a
51 LDADD+= ${RELTOP}/libiberty/libiberty.a
54 GDBDIR= ${.CURDIR}/../../../../contrib/gdb
56 .PATH: ${SRCDIR}/opcodes
58 CFLAGS+= -DFREEBSD_ELF
60 CFLAGS+= -I$(.CURDIR) -I${DESTDIR}/usr/include/readline
63 CLEANFILES= init.c init.c-tmp wait.h
64 CLEANFILES+= findvar%UAfix.c
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.).
70 # Formatting conventions: The name of the _initialize_* routines must start
71 # in column zero, and must not be inside #if.
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.
78 @${ECHO} Making ${.TARGET}
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 \
89 -e '/xdr_ptrace.c/d' \
95 -e '/^[a-z0-9A-Z_]*_[SU].c/d' \
96 -e '/[a-z0-9A-Z_]*-exp.tab.c/d'` ; \
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' ; ;; \
103 @echo '}' >>init.c-tmp
104 @mv init.c-tmp ${.TARGET}
109 ln -sf ${.CURDIR}/../../../../sys/sys/wait.h ${.TARGET}
111 .include <bsd.prog.mk>