xref: /dragonfly/gnu/usr.bin/cc47/Makefile.zhack (revision ed183f8c)
1.if defined(NO_CROSSTOOLS) && defined(BOOTSTRAPPING)
2
3SCRIPTS=	${GENTOOLS}
4GENTOOLS=	cc.sh cpp.sh c++.sh gcc.sh
5NOMAN=
6BINDIR?=	${REALGCC}
7
8FILES=		cross_specs
9FILESDIR=	/usr/libexec/gcc47
10
11REALGCC=	/usr/libexec/gcc47
12CROSS_SPECS=	${DESTDIR}/${REALGCC}/cross_specs
13CSPECS=		--sysroot=${USRDATA_PREFIX} -specs ${CROSS_SPECS}
14SEDLIB=		s@-L/usr/@-L${USRDATA_PREFIX}/usr/@g
15SEDSYS=		/--eh-frame/s@^@--sysroot=${USRDATA_PREFIX} @g
16
17.for _tool in ${GENTOOLS}
18${_tool}:
19	echo "#!/bin/sh" > ${.TARGET}
20	echo "" >> ${.TARGET}
21	echo "exec ${REALGCC}/${.TARGET:T:R} ${CSPECS}" '"$$@"' >> ${.TARGET}
22.endfor
23
24cross_specs:
25	echo "*link:" > ${.TARGET}
26	${REALGCC}/cc -dumpspecs | grep eh-frame-hdr | sed \
27	    -e "${SEDLIB}" -e "${SEDSYS}" >> ${.TARGET}
28
29.if !defined(DESTDIR) || ${DESTDIR} == "" || ${DESTDIR} == "/"
30.error "refusing to install wrappers to base"
31.endif
32
33CLEANFILES= ${GENTOOLS} cross_specs
34
35.include <bsd.prog.mk>
36
37.else
38# these must be left alone
39SUBDIR_ORDERED=	cc_prep cc_tools
40SUBDIR=		cc_prep cc_tools
41.include <bsd.subdir.mk>
42.endif
43