2003-03-05 09:17:17 +03:00
|
|
|
# $NetBSD: Makefile,v 1.26 2003/03/05 06:17:17 mrg Exp $
|
2001-08-14 15:01:55 +04:00
|
|
|
|
2001-11-13 02:16:17 +03:00
|
|
|
.include <bsd.own.mk>
|
2001-08-14 15:01:55 +04:00
|
|
|
|
2001-11-13 02:16:17 +03:00
|
|
|
MODULE= toolchain
|
2001-08-14 15:01:55 +04:00
|
|
|
|
2001-11-13 02:16:17 +03:00
|
|
|
FIND_ARGS= \! \( -type d -name sim -prune \)
|
2001-08-14 15:01:55 +04:00
|
|
|
|
2002-02-27 01:31:59 +03:00
|
|
|
CONFIGURE_ENV= LANGUAGES="c c++ objc f77"
|
2001-11-15 01:13:39 +03:00
|
|
|
CONFIGURE_ARGS= --target=${MACHINE_GNU_PLATFORM} --disable-nls \
|
|
|
|
--program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-,"
|
2001-08-14 15:01:55 +04:00
|
|
|
|
2002-01-31 18:25:08 +03:00
|
|
|
MAKE_ARGS= MACHINE= MAKEINFO=${MAKEINFO:Q} \
|
2001-11-13 17:49:00 +03:00
|
|
|
LIBGCC= LIBGCC1= LIBGCC1_TEST= LIBGCC2= INSTALL_LIBGCC=
|
2001-08-14 15:01:55 +04:00
|
|
|
|
2001-11-13 02:16:17 +03:00
|
|
|
ALL_TARGET= all-binutils all-gas all-ld all-gcc
|
2001-11-15 03:20:26 +03:00
|
|
|
INSTALL_TARGET= install-binutils install-gas install-ld install-gcc
|
2001-08-14 15:01:55 +04:00
|
|
|
|
2001-11-13 02:16:17 +03:00
|
|
|
.if ${MKCROSSGDB:Uno} == "yes"
|
|
|
|
ALL_TARGET+= all-gdb
|
|
|
|
INSTALL_TARGET+=install-gdb
|
|
|
|
.endif
|
2001-08-14 15:01:55 +04:00
|
|
|
|
2002-02-27 01:31:59 +03:00
|
|
|
.include "${.CURDIR}/../Makefile.gnuhost"
|
|
|
|
|
|
|
|
CCADDFLAGS= -I${DESTDIR}/usr/include -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/
|
|
|
|
|
2003-03-01 16:09:09 +03:00
|
|
|
NEWCONFIGDIR?= ${.CURDIR}/../..
|
|
|
|
|
2002-02-12 00:24:09 +03:00
|
|
|
bootstrap-libgcc: .configure_done
|
|
|
|
@echo 'Creating files needed for libgcc by a native bootstrap build.'
|
2002-02-27 01:31:59 +03:00
|
|
|
@MAKE=${MAKE:Q} sh ${.CURDIR}/mknative libgcc \
|
2003-03-01 16:09:09 +03:00
|
|
|
${.OBJDIR}/build ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
|
2002-02-12 00:24:09 +03:00
|
|
|
|
2002-02-27 01:31:59 +03:00
|
|
|
native: .native/.configure_done
|
|
|
|
@echo 'Extracting GNU configury for a native toolchain.'
|
2003-03-01 16:09:09 +03:00
|
|
|
@MAKE=${MAKE:Q} sh ${.CURDIR}/mknative all \
|
|
|
|
${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
|
2002-02-27 01:31:59 +03:00
|
|
|
|
2003-03-05 09:17:17 +03:00
|
|
|
native-binutils: .native/.configure_done
|
2003-03-05 08:28:29 +03:00
|
|
|
@echo 'Extracting GNU binutils configury for a native toolchain.'
|
|
|
|
@MAKE=${MAKE:Q} sh ${.CURDIR}/mknative binutils \
|
|
|
|
${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
|
|
|
|
|
2003-03-05 09:17:17 +03:00
|
|
|
native-gcc: .native/.configure_done
|
2003-03-05 08:28:29 +03:00
|
|
|
@echo 'Extracting GNU GCC configury for a native toolchain.'
|
|
|
|
@MAKE=${MAKE:Q} sh ${.CURDIR}/mknative gcc \
|
|
|
|
${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
|
|
|
|
|
2003-03-05 09:17:17 +03:00
|
|
|
native-gdb: .native/.configure_done
|
2003-03-05 08:28:29 +03:00
|
|
|
@echo 'Extracting GNU GDB configury for a native toolchain.'
|
|
|
|
@MAKE=${MAKE:Q} sh ${.CURDIR}/mknative gdb \
|
|
|
|
${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
|
|
|
|
|
2002-02-27 07:43:22 +03:00
|
|
|
.native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile
|
2002-02-27 01:31:59 +03:00
|
|
|
@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= \
|
2002-12-08 23:19:56 +03:00
|
|
|
MSGFMT=${TOOLDIR}/bin/${_TOOL_PREFIX}msgfmt \
|
|
|
|
XGETTEXT=${TOOLDIR}/bin/${_TOOL_PREFIX}xgettext \
|
2002-02-27 01:31:59 +03:00
|
|
|
LIBS=-lintl \
|
|
|
|
ac_cv_prog_cc_cross=yes \
|
|
|
|
ac_cv_func_strcoll_works=yes \
|
|
|
|
gcc_cv_func_printf_ptr=yes \
|
|
|
|
gdb_cv_printf_has_long_double=yes \
|
|
|
|
gdb_cv_printf_has_long_long=yes \
|
|
|
|
gdb_cv_scanf_has_long_double=yes \
|
2003-02-07 04:52:51 +03:00
|
|
|
sh ${GNUHOSTDIST}/configure \
|
2002-02-27 01:31:59 +03:00
|
|
|
--build=`${.CURDIR}/../../gnu/dist/toolchain/config.guess` \
|
|
|
|
--host=${MACHINE_GNU_PLATFORM} \
|
|
|
|
--target=${MACHINE_GNU_PLATFORM}) && \
|
|
|
|
(cd .native/bfd && ${MAKE} bfd.h) && \
|
|
|
|
(cd .native/gcc && ${MAKE} tree-check.h HOST_CC=${HOST_CC:Q}) && \
|
|
|
|
(cd .native/ld && ${MAKE} ldemul-list.h) && \
|
|
|
|
(cd .native && touch gcc/cc1obj gcc/cc1plus gcc/f771 && \
|
|
|
|
${MAKE} configure-target-libiberty \
|
|
|
|
configure-target-libf2c configure-target-libobjc \
|
|
|
|
configure-target-libio configure-target-libstdc++ \
|
|
|
|
ALL_GCC_C= ALL_GCC_CXX= \
|
|
|
|
CC_FOR_TARGET=${CC:Q}' '${CCADDFLAGS:Q} \
|
|
|
|
CXX_FOR_TARGET=${CXX:Q}' '${CCADDFLAGS:Q} \
|
|
|
|
CPP=${CPP:Q}' '-I${DESTDIR}/usr/include) && \
|
|
|
|
(cd .native/${MACHINE_GNU_PLATFORM}/libio && \
|
|
|
|
${MAKE} _G_config.h)
|
|
|
|
(cd .native/${MACHINE_GNU_PLATFORM}/libiberty && \
|
|
|
|
${MAKE} needed-list)
|
|
|
|
@touch $@
|
|
|
|
|
|
|
|
clean: clean.native
|
|
|
|
clean.native:
|
|
|
|
-rm -r -f .native
|