NetBSD/tools/binutils/Makefile

79 lines
2.5 KiB
Makefile
Raw Normal View History

# $NetBSD: Makefile,v 1.36 2022/12/31 05:44:25 mrg Exp $
.include <bsd.hostinit.mk>
MODULE= binutils
2016-01-26 20:47:35 +03:00
GNUHOSTDIST= ${.CURDIR}/../../external/gpl3/${EXTERNAL_BINUTILS_SUBDIR}/dist
2009-10-10 14:21:22 +04:00
BRANDING?= \
--with-pkgversion="NetBSD Binutils nb1" \
--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
CONFIGURE_ARGS= --target=${MACHINE_GNU_PLATFORM} --disable-nls \
2009-10-10 14:21:22 +04:00
--program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," \
--disable-werror --enable-initfini-array=yes \
2009-10-10 14:21:22 +04:00
${BRANDING}
MAKE_ARGS= MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q}
ALL_TARGET= all-binutils all-gas all-ld
INSTALL_TARGET= install-binutils install-gas install-ld
.if ${MKCROSSGPROF:Uno} != "no"
ALL_TARGET+= all-gprof
INSTALL_TARGET+=install-gprof
.endif
.include "${.CURDIR}/../Makefile.gnuhost"
CCADDFLAGS= -I${GNUHOSTDIST}/include -I${DESTDIR}/usr/include
CCADDFLAGS+= -B${DESTDIR}/usr/lib/
CCADDFLAGS+= ${HOST_CPPFLAGS}
LDADDFLAGS= -L${DESTDIR}/lib -L${DESTDIR}/usr/lib
# Force avoiding possibly non-executable install-sh.
CONFIGURE_ENV+= ac_cv_path_mkdir="${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install -d"
NEWCONFIGDIR?= ${.CURDIR}/../..
MKNATIVE?= ${.CURDIR}/mknative-binutils
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 \
${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
.native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile
mkdir .native 2>/dev/null || true
PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
(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 \
CFLAGS= CPPFLAGS= CXXFLAGS= \
LDFLAGS=${LDADDFLAGS:Q} \
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 \
${HOST_SH} ${GNUHOSTDIST}/configure \
2003-12-04 17:38:00 +03:00
--build=`${GNUHOSTDIST}/config.guess` \
--host=${MACHINE_GNU_PLATFORM} \
2009-10-10 14:21:22 +04:00
--target=${MACHINE_GNU_PLATFORM} \
--enable-initfini-array=yes \
2009-10-10 14:21:22 +04:00
${BRANDING} \
)
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)
@touch $@
clean: clean.native
clean.native:
-rm -r -f .native