No empty .Rs/.Re
[netbsd-mini2440.git] / tools / gdb / Makefile
blob710f67e01f642e51dcb2b1bdf32b633c6254a8c1
1 # $NetBSD: Makefile,v 1.15 2009/12/23 20:15:21 mrg Exp $
3 .include <bsd.own.mk>
5 MODULE= gdb6
7 FIND_ARGS= \! \( -type d -name sim -prune \)
9 CONFIGURE_ARGS= --target=${MACHINE_GNU_PLATFORM} --disable-nls \
10 --program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-,"
12 MAKE_ARGS= MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q}
14 ALL_TARGET= all-gdb
15 INSTALL_TARGET= install-gdb
17 .include "${.CURDIR}/../Makefile.gnuhost"
19 CCADDFLAGS= ${CPPFLAG_ISYSTEM} ${DESTDIR}/usr/include -L${DESTDIR}/lib -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/
21 NEWCONFIGDIR?= ${.CURDIR}/../..
22 MKNATIVE?= ${.CURDIR}/mknative-gdb
24 # Some configure tests require running a test program, which is not
25 # possible when cross-building. Provide configure with "cached"
26 # values in the environment.
27 MKNATIVE_CONFIGURE_PRESET= \
28 ac_cv_prog_cc_cross=yes \
29 ac_cv_func_fork_works=yes \
30 ac_cv_func_strcoll_works=yes \
31 bash_cv_func_ctype_nonascii=yes \
32 bash_cv_func_sigsetjmp=present \
33 bash_cv_func_strcoll_broken=no \
34 bash_cv_must_reinstall_sighandlers=no
36 # Disable sim unless it's known to work (configure's default is to
37 # enable sim if supported).
38 CONFIGURE_ARGS_SIM=
39 .if \
40 ${MACHINE_CPU} != "mips" && \
41 ${MACHINE_CPU} != "powerpc" && \
42 ${MACHINE_CPU} != "powerpc64"
43 CONFIGURE_ARGS_SIM+= --disable-sim
44 .endif
46 native-gdb: .native/.configure_done
47 @echo 'Extracting GDB configury for a native toolchain.'
48 MAKE=${MAKE:Q} ${HOST_SH} ${MKNATIVE} gdb \
49 ${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
51 .native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile
52 mkdir ${.OBJDIR}/.native 2>/dev/null || true
53 PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
54 (cd ${.OBJDIR}/.native && ${CONFIGURE_ENV:NC*:NLD*} \
55 CC_FOR_BUILD=${HOST_CC:Q} \
56 CC=${CC:Q}' '${CCADDFLAGS:Q} \
57 CXX=${CXX:Q}' '${CCADDFLAGS:Q} \
58 CPP=${CPP:Q}' '-isystem' '${DESTDIR}/usr/include \
59 CFLAGS= CPPFLAGS= CXXFLAGS= LDFLAGS= \
60 MSGFMT=${TOOLDIR}/bin/${_TOOL_PREFIX}msgfmt \
61 XGETTEXT=${TOOLDIR}/bin/${_TOOL_PREFIX}xgettext \
62 LIBS=-lintl \
63 ${MKNATIVE_CONFIGURE_PRESET} \
64 ${HOST_SH} ${GNUHOSTDIST}/configure \
65 --prefix=/usr \
66 --with-separate-debug-dir=/usr/libdata/debug \
67 ${CONFIGURE_ARGS_SIM} \
68 --build=`${GNUHOSTDIST}/config.guess` \
69 --host=${MACHINE_GNU_PLATFORM} \
70 --target=${MACHINE_GNU_PLATFORM}) && \
71 (cd ${.OBJDIR}/.native && \
72 /usr/bin/env ${MKNATIVE_CONFIGURE_PRESET} \
73 ${MAKE} configure-host) && \
74 (cd ${.OBJDIR}/.native/bfd && ${MAKE} bfd.h bfdver.h) && \
75 (cd ${.OBJDIR}/.native/gdb && ${MAKE} init.c version.c)
76 @touch $@
78 clean: clean.native
79 clean.native:
80 -rm -r -f .native