1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-22 07:27:59 -08:00
openbsd-src/Makefile.cross

478 lines
18 KiB
Makefile
Raw Normal View History

# $OpenBSD: Makefile.cross,v 1.56 2012/08/23 06:22:51 deraadt Exp $
cross-tools: cross-includes cross-binutils cross-gcc cross-lib
cross-distrib: cross-tools cross-bin cross-share cross-sys cross-etc-root-var
# cross-gnu \
# Have to compute TARGET_ARCH directly in the Makefile, for .if tests involving
# this variable to work.
.if (${TARGET} == "armish" || ${TARGET} == "beagle" || \
2010-05-31 10:38:03 -07:00
${TARGET} == "gumstix" || ${TARGET} == "palm" || \
${TARGET} == "zaurus")
TARGET_ARCH= arm
2012-06-20 11:45:44 -07:00
.elif (${TARGET} == "hp300" || ${TARGET} == "mvme68k")
TARGET_ARCH= m68k
.elif (${TARGET} == "aviion" || ${TARGET} == "luna88k" || \
${TARGET} == "mvme88k")
TARGET_ARCH= m88k
.elif (${TARGET} == "sgi" || ${TARGET} == "octeon")
TARGET_ARCH= mips64
.elif (${TARGET} == "loongson")
TARGET_ARCH= mips64el
TARGET_CPU= mips64
.elif (${TARGET} == "solbourne")
TARGET_ARCH= sparc
.elif (${TARGET} == "macppc" || ${TARGET} == "socppc")
TARGET_ARCH= powerpc
.elif (${TARGET} == "landisk")
TARGET_ARCH= sh
.else
TARGET_ARCH= ${TARGET}
.endif
TARGET_CPU?= ${TARGET_ARCH}
# List of LP64 archs
# XXX move to bsd.*.mk?
LP64_ARCH = amd64 alpha hppa64 ia64 mips64 sparc64 vax64
TARGET_IS_LP64 =
MACHINE_IS_LP64 =
.for _ in ${LP64_ARCH}
. if !empty(TARGET_ARCH:M$_)
TARGET_IS_LP64 = yes
. endif
. if !empty(MACHINE_ARCH:M$_)
MACHINE_IS_LP64 = yes
. endif
.endfor
#CROSSCPPFLAGS?= -nostdinc -I${CROSSDIR}/usr/include
#CROSSLDFLAGS?= -nostdlib -L${CROSSDIR}/usr/lib -static
CROSSCFLAGS?= ${CROSSCPPFLAGS} -O2 ${PIPE} ${DEBUG}
CROSSCXXFLAGS?= ${CROSSCPPFLAGS}
#LDSTATIC?= -static
# XXX
BINMODE?=555
BINOWN?=root
2011-06-16 03:09:51 -07:00
BINGRP?=bin
CROSSDIR= ${DESTDIR}/usr/cross/${TARGET}
CROSSENV= AR=${CROSSDIR}/usr/${TARGET_CANON}/bin/ar \
AS=${CROSSDIR}/usr/${TARGET_CANON}/bin/as \
CC=${CROSSDIR}/usr/${TARGET_CANON}/bin/cc \
CPP=${CROSSDIR}/usr/${TARGET_CANON}/bin/cpp \
CXX=${CROSSDIR}/usr/${TARGET_CANON}/bin/c++ \
LD=${CROSSDIR}/usr/${TARGET_CANON}/bin/ld \
OBJCOPY=${CROSSDIR}/usr/${TARGET_CANON}/bin/objcopy \
LORDER=/usr/bin/lorder RANLIB=${CROSSDIR}/usr/${TARGET_CANON}/bin/ranlib \
STRIP=${CROSSDIR}/usr/${TARGET_CANON}/bin/strip \
HOSTCC=\"${CC}\" HOSTCXX=\"${CXX}\" NOMAN= \
HOSTCFLAGS=\"${CFLAGS}\" HOSTCXXFLAGS=\"${CXXFLAGS}\" \
HOSTLDFLAGS=\"${LDFLAGS}\" \
CFLAGS=\"${CROSSCFLAGS}\" CPPFLAGS=\"${CROSSCPPFLAGS}\" \
CXXFLAGS=\"${CROSSCXXFLAGS}\" \
LDFLAGS=\"${CROSSLDFLAGS}\"
CROSSADDPATH=:${CROSSDIR}/usr/${TARGET_CANON}/bin
CROSSPATH= /usr/bin:/bin:/usr/sbin:/sbin${CROSSADDPATH}
CROSSLANGS?= c c++
TARGET_CANON=`cat ${CROSSDIR}/TARGET_CANON`
CROSSDIRS= ${CROSSDIR}/.dirs_done
CROSSOBJ= ${CROSSDIR}/.obj_done
CROSSINCLUDES= ${CROSSDIR}/.includes_done
CROSSBINUTILS= ${CROSSDIR}/.binutils_done
CROSSGCC= ${CROSSDIR}/.gcc_done
#NO_CROSS= isakmpd keynote ssh
.include <bsd.own.mk>
OLD_BINUTILS_ARCH=m68k m88k vax
.for _arch in ${TARGET_ARCH}
.if !empty(GCC2_ARCH:M${_arch})
COMPILER_VERSION?=gcc2
.elif !empty(GCC4_ARCH:M${_arch})
COMPILER_VERSION?=gcc4
.else
COMPILER_VERSION?=gcc3
.endif
.if !empty(BINUTILS217_ARCH:M${_arch})
BINUTILS_VERSION=binutils-2.17
.else
BINUTILS_VERSION=binutils
.endif
.if !empty(OLD_BINUTILS_ARCH:M${_arch})
NEW_BINUTILS?= No
BINUTILS= ar as ld nm ranlib objcopy objdump strings strip
.else
NEW_BINUTILS?= Yes
BINUTILS= ar as gasp ld nm objcopy objdump ranlib readelf size \
strings strip
.endif
BINUTILS_DIR=gnu/usr.bin/${BINUTILS_VERSION}
.endfor
# no libcrypto.... these won't build
#NO_CROSS+= dc login_krb5 login_krb5-or-pwd passwd ppp tcpdump telnet \
# ftp gzsig sasyncd vnconfig
# explicit cross-compile
NO_CROSS+=bind
NO_CROSS+=httpd
NO_CROSS+=microcode
NO_CROSS+=groff lynx binutils binutils-2.17 perl texinfo gcc cvs
NO_CROSS+=nsd
NO_CROSS+=nginx
NO_CROSS+=sqlite3
cross-dirs: ${CROSSDIRS}
cross-obj: ${CROSSOBJ}
cross-includes: ${CROSSINCLUDES}
cross-binutils: ${CROSSBINUTILS}
cross-gcc: ${CROSSGCC}
cross-env:
@echo ${CROSSENV} MACHINE=${TARGET} \
MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \
MACHINE_CPU=`cat ${CROSSDIR}/TARGET_CPU` \
BSDOBJDIR=${CROSSDIR}/usr/obj \
BSDSRCDIR=${.CURDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET}
${CROSSDIRS}:
.if ${TARGET_ARCH} == "arm" && ${MACHINE_IS_LP64} == "yes"
# this config is allowed
.elif ${TARGET_IS_LP64} != ${MACHINE_IS_LP64}
@echo "host and target have different size longs"
@echo "cross compiler generates bad code; aborting"; exit 1
.endif
@-mkdir -p ${CROSSDIR}
@echo ${TARGET_ARCH} > ${CROSSDIR}/TARGET_ARCH
@echo TARGET_ARCH is `cat ${CROSSDIR}/TARGET_ARCH`
@echo ${TARGET_CPU} > ${CROSSDIR}/TARGET_CPU
@echo TARGET_CPU is `cat ${CROSSDIR}/TARGET_CPU`
@eval `grep '^osr=' sys/conf/newvers.sh`; \
echo ${TARGET_ARCH}-unknown-openbsd$$osr > \
${CROSSDIR}/TARGET_CANON
@-mkdir -p ${CROSSDIR}
@-mkdir -p ${CROSSDIR}/usr/${TARGET_CANON}
@ln -sf ${CROSSDIR}/usr/include \
${CROSSDIR}/usr/${TARGET_CANON}/include
@ln -sf ${CROSSDIR}/usr/lib \
${CROSSDIR}/usr/${TARGET_CANON}/lib
@-mkdir -p ${CROSSDIR}/usr/${TARGET_CANON}/bin
@(cd ${.CURDIR}/etc && DESTDIR=${CROSSDIR} ${MAKE} distrib-dirs)
@touch ${CROSSDIRS}
${CROSSOBJ}: ${CROSSDIRS}
@-mkdir -p ${CROSSDIR}/usr/obj
@(cd ${.CURDIR} && \
BSDOBJDIR=${CROSSDIR}/usr/obj \
COMPILER_VERSION=${COMPILER_VERSION} \
MACHINE=${TARGET} \
MACHINE_ARCH=${TARGET_ARCH} MACHINE_CPU=${TARGET_CPU} \
BSDSRCDIR=${.CURDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
${MAKE} obj)
@touch ${CROSSOBJ}
${CROSSINCLUDES}: ${CROSSOBJ}
@-mkdir -p ${CROSSDIR}/usr/include
@(cd ${.CURDIR}/include && \
COMPILER_VERSION=${COMPILER_VERSION} \
MACHINE=${TARGET} \
MACHINE_ARCH=${TARGET_ARCH} MACHINE_CPU=${TARGET_CPU} \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
${MAKE} prereq && \
COMPILER_VERSION=${COMPILER_VERSION} \
MACHINE=${TARGET} \
MACHINE_ARCH=${TARGET_ARCH} MACHINE_CPU=${TARGET_CPU} \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
${MAKE} DESTDIR=${CROSSDIR} includes)
@touch ${CROSSINCLUDES}
${CROSSBINUTILS}: ${CROSSINCLUDES}
(cd ${.CURDIR}/${BINUTILS_DIR}; \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
USING_NEW_BINUTILS=${NEW_BINUTILS} \
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
PATH=${CROSSPATH} \
${MAKE} -f Makefile.bsd-wrapper depend && \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
USING_NEW_BINUTILS=${NEW_BINUTILS} \
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
${MAKE} -f Makefile.bsd-wrapper all && \
DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
COMPILER_VERSION=${COMPILER_VERSION} \
USING_NEW_BINUTILS=${NEW_BINUTILS} \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
USING_NEW_BINUTILS=${NEW_BINUTILS} \
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
${MAKE} -f Makefile.bsd-wrapper install)
.if ${NEW_BINUTILS:L} != "yes"
(cd ${.CURDIR}/gnu/usr.bin/gas; \
TARGET_MACHINE_ARCH=${TARGET_ARCH} \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} ${MAKE} depend all; \
TARGET_MACHINE_ARCH=${TARGET_ARCH} \
DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
${MAKE} NOMAN= install)
ln -sf ${CROSSDIR}/usr/bin/as \
2005-09-11 16:08:30 -07:00
${CROSSDIR}/usr/${TARGET_CANON}/bin/as
(cd ${.CURDIR}/gnu/usr.bin/ld; \
TARGET_MACHINE_ARCH=${TARGET_ARCH} \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
${MAKE} NOPIC= NOMAN= depend all; \
TARGET_MACHINE_ARCH=${TARGET_ARCH} \
DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
${MAKE} NOPIC= NOMAN= install)
ln -sf ${CROSSDIR}/usr/bin/ld \
${CROSSDIR}/usr/${TARGET_CANON}/bin/ld
(cd ${.CURDIR}/usr.bin/ar; \
ELF_TOOLCHAIN=no \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} ${MAKE} NOMAN= depend all; \
ELF_TOOLCHAIN=no \
DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
${MAKE} NOMAN= install)
ln -sf ${CROSSDIR}/usr/bin/ar \
${CROSSDIR}/usr/${TARGET_CANON}/bin/ar
@(cd ${.CURDIR}/usr.bin/ranlib; \
ELF_TOOLCHAIN=no \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} ${MAKE} NOMAN= depend all; \
ELF_TOOLCHAIN=no \
DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
${MAKE} NOMAN= install)
ln -sf ${CROSSDIR}/usr/bin/ranlib \
${CROSSDIR}/usr/${TARGET_CANON}/bin/ranlib
(cd ${.CURDIR}/usr.bin/strip; \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
${MAKE} TARGET_MACHINE_ARCH=${TARGET_ARCH} \
NOMAN= depend all; \
DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
${MAKE} TARGET_MACHINE_ARCH=${TARGET_ARCH} \
NOMAN= install)
ln -sf ${CROSSDIR}/usr/bin/strip \
${CROSSDIR}/usr/${TARGET_CANON}/bin/strip
.endif
@for cmd in ${BINUTILS}; do \
if [ -e ${CROSSDIR}/usr/bin/${TARGET_CANON}-$$cmd ] ; then \
cp -f ${CROSSDIR}/usr/bin/${TARGET_CANON}-$$cmd \
${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-$$cmd ; \
ln -sf ${TARGET_CANON}-$$cmd \
${CROSSDIR}/usr/${TARGET_CANON}/bin/$$cmd ;\
if [ -e ${CROSSDIR}/usr/bin/$$cmd ] ; then \
rm -f ${CROSSDIR}/usr/bin/$$cmd ;\
fi ;\
elif [ -e ${CROSSDIR}/usr/bin/$$cmd ] ; then \
cp -f ${CROSSDIR}/usr/bin/$$cmd \
${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-$$cmd ; \
ln -sf ${TARGET_CANON}-$$cmd \
${CROSSDIR}/usr/${TARGET_CANON}/bin/$$cmd ;\
mv ${CROSSDIR}/usr/bin/$$cmd \
${CROSSDIR}/usr/bin/${TARGET_CANON}-$$cmd ;\
fi ;\
done
@touch ${CROSSBINUTILS}
${CROSSGCC}: ${CROSSBINUTILS}
.if ${COMPILER_VERSION:L} == "gcc4"
(cd ${.CURDIR}/gnu/usr.bin/cc; \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
CROSSDIR=${CROSSDIR} \
MACHINE=${TARGET} \
PATH=${CROSSPATH} ${MAKE} depend )
(cd ${.CURDIR}/gnu/usr.bin/cc; \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
CROSSDIR=${CROSSDIR} \
MACHINE=${TARGET} \
${MAKE} all )
(cd ${.CURDIR}/gnu/usr.bin/cc; \
env CROSSDIR=${CROSSDIR} DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
MACHINE=${TARGET} \
PATH=${CROSSPATH} ${MAKE} install)
cp -f ${CROSSDIR}/usr/bin/g++ ${CROSSDIR}/usr/bin/${TARGET_CANON}-g++
cp -f ${CROSSDIR}/usr/bin/${TARGET_CANON}-g++ ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-c++
cp -f ${CROSSDIR}/usr/libexec/cpp ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-libexeccpp
cp -f ${CROSSDIR}/usr/bin/gcc ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-cc
ln -sf ${TARGET_CANON}-cc ${CROSSDIR}/usr/${TARGET_CANON}/bin/cc
cp -f ${CROSSDIR}/usr/bin/gcc ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-cc
rm -f ${CROSSDIR}/usr/bin/gcc ${CROSSDIR}/usr/bin/g++ ${CROSSDIR}/usr/bin/cc ${CROSSDIR}/usr/libexec/cpp
# fix links
rm -f ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-cpp
sed -e 's#/usr/libexec/cpp#${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-libexeccpp#' \
-e 's/@GNUC@//' \
-e 's#/usr/include#${CROSSDIR}/usr/include#' \
-e 's/@dollaropt@//' \
${.CURDIR}/usr.bin/cpp/cpp.sh > ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-cpp
chmod ${BINMODE} ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-cpp
chown ${BINOWN}:${BINGRP} ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-cpp
ln -sf ${TARGET_CANON}-cpp ${CROSSDIR}/usr/${TARGET_CANON}/bin/cpp
.elif ${COMPILER_VERSION:L} == "gcc3"
(cd ${.CURDIR}/gnu/usr.bin/gcc; \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
CROSSDIR=${CROSSDIR} \
PATH=${CROSSPATH} ${MAKE} -f Makefile.bsd-wrapper depend && \
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
CROSSDIR=${CROSSDIR} \
${MAKE} -f Makefile.bsd-wrapper all && \
env CROSSDIR=${CROSSDIR} DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
PATH=${CROSSPATH} ${MAKE} -f Makefile.bsd-wrapper install)
cp -f ${CROSSDIR}/usr/bin/${TARGET_CANON}-g++ ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-c++
cp -f ${CROSSDIR}/usr/bin/gcc ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-cc
cp -f ${CROSSDIR}/usr/libexec/cpp ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-libexeccpp
rm -f ${CROSSDIR}/usr/bin/gcc ${CROSSDIR}/usr/bin/cc ${CROSSDIR}/usr/libexec/cpp
ln -sf ${TARGET_CANON}-cc ${CROSSDIR}/usr/${TARGET_CANON}/bin/cc
ln -sf ${TARGET_CANON}-c++ ${CROSSDIR}/usr/${TARGET_CANON}/bin/c++
rm -f ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-cpp
sed -e 's#/usr/libexec/cpp#${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-libexeccpp#' \
-e 's/@GNUC@/-D__GNUC__/' \
-e 's#/usr/include#${CROSSDIR}/usr/include#' \
-e 's/@dollaropt@//' \
${.CURDIR}/usr.bin/cpp/cpp.sh > ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-cpp
chmod ${BINMODE} ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-cpp
chown ${BINOWN}:${BINGRP} ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-cpp
ln -sf ${TARGET_CANON}-cpp ${CROSSDIR}/usr/${TARGET_CANON}/bin/cpp
.else
(cd ${CROSSDIR}/usr/obj/gnu/egcs/gcc; \
/bin/sh ${.CURDIR}/gnu/egcs/gcc/configure \
--with-gnu-as --with-gnu-ld --prefix ${CROSSDIR}/usr \
--target ${TARGET_CANON} \
--enable-languages="c,c++" --enable-cpp --disable-nls \
--with-gxx-include-dir=${CROSSDIR}/usr/include/g++ && \
PATH=${CROSSPATH} ${MAKE} BISON=yacc LANGUAGES="${CROSSLANGS}" \
CFLAGS="${CFLAGS} -I${.CURDIR}/gnu/lib/libiberty/include" \
LIBIBERTY_INCLUDES=${.CURDIR}/gnu/lib/libiberty/include \
DEMANGLER_PROG= DEMANGLE_H= LDFLAGS="${LDSTATIC}" build_infodir=. \
GCC_FOR_TARGET="./xgcc -B./ -I${CROSSDIR}/usr/include" && \
${MAKE} BISON=yacc LANGUAGES="${CROSSLANGS}" LDFLAGS="${LDSTATIC}" \
GCC_FOR_TARGET="./xgcc -B./ -I${CROSSDIR}/usr/include" \
CFLAGS="${CFLAGS} -I${.CURDIR}/gnu/lib/libiberty/include" \
LIBIBERTY_INCLUDES=${.CURDIR}/gnu/lib/libiberty/include \
build_infodir=. INSTALL_MAN= INSTALL_HEADERS_DIR= install)
mv -f ${CROSSDIR}/usr/bin/cpp ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-libexeccpp
rm -f ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-cpp
sed -e 's#/usr/libexec/cpp#${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-libexeccpp#' \
-e 's/@GNUC@/-D__GNUC__/' \
-e 's#/usr/include#${CROSSDIR}/usr/include#' \
-e 's/@dollaropt@/-$$/' ${.CURDIR}/usr.bin/cpp/cpp.sh > \
${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-cpp
chmod ${BINMODE} \
${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-cpp
chown ${BINOWN}:${BINGRP}\
${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-cpp
ln -sf ${TARGET_CANON}-cpp ${CROSSDIR}/usr/${TARGET_CANON}/bin/cpp
ln -sf gcc ${CROSSDIR}/usr/${TARGET_CANON}/bin/cc
ln -sf gcc ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-cc
cp -f ${CROSSDIR}/usr/bin/${TARGET_CANON}-g++ ${CROSSDIR}/usr/${TARGET_CANON}/bin/${TARGET_CANON}-c++
ln -sf ${TARGET_CANON}-c++ ${CROSSDIR}/usr/${TARGET_CANON}/bin/c++
.endif
@touch ${CROSSGCC}
# XXX MAKEOBJDIR maybe should be obj.${TARGET} here, revisit later
cross-lib: ${CROSSGCC}
MACHINE=${TARGET} \
MACHINE_ARCH=${TARGET_ARCH} MACHINE_CPU=${TARGET_CPU}; \
export MACHINE MACHINE_ARCH MACHINE_CPU; \
(cd ${.CURDIR}/lib; \
for lib in csu libc; do \
(cd $$lib; \
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
${MAKE} depend all ;\
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} DESTDIR=${CROSSDIR} \
${MAKE} install); \
done; \
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
SKIPDIR=\"${NO_CROSS} libocurses/PSD.doc\" \
${MAKE} depend all ; \
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} DESTDIR=${CROSSDIR} \
SKIPDIR=\"${NO_CROSS} libocurses/PSD.doc\" \
${MAKE} install)
cross-bin: ${CROSSOBJ}
MACHINE=${TARGET} \
MACHINE_ARCH=${TARGET_ARCH} MACHINE_CPU=${TARGET_CPU}; \
export MACHINE MACHINE_ARCH MACHINE_CPU; \
for i in libexec bin sbin usr.bin usr.sbin; do \
(cd ${.CURDIR}/$$i; \
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
SKIPDIR=\"${BINUTILS} ${NO_CROSS}\" \
${MAKE} depend all ; \
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} DESTDIR=${CROSSDIR} \
SKIPDIR=\"${BINUTILS} ${NO_CROSS}\" \
${MAKE} install); \
done
cross-gnu: ${CROSSOBJ}
MACHINE=${TARGET} \
MACHINE_ARCH=${TARGET_ARCH} MACHINE_CPU=${TARGET_CPU}; \
export MACHINE MACHINE_ARCH MACHINE_CPU; \
for i in gnu/lib gnu/usr.sbin gnu/usr.bin ; do \
(cd ${.CURDIR}/$$i; \
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
SKIPDIR=\"${NO_CROSS}\" \
${MAKE} depend all ; \
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} DESTDIR=${CROSSDIR} \
SKIPDIR=\"${NO_CROSS}\" \
${MAKE} install); \
done
cross-share: ${CROSSOBJ}
MACHINE=${TARGET} \
MACHINE_ARCH=${TARGET_ARCH} MACHINE_CPU=${TARGET_CPU}; \
export MACHINE MACHINE_ARCH MACHINE_CPU; \
for i in share; do \
(cd ${.CURDIR}/$$i; \
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
SKIPDIR=\"${NO_CROSS}\" \
${MAKE} depend all install); \
done
cross-sys: ${CROSSOBJ}
MACHINE=${TARGET} \
MACHINE_ARCH=${TARGET_ARCH} MACHINE_CPU=${TARGET_CPU}; \
export MACHINE MACHINE_ARCH MACHINE_CPU; \
for i in sys; do \
(cd ${.CURDIR}/$$i; \
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
SKIPDIR=\"${NO_CROSS}\" \
${MAKE} depend all install); \
done
cross-etc-root-var: ${CROSSOBJ}
(cd ${.CURDIR}/etc && \
MACHINE=${TARGET} \
MACHINE_ARCH=${TARGET_ARCH} MACHINE_CPU=${TARGET_CPU} \
DESTDIR=${CROSSDIR} \
${MAKE} distribution-etc-root-var)
cross-depend:
@(cd ${.CURDIR} && \
BSDOBJDIR=${CROSSDIR}/usr/obj \
BSDSRCDIR=${.CURDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
SKIPDIR="${NO_CROSS}" \
${MAKE} depend)
cross-clean:
@(cd ${.CURDIR} && \
BSDOBJDIR=${CROSSDIR}/usr/obj \
BSDSRCDIR=${.CURDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
SKIPDIR="${NO_CROSS}" \
${MAKE} clean)
cross-cleandir:
@(cd ${.CURDIR} && \
BSDOBJDIR=${CROSSDIR}/usr/obj \
BSDSRCDIR=${.CURDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
SKIPDIR="${NO_CROSS}" \
${MAKE} cleandir)