More gcc80 adjustments.
[dragonfly.git] / gnu / usr.bin / cc80 / Makefile.zhack
1 .if defined(NO_CROSSTOOLS) && defined(BOOTSTRAPPING)
2
3 SCRIPTS=        ${GENTOOLS}
4 GENTOOLS=       cc.sh cpp.sh c++.sh gcc.sh
5 NOMAN=
6 BINDIR?=        ${REALGCC}
7
8 FILES=          cross_specs
9 FILESDIR=       /usr/libexec/gcc80
10
11 REALGCC=        /usr/libexec/gcc80
12 CROSS_SPECS=    ${DESTDIR}/${REALGCC}/cross_specs
13 CSPECS=         --sysroot=${USRDATA_PREFIX} -specs ${CROSS_SPECS}
14 SEDLIB=         s@-L/usr/@-L${USRDATA_PREFIX}/usr/@g
15 SEDSYS=         /--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
24 cross_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
33 CLEANFILES= ${GENTOOLS} cross_specs
34
35 .include <bsd.prog.mk>
36
37 .else
38 # these must be left alone
39 SUBDIR_ORDERED= cc_prep cc_tools
40 SUBDIR=         cc_prep cc_tools
41 .include <bsd.subdir.mk>
42 .endif