2023-01-18 15:52:55 +03:00
|
|
|
# $NetBSD: Makefile,v 1.37 2023/01/18 12:52:55 christos Exp $
|
2003-07-25 20:26:51 +04:00
|
|
|
|
2018-05-01 22:59:42 +03:00
|
|
|
.include <bsd.hostinit.mk>
|
2003-07-25 20:26:51 +04:00
|
|
|
|
2003-11-27 13:12:02 +03:00
|
|
|
MODULE= binutils
|
2003-07-25 20:26:51 +04:00
|
|
|
|
2016-01-26 20:47:35 +03:00
|
|
|
GNUHOSTDIST= ${.CURDIR}/../../external/gpl3/${EXTERNAL_BINUTILS_SUBDIR}/dist
|
2009-08-18 19:08:51 +04:00
|
|
|
|
2009-10-10 14:21:22 +04:00
|
|
|
BRANDING?= \
|
2009-11-21 01:51:29 +03:00
|
|
|
--with-pkgversion="NetBSD Binutils nb1" \
|
2011-03-24 16:33:42 +03:00
|
|
|
--with-bugurl="http://www.NetBSD.org/support/send-pr.html" \
|
|
|
|
--with-lib-path="=/usr/lib" --with-sysroot
|
2009-10-10 14:21:22 +04:00
|
|
|
|
2023-01-18 15:52:55 +03:00
|
|
|
BASE_CONFIGURE_ARGS= \
|
|
|
|
--target=${MACHINE_GNU_PLATFORM} \
|
|
|
|
--enable-initfini-array=yes \
|
|
|
|
--enable-default-execstack=no \
|
|
|
|
${BRANDING}
|
|
|
|
|
|
|
|
CONFIGURE_ARGS= --disable-nls --disable-werror \
|
2009-10-10 14:21:22 +04:00
|
|
|
--program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," \
|
2023-01-18 15:52:55 +03:00
|
|
|
${BASE_CONFIGURE_ARGS}
|
2003-07-25 20:26:51 +04:00
|
|
|
|
2003-11-27 13:12:02 +03:00
|
|
|
MAKE_ARGS= MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q}
|
2003-07-25 20:26:51 +04:00
|
|
|
|
|
|
|
ALL_TARGET= all-binutils all-gas all-ld
|
|
|
|
INSTALL_TARGET= install-binutils install-gas install-ld
|
2006-08-27 11:04:00 +04:00
|
|
|
.if ${MKCROSSGPROF:Uno} != "no"
|
|
|
|
ALL_TARGET+= all-gprof
|
|
|
|
INSTALL_TARGET+=install-gprof
|
|
|
|
.endif
|
2003-07-25 20:26:51 +04:00
|
|
|
|
|
|
|
.include "${.CURDIR}/../Makefile.gnuhost"
|
|
|
|
|
2020-04-04 03:47:30 +03:00
|
|
|
CCADDFLAGS= -I${GNUHOSTDIST}/include -I${DESTDIR}/usr/include
|
|
|
|
CCADDFLAGS+= -B${DESTDIR}/usr/lib/
|
2021-09-18 04:47:07 +03:00
|
|
|
CCADDFLAGS+= ${HOST_CPPFLAGS}
|
2016-10-11 06:57:00 +03:00
|
|
|
LDADDFLAGS= -L${DESTDIR}/lib -L${DESTDIR}/usr/lib
|
2003-07-25 20:26:51 +04:00
|
|
|
|
2012-04-15 12:37:32 +04:00
|
|
|
# Force avoiding possibly non-executable install-sh.
|
|
|
|
CONFIGURE_ENV+= ac_cv_path_mkdir="${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install -d"
|
|
|
|
|
2003-07-25 20:26:51 +04:00
|
|
|
NEWCONFIGDIR?= ${.CURDIR}/../..
|
2003-11-27 13:12:02 +03:00
|
|
|
MKNATIVE?= ${.CURDIR}/mknative-binutils
|
2003-07-25 20:26:51 +04:00
|
|
|
|
|
|
|
native-binutils: .native/.configure_done
|
|
|
|
@echo 'Extracting GNU binutils configury for a native toolchain.'
|
2003-12-04 17:38:00 +03:00
|
|
|
MAKE=${MAKE:Q} ${HOST_SH} ${MKNATIVE} binutils \
|
2003-07-25 20:26:51 +04:00
|
|
|
${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
|
|
|
|
|
|
|
|
.native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile
|
2003-11-27 13:12:02 +03:00
|
|
|
mkdir .native 2>/dev/null || true
|
|
|
|
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
|
2003-07-25 20:26:51 +04:00
|
|
|
(cd .native && ${CONFIGURE_ENV:NC*:NLD*} \
|
|
|
|
CC_FOR_BUILD=${HOST_CC:Q} \
|
|
|
|
CC=${CC:Q}' '${CCADDFLAGS:Q} \
|
|
|
|
CXX=${CXX:Q}' '${CCADDFLAGS:Q} \
|
|
|
|
CPP=${CPP:Q}' '-I${DESTDIR}/usr/include \
|
2016-10-11 06:57:00 +03:00
|
|
|
CFLAGS= CPPFLAGS= CXXFLAGS= \
|
|
|
|
LDFLAGS=${LDADDFLAGS:Q} \
|
2003-07-25 20:26:51 +04:00
|
|
|
MSGFMT=${TOOLDIR}/bin/${_TOOL_PREFIX}msgfmt \
|
|
|
|
XGETTEXT=${TOOLDIR}/bin/${_TOOL_PREFIX}xgettext \
|
|
|
|
LIBS=-lintl \
|
|
|
|
ac_cv_prog_cc_cross=yes \
|
|
|
|
ac_cv_func_strcoll_works=yes \
|
2003-10-26 10:25:33 +03:00
|
|
|
${HOST_SH} ${GNUHOSTDIST}/configure \
|
2003-12-04 17:38:00 +03:00
|
|
|
--build=`${GNUHOSTDIST}/config.guess` \
|
2003-07-25 20:26:51 +04:00
|
|
|
--host=${MACHINE_GNU_PLATFORM} \
|
2023-01-18 15:52:55 +03:00
|
|
|
${BASE_CONFIGURE_ARGS} \
|
2009-10-10 14:21:22 +04:00
|
|
|
)
|
2007-11-19 08:54:03 +03:00
|
|
|
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
|
|
|
|
(cd .native && ${MAKE} configure-host)
|
|
|
|
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
|
|
|
|
(cd .native/bfd && ${MAKE} bfd.h bfdver.h)
|
|
|
|
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
|
2006-02-03 01:03:54 +03:00
|
|
|
(cd .native/ld && ${MAKE} ldemul-list.h)
|
2003-07-25 20:26:51 +04:00
|
|
|
@touch $@
|
|
|
|
|
|
|
|
clean: clean.native
|
|
|
|
clean.native:
|
|
|
|
-rm -r -f .native
|