Remove building with NOCRYPTO option
[minix.git] / tools / binutils / Makefile
blobc0b4fa77a5c36346ee27412d753a8d751887f2a4
1 # $NetBSD: Makefile,v 1.24 2014/02/15 13:34:28 tsutsui 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 .if defined(__MINIX) && ! exists(${GNUHOSTDIST}/gas/m68k-parse.c)
20 # MINIX: LSC: Make sure we trigger the fetch rule
21 .include "${.CURDIR}/../../minix/Makefile.fetchgnu"
23 ${GNUHOSTDIST}/gas/m68k-parse.c: ${fetch_done}
24 @true
25 .endif # defined(__MINIX)
27 build/gas/m68k-parse.c: ${GNUHOSTDIST}/gas/m68k-parse.c
28 @mkdir build 2>/dev/null || true
29 @mkdir build/gas 2>/dev/null || true
30 cat ${GNUHOSTDIST}/gas/m68k-parse.c > ${.TARGET}
32 .configure_done: build/gas/m68k-parse.c
34 MAKE_ARGS= MACHINE= MAKEINFO=${TOOL_MAKEINFO:Q}
36 ALL_TARGET= all-binutils all-gas all-ld
37 INSTALL_TARGET= install-binutils install-gas install-ld
38 .if ${MKCROSSGPROF:Uno} != "no"
39 ALL_TARGET+= all-gprof
40 INSTALL_TARGET+=install-gprof
41 .endif
43 .if defined(__MINIX) && ${HAVE_GOLD:Uyes} != "no"
44 ALL_TARGET+= all-gold
45 INSTALL_TARGET+=install-gold
47 CONFIGURE_ARGS+= \
48 --enable-lto \
49 --enable-plugins
50 # LSC: Here we use the MK variable, as we have to select the right default
51 # linker. Problem is, when Gold is not seen, USE_BITCODE is forced to
52 # "no".
53 .if ${MKBITCODE:Uno} == "yes"
54 CONFIGURE_ARGS+= \
55 --enable-ld=yes \
56 --enable-gold=default
57 .else
58 CONFIGURE_ARGS+= \
59 --enable-ld=default \
60 --enable-gold=yes
61 .endif # ${MKBITCODE:Uno} == "yes"
62 .endif # defined(__MINIX)
63 .include "${.CURDIR}/../Makefile.gnuhost"
65 CCADDFLAGS= -I${DESTDIR}/usr/include -L${DESTDIR}/lib -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/
67 # Force avoiding possibly non-executable install-sh.
68 CONFIGURE_ENV+= ac_cv_path_mkdir="${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-install -d"
70 NEWCONFIGDIR?= ${.CURDIR}/../..
71 MKNATIVE?= ${.CURDIR}/mknative-binutils
73 native-binutils: .native/.configure_done
74 @echo 'Extracting GNU binutils configury for a native toolchain.'
75 MAKE=${MAKE:Q} ${HOST_SH} ${MKNATIVE} binutils \
76 ${.OBJDIR}/.native ${NEWCONFIGDIR} ${MACHINE_GNU_PLATFORM}
78 .native/.configure_done: ${_GNU_CFGSRC} ${.CURDIR}/Makefile
79 mkdir .native 2>/dev/null || true
80 PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
81 (cd .native && ${CONFIGURE_ENV:NC*:NLD*} \
82 CC_FOR_BUILD=${HOST_CC:Q} \
83 CC=${CC:Q}' '${CCADDFLAGS:Q} \
84 CXX=${CXX:Q}' '${CCADDFLAGS:Q} \
85 CPP=${CPP:Q}' '-I${DESTDIR}/usr/include \
86 CFLAGS= CPPFLAGS= CXXFLAGS= LDFLAGS= \
87 MSGFMT=${TOOLDIR}/bin/${_TOOL_PREFIX}msgfmt \
88 XGETTEXT=${TOOLDIR}/bin/${_TOOL_PREFIX}xgettext \
89 LIBS=-lintl \
90 ac_cv_prog_cc_cross=yes \
91 ac_cv_func_strcoll_works=yes \
92 ${HOST_SH} ${GNUHOSTDIST}/configure \
93 --build=`${GNUHOSTDIST}/config.guess` \
94 --host=${MACHINE_GNU_PLATFORM} \
95 --target=${MACHINE_GNU_PLATFORM} \
96 ${BRANDING} \
98 PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
99 (cd .native && ${MAKE} configure-host)
100 PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
101 (cd .native/bfd && ${MAKE} bfd.h bfdver.h)
102 PATH=${TOOLDIR}/bin:$$PATH; export PATH; \
103 (cd .native/ld && ${MAKE} ldemul-list.h)
104 @touch $@
106 clean: clean.native
107 clean.native:
108 -rm -r -f .native