Makefile revision 1.10
1#	$NetBSD: Makefile,v 1.10 2006/02/02 22:03:54 skrll Exp $
2
3.include <bsd.own.mk>
4
5MODULE=		binutils
6
7CONFIGURE_ARGS=	--target=${MACHINE_GNU_PLATFORM} --disable-nls \
8		--program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-,"
9
10MAKE_ARGS=	MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q}
11
12ALL_TARGET=	all-binutils all-gas all-ld
13INSTALL_TARGET=	install-binutils install-gas install-ld
14
15.include "${.CURDIR}/../Makefile.gnuhost"
16
17CCADDFLAGS=	-I${DESTDIR}/usr/include -L${DESTDIR}/lib -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/
18
19NEWCONFIGDIR?=	${.CURDIR}/../..
20MKNATIVE?=	${.CURDIR}/mknative-binutils
21
22native-binutils: .native/.configure_done
23	@echo 'Extracting GNU binutils configury for a native toolchain.'
24	MAKE=${MAKE:Q} ${HOST_SH} ${MKNATIVE} binutils \
25		${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
26
27.native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile
28	mkdir .native 2>/dev/null || true
29	PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
30		(cd .native && ${CONFIGURE_ENV:NC*:NLD*} \
31			CC_FOR_BUILD=${HOST_CC:Q} \
32			CC=${CC:Q}' '${CCADDFLAGS:Q} \
33			CXX=${CXX:Q}' '${CCADDFLAGS:Q} \
34			CPP=${CPP:Q}' '-I${DESTDIR}/usr/include \
35			CFLAGS= CPPFLAGS= CXXFLAGS= LDFLAGS= \
36			MSGFMT=${TOOLDIR}/bin/${_TOOL_PREFIX}msgfmt \
37			XGETTEXT=${TOOLDIR}/bin/${_TOOL_PREFIX}xgettext \
38			LIBS=-lintl \
39			ac_cv_prog_cc_cross=yes \
40			ac_cv_func_strcoll_works=yes \
41			${HOST_SH} ${GNUHOSTDIST}/configure \
42			--build=`${GNUHOSTDIST}/config.guess` \
43			--host=${MACHINE_GNU_PLATFORM} \
44			--target=${MACHINE_GNU_PLATFORM}) && \
45		(cd .native && ${MAKE} configure-host) && \
46		(cd .native/bfd && ${MAKE} bfd.h bfdver.h) && \
47		(cd .native/ld && ${MAKE} ldemul-list.h)
48	@touch $@
49
50clean: clean.native
51clean.native:
52	-rm -r -f .native
53