Makefile revision 1.31
11.31Sjmcneill# $NetBSD: Makefile,v 1.31 2017/07/01 12:23:09 jmcneill Exp $ 21.1Scl 31.1Scl.include <bsd.own.mk> 41.1Scl 51.19SchristosMODULE= gdb 61.30SmrgGDBDIR= ${.CURDIR}/../../external/gpl3/${EXTERNAL_GDB_SUBDIR} 71.30SmrgGNUHOSTDIST= ${GDBDIR}/dist 81.1Scl 91.1SclFIND_ARGS= \! \( -type d -name sim -prune \) 101.1Scl 111.1SclCONFIGURE_ARGS= --target=${MACHINE_GNU_PLATFORM} --disable-nls \ 121.1Scl --program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," 131.1Scl 141.1SclMAKE_ARGS= MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q} 151.1Scl 161.1SclALL_TARGET= all-gdb 171.1SclINSTALL_TARGET= install-gdb 181.1Scl 191.30Smrg.include "${GDBDIR}/Makefile.gdb_arch" 201.30Smrg#GDB_MACHINE_ARCH= ${MACHINE_ARCH:C/e?armv[4-7]h?f?/arm/} 211.30Smrg 221.22Sbouyer.include "${.CURDIR}/../Makefile.gmakehost" 231.1Scl 241.29SchristosCCADDFLAGS+= --sysroot=${DESTDIR} -B${DESTDIR}/usr/lib/ -I${.OBJDIR}/.native/gcc/include 251.29SchristosLDADDFLAGS+= -L${DESTDIR}/lib -L${DESTDIR}/usr/lib 261.28SchristosCXXADDFLAGS+= -D__STDC_FORMAT_MACROS 271.28SchristosCXXADDFLAGS+= -D__STDC_LIMIT_MACROS 281.28SchristosCXXADDFLAGS+= -D__STDC_CONSTANT_MACROS 291.29SchristosHOST_CXXFLAGS+= ${CXXADDFLAGS} 301.2Snathanw 311.2SnathanwNEWCONFIGDIR?= ${.CURDIR}/../.. 321.2SnathanwMKNATIVE?= ${.CURDIR}/mknative-gdb 331.2Snathanw 341.7Suwe# Some configure tests require running a test program, which is not 351.7Suwe# possible when cross-building. Provide configure with "cached" 361.7Suwe# values in the environment. 371.7SuweMKNATIVE_CONFIGURE_PRESET= \ 381.7Suwe ac_cv_prog_cc_cross=yes \ 391.7Suwe ac_cv_func_fork_works=yes \ 401.7Suwe ac_cv_func_strcoll_works=yes \ 411.7Suwe bash_cv_func_ctype_nonascii=yes \ 421.7Suwe bash_cv_func_sigsetjmp=present \ 431.7Suwe bash_cv_func_strcoll_broken=no \ 441.7Suwe bash_cv_must_reinstall_sighandlers=no 451.7Suwe 461.31SjmcneillCONFIGURE_ENV+= am_cv_func_iconv=no 471.31Sjmcneill 481.17Shans# Recent versions of Solaris have ncurses, but they hide the lib in an 491.17Shans# odd directory. Prevent configure from finding the ncurses headers, 501.17Shans# Solaris curses is sufficient. 511.17Shans.if ${BUILD_OSTYPE} == "SunOS" 521.17ShansCONFIGURE_ENV+= ac_cv_header_ncurses_h=no \ 531.17Shans ac_cv_header_ncurses_ncurses_h=no \ 541.17Shans ac_cv_header_ncurses_term_h=no 551.17Shans.endif 561.17Shans 571.8Suwe# Disable sim unless it's known to work (configure's default is to 581.8Suwe# enable sim if supported). 591.8SuweCONFIGURE_ARGS_SIM= 601.8Suwe.if \ 611.9Sskrll ${MACHINE_CPU} != "powerpc" && \ 621.8Suwe ${MACHINE_CPU} != "powerpc64" 631.8SuweCONFIGURE_ARGS_SIM+= --disable-sim 641.8Suwe.endif 651.8Suwe 661.2Snathanwnative-gdb: .native/.configure_done 671.2Snathanw @echo 'Extracting GDB configury for a native toolchain.' 681.2Snathanw MAKE=${MAKE:Q} ${HOST_SH} ${MKNATIVE} gdb \ 691.30Smrg ${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM} \ 701.30Smrg ${GDB_MACHINE_ARCH} 711.2Snathanw 721.2Snathanw.native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile 731.3Snathanw mkdir ${.OBJDIR}/.native 2>/dev/null || true 741.2Snathanw PATH=${TOOLDIR}/bin:$$PATH; export PATH; \ 751.3Snathanw (cd ${.OBJDIR}/.native && ${CONFIGURE_ENV:NC*:NLD*} \ 761.2Snathanw CC_FOR_BUILD=${HOST_CC:Q} \ 771.2Snathanw CC=${CC:Q}' '${CCADDFLAGS:Q} \ 781.2Snathanw CXX=${CXX:Q}' '${CCADDFLAGS:Q} \ 791.6Suwe CPP=${CPP:Q}' '-isystem' '${DESTDIR}/usr/include \ 801.28Schristos CFLAGS= CPPFLAGS= CXXFLAGS=${CXXADDFLAGS:Q} \ 811.28Schristos LDFLAGS=${LDADDFLAGS:Q} \ 821.2Snathanw MSGFMT=${TOOLDIR}/bin/${_TOOL_PREFIX}msgfmt \ 831.2Snathanw XGETTEXT=${TOOLDIR}/bin/${_TOOL_PREFIX}xgettext \ 841.2Snathanw LIBS=-lintl \ 851.7Suwe ${MKNATIVE_CONFIGURE_PRESET} \ 861.2Snathanw ${HOST_SH} ${GNUHOSTDIST}/configure \ 871.4Snathanw --prefix=/usr \ 881.5Slukem --with-separate-debug-dir=/usr/libdata/debug \ 891.8Suwe ${CONFIGURE_ARGS_SIM} \ 901.2Snathanw --build=`${GNUHOSTDIST}/config.guess` \ 911.2Snathanw --host=${MACHINE_GNU_PLATFORM} \ 921.2Snathanw --target=${MACHINE_GNU_PLATFORM}) && \ 931.7Suwe (cd ${.OBJDIR}/.native && \ 941.7Suwe /usr/bin/env ${MKNATIVE_CONFIGURE_PRESET} \ 951.7Suwe ${MAKE} configure-host) && \ 961.3Snathanw (cd ${.OBJDIR}/.native/bfd && ${MAKE} bfd.h bfdver.h) && \ 971.3Snathanw (cd ${.OBJDIR}/.native/gdb && ${MAKE} init.c version.c) 981.2Snathanw @touch $@ 991.2Snathanw 1001.2Snathanwclean: clean.native 1011.2Snathanwclean.native: 1021.2Snathanw -rm -r -f .native 103