Makefile revision 1.31
1# $NetBSD: Makefile,v 1.31 2017/07/01 12:23:09 jmcneill Exp $ 2 3.include <bsd.own.mk> 4 5MODULE= gdb 6GDBDIR= ${.CURDIR}/../../external/gpl3/${EXTERNAL_GDB_SUBDIR} 7GNUHOSTDIST= ${GDBDIR}/dist 8 9FIND_ARGS= \! \( -type d -name sim -prune \) 10 11CONFIGURE_ARGS= --target=${MACHINE_GNU_PLATFORM} --disable-nls \ 12 --program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," 13 14MAKE_ARGS= MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q} 15 16ALL_TARGET= all-gdb 17INSTALL_TARGET= install-gdb 18 19.include "${GDBDIR}/Makefile.gdb_arch" 20#GDB_MACHINE_ARCH= ${MACHINE_ARCH:C/e?armv[4-7]h?f?/arm/} 21 22.include "${.CURDIR}/../Makefile.gmakehost" 23 24CCADDFLAGS+= --sysroot=${DESTDIR} -B${DESTDIR}/usr/lib/ -I${.OBJDIR}/.native/gcc/include 25LDADDFLAGS+= -L${DESTDIR}/lib -L${DESTDIR}/usr/lib 26CXXADDFLAGS+= -D__STDC_FORMAT_MACROS 27CXXADDFLAGS+= -D__STDC_LIMIT_MACROS 28CXXADDFLAGS+= -D__STDC_CONSTANT_MACROS 29HOST_CXXFLAGS+= ${CXXADDFLAGS} 30 31NEWCONFIGDIR?= ${.CURDIR}/../.. 32MKNATIVE?= ${.CURDIR}/mknative-gdb 33 34# Some configure tests require running a test program, which is not 35# possible when cross-building. Provide configure with "cached" 36# values in the environment. 37MKNATIVE_CONFIGURE_PRESET= \ 38 ac_cv_prog_cc_cross=yes \ 39 ac_cv_func_fork_works=yes \ 40 ac_cv_func_strcoll_works=yes \ 41 bash_cv_func_ctype_nonascii=yes \ 42 bash_cv_func_sigsetjmp=present \ 43 bash_cv_func_strcoll_broken=no \ 44 bash_cv_must_reinstall_sighandlers=no 45 46CONFIGURE_ENV+= am_cv_func_iconv=no 47 48# Recent versions of Solaris have ncurses, but they hide the lib in an 49# odd directory. Prevent configure from finding the ncurses headers, 50# Solaris curses is sufficient. 51.if ${BUILD_OSTYPE} == "SunOS" 52CONFIGURE_ENV+= ac_cv_header_ncurses_h=no \ 53 ac_cv_header_ncurses_ncurses_h=no \ 54 ac_cv_header_ncurses_term_h=no 55.endif 56 57# Disable sim unless it's known to work (configure's default is to 58# enable sim if supported). 59CONFIGURE_ARGS_SIM= 60.if \ 61 ${MACHINE_CPU} != "powerpc" && \ 62 ${MACHINE_CPU} != "powerpc64" 63CONFIGURE_ARGS_SIM+= --disable-sim 64.endif 65 66native-gdb: .native/.configure_done 67 @echo 'Extracting GDB configury for a native toolchain.' 68 MAKE=${MAKE:Q} ${HOST_SH} ${MKNATIVE} gdb \ 69 ${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM} \ 70 ${GDB_MACHINE_ARCH} 71 72.native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile 73 mkdir ${.OBJDIR}/.native 2>/dev/null || true 74 PATH=${TOOLDIR}/bin:$$PATH; export PATH; \ 75 (cd ${.OBJDIR}/.native && ${CONFIGURE_ENV:NC*:NLD*} \ 76 CC_FOR_BUILD=${HOST_CC:Q} \ 77 CC=${CC:Q}' '${CCADDFLAGS:Q} \ 78 CXX=${CXX:Q}' '${CCADDFLAGS:Q} \ 79 CPP=${CPP:Q}' '-isystem' '${DESTDIR}/usr/include \ 80 CFLAGS= CPPFLAGS= CXXFLAGS=${CXXADDFLAGS:Q} \ 81 LDFLAGS=${LDADDFLAGS:Q} \ 82 MSGFMT=${TOOLDIR}/bin/${_TOOL_PREFIX}msgfmt \ 83 XGETTEXT=${TOOLDIR}/bin/${_TOOL_PREFIX}xgettext \ 84 LIBS=-lintl \ 85 ${MKNATIVE_CONFIGURE_PRESET} \ 86 ${HOST_SH} ${GNUHOSTDIST}/configure \ 87 --prefix=/usr \ 88 --with-separate-debug-dir=/usr/libdata/debug \ 89 ${CONFIGURE_ARGS_SIM} \ 90 --build=`${GNUHOSTDIST}/config.guess` \ 91 --host=${MACHINE_GNU_PLATFORM} \ 92 --target=${MACHINE_GNU_PLATFORM}) && \ 93 (cd ${.OBJDIR}/.native && \ 94 /usr/bin/env ${MKNATIVE_CONFIGURE_PRESET} \ 95 ${MAKE} configure-host) && \ 96 (cd ${.OBJDIR}/.native/bfd && ${MAKE} bfd.h bfdver.h) && \ 97 (cd ${.OBJDIR}/.native/gdb && ${MAKE} init.c version.c) 98 @touch $@ 99 100clean: clean.native 101clean.native: 102 -rm -r -f .native 103