[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / tools / gdb

File: [cvs.NetBSD.org] / src / tools / gdb / Makefile (download)

Revision 1.22, Mon Oct 1 19:27:04 2012 UTC (7 years ago) by bouyer
Branch: MAIN
CVS Tags: yamt-pagecache-base9, yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, agc-symver-base, agc-symver
Changes since 1.21: +2 -2 lines

At last on some linux distros, gmake is needed to build the cross-gdb.

#	$NetBSD: Makefile,v 1.22 2012/10/01 19:27:04 bouyer Exp $

.include <bsd.own.mk>

MODULE=		gdb
GNUHOSTDIST=    ${.CURDIR}/../../external/gpl3/gdb/dist

FIND_ARGS=	\! \( -type d -name sim -prune \)

CONFIGURE_ARGS=	--target=${MACHINE_GNU_PLATFORM} --disable-nls \
		--program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-,"

MAKE_ARGS=	MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q}

ALL_TARGET=	all-gdb
INSTALL_TARGET=	install-gdb

.include "${.CURDIR}/../Makefile.gmakehost"

CCADDFLAGS=	--sysroot=${DESTDIR} -L${DESTDIR}/lib -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/ -I${.OBJDIR}/.native/gcc/include

NEWCONFIGDIR?=	${.CURDIR}/../..
MKNATIVE?=	${.CURDIR}/mknative-gdb

# Some configure tests require running a test program, which is not
# possible when cross-building.  Provide configure with "cached"
# values in the environment.
MKNATIVE_CONFIGURE_PRESET= \
	ac_cv_prog_cc_cross=yes \
	ac_cv_func_fork_works=yes \
	ac_cv_func_strcoll_works=yes \
	bash_cv_func_ctype_nonascii=yes \
	bash_cv_func_sigsetjmp=present \
	bash_cv_func_strcoll_broken=no \
	bash_cv_must_reinstall_sighandlers=no

# Recent versions of Solaris have ncurses, but they hide the lib in an
# odd directory. Prevent configure from finding the ncurses headers,
# Solaris curses is sufficient.
.if ${BUILD_OSTYPE} == "SunOS"
CONFIGURE_ENV+=	ac_cv_header_ncurses_h=no \
		ac_cv_header_ncurses_ncurses_h=no \
		ac_cv_header_ncurses_term_h=no
.endif

# Disable sim unless it's known to work (configure's default is to
# enable sim if supported).
CONFIGURE_ARGS_SIM=
.if \
    ${MACHINE_CPU} != "powerpc" && \
    ${MACHINE_CPU} != "powerpc64"
CONFIGURE_ARGS_SIM+= --disable-sim
.endif

native-gdb: .native/.configure_done
	@echo 'Extracting GDB configury for a native toolchain.'
	MAKE=${MAKE:Q} ${HOST_SH} ${MKNATIVE} gdb \
		${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}

.native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile
	mkdir ${.OBJDIR}/.native 2>/dev/null || true
	PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
		(cd ${.OBJDIR}/.native && ${CONFIGURE_ENV:NC*:NLD*} \
			CC_FOR_BUILD=${HOST_CC:Q} \
			CC=${CC:Q}' '${CCADDFLAGS:Q} \
			CXX=${CXX:Q}' '${CCADDFLAGS:Q} \
			CPP=${CPP:Q}' '-isystem' '${DESTDIR}/usr/include \
			CFLAGS= CPPFLAGS= CXXFLAGS= LDFLAGS=${LDADDFLAGS:Q} \
			MSGFMT=${TOOLDIR}/bin/${_TOOL_PREFIX}msgfmt \
			XGETTEXT=${TOOLDIR}/bin/${_TOOL_PREFIX}xgettext \
			LIBS=-lintl \
			${MKNATIVE_CONFIGURE_PRESET} \
			${HOST_SH} ${GNUHOSTDIST}/configure \
			--prefix=/usr \
			--with-separate-debug-dir=/usr/libdata/debug \
			${CONFIGURE_ARGS_SIM} \
			--build=`${GNUHOSTDIST}/config.guess` \
			--host=${MACHINE_GNU_PLATFORM} \
			--target=${MACHINE_GNU_PLATFORM}) && \
		(cd ${.OBJDIR}/.native && \
			/usr/bin/env ${MKNATIVE_CONFIGURE_PRESET} \
				${MAKE} configure-host) && \
		(cd ${.OBJDIR}/.native/bfd && ${MAKE} bfd.h bfdver.h) && \
		(cd ${.OBJDIR}/.native/gdb && ${MAKE} init.c version.c)
	@touch $@

clean: clean.native
clean.native:
	-rm -r -f .native