release.sh changes & fixes
[minix3.git] / tools / binutils / Makefile
blobd5f0cd98ff72dcf5532e8b7078cfae164803cb22
1 # $NetBSD: Makefile,v 1.22 2012/04/15 08:37:32 mrg Exp $
3 .include <bsd.own.mk>
5 MODULE= binutils
7 GNUHOSTDIST= ${.CURDIR}/../../external/gpl3/binutils/dist
9 BRANDING?= \
10 --with-pkgversion="NetBSD Binutils nb1" \
11 --with-bugurl="http://www.NetBSD.org/support/send-pr.html" \
12 --with-lib-path="=/usr/lib" --with-sysroot
14 CONFIGURE_ARGS= --target=${MACHINE_GNU_PLATFORM} --disable-nls \
15 --program-transform-name="s,^,${MACHINE_GNU_PLATFORM}-," \
16 --disable-werror \
17 ${BRANDING}
19 MAKE_ARGS= MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q}
21 ALL_TARGET= all-binutils all-gas all-ld
22 INSTALL_TARGET= install-binutils install-gas install-ld
23 .if ${MKCROSSGPROF:Uno} != "no"
24 ALL_TARGET+= all-gprof
25 INSTALL_TARGET+=install-gprof
26 .endif
28 .if defined(__MINIX)
29 ALL_TARGET+= all-gold
30 INSTALL_TARGET+=install-gold
32 CONFIGURE_ARGS+= \
33 --enable-lto \
34 --enable-plugins
35 # LSC: Here we use the MK variable, as we have to select the right default
36 # linker. Problem is, when Gold is not seen, USE_BITCODE is forced to
37 # "no".
38 .if ${MKBITCODE:Uno} == "yes"
39 CONFIGURE_ARGS+= \
40 --enable-ld=yes \
41 --enable-gold=default
42 .else
43 CONFIGURE_ARGS+= \
44 --enable-ld=default \
45 --enable-gold=yes
46 .endif # ${MKBITCODE:Uno} == "yes"
47 .endif # defined(__MINIX)
48 .include "${.CURDIR}/../Makefile.gnuhost"
50 CCADDFLAGS= -I${DESTDIR}/usr/include -L${DESTDIR}/lib -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/
52 # Force avoiding possibly non-executable install-sh.
53 CONFIGURE_ENV+= ac_cv_path_mkdir="${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install -d"
55 NEWCONFIGDIR?= ${.CURDIR}/../..
56 MKNATIVE?= ${.CURDIR}/mknative-binutils
58 native-binutils: .native/.configure_done
59 @echo 'Extracting GNU binutils configury for a native toolchain.'
60 MAKE=${MAKE:Q} ${HOST_SH} ${MKNATIVE} binutils \
61 ${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
63 .native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile
64 mkdir .native 2>/dev/null || true
65 PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
66 (cd .native && ${CONFIGURE_ENV:NC*:NLD*} \
67 CC_FOR_BUILD=${HOST_CC:Q} \
68 CC=${CC:Q}' '${CCADDFLAGS:Q} \
69 CXX=${CXX:Q}' '${CCADDFLAGS:Q} \
70 CPP=${CPP:Q}' '-I${DESTDIR}/usr/include \
71 CFLAGS= CPPFLAGS= CXXFLAGS= LDFLAGS= \
72 MSGFMT=${TOOLDIR}/bin/${_TOOL_PREFIX}msgfmt \
73 XGETTEXT=${TOOLDIR}/bin/${_TOOL_PREFIX}xgettext \
74 LIBS=-lintl \
75 ac_cv_prog_cc_cross=yes \
76 ac_cv_func_strcoll_works=yes \
77 ${HOST_SH} ${GNUHOSTDIST}/configure \
78 --build=`${GNUHOSTDIST}/config.guess` \
79 --host=${MACHINE_GNU_PLATFORM} \
80 --target=${MACHINE_GNU_PLATFORM} \
81 ${BRANDING} \
83 PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
84 (cd .native && ${MAKE} configure-host)
85 PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
86 (cd .native/bfd && ${MAKE} bfd.h bfdver.h)
87 PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
88 (cd .native/ld && ${MAKE} ldemul-list.h)
89 @touch $@
91 clean: clean.native
92 clean.native:
93 -rm -r -f .native