2010-09-19 21:49:08 -07:00
|
|
|
# $OpenBSD: Makefile.cross,v 1.36 2010/09/20 04:49:08 drahn Exp $
|
2005-01-09 12:36:20 -08:00
|
|
|
|
|
|
|
cross-tools: cross-includes cross-binutils cross-gcc cross-lib
|
2008-09-06 09:26:39 -07:00
|
|
|
cross-distrib: cross-tools cross-bin cross-share cross-sys cross-etc-root-var
|
|
|
|
# cross-gnu \
|
2005-01-09 12:36:20 -08:00
|
|
|
|
2005-09-11 16:10:07 -07:00
|
|
|
# Have to compute TARGET_ARCH directly in the Makefile, for .if tests involving
|
|
|
|
# this variable to work.
|
2009-09-21 12:44:23 -07:00
|
|
|
.if (${TARGET} == "armish" || ${TARGET} == "beagle" || \
|
2010-05-31 10:38:03 -07:00
|
|
|
${TARGET} == "gumstix" || ${TARGET} == "palm" || \
|
|
|
|
${TARGET} == "zaurus")
|
2005-09-11 16:10:07 -07:00
|
|
|
TARGET_ARCH= arm
|
|
|
|
.elif (${TARGET} == "hp300" || ${TARGET} == "mac68k" || \
|
|
|
|
${TARGET} == "mvme68k")
|
|
|
|
TARGET_ARCH= m68k
|
2006-05-09 14:17:11 -07:00
|
|
|
.elif (${TARGET} == "aviion" || ${TARGET} == "luna88k" || \
|
|
|
|
${TARGET} == "mvme88k")
|
2005-09-11 16:10:07 -07:00
|
|
|
TARGET_ARCH= m88k
|
|
|
|
.elif (${TARGET} == "sgi")
|
|
|
|
TARGET_ARCH= mips64
|
2010-02-05 14:36:27 -08:00
|
|
|
.elif (${TARGET} == "loongson")
|
|
|
|
TARGET_ARCH= mips64el
|
|
|
|
TARGET_CPU= mips64
|
2006-12-19 15:17:54 -08:00
|
|
|
.elif (${TARGET} == "solbourne")
|
|
|
|
TARGET_ARCH= sparc
|
2008-05-13 14:15:58 -07:00
|
|
|
.elif (${TARGET} == "macppc" || ${TARGET} == "mvmeppc" || \
|
|
|
|
${TARGET} == "socppc")
|
2005-09-11 16:10:07 -07:00
|
|
|
TARGET_ARCH= powerpc
|
2006-10-06 13:58:15 -07:00
|
|
|
.elif (${TARGET} == "landisk")
|
|
|
|
TARGET_ARCH= sh
|
2005-09-11 16:10:07 -07:00
|
|
|
.else
|
|
|
|
TARGET_ARCH= ${TARGET}
|
|
|
|
.endif
|
2010-02-05 14:36:27 -08:00
|
|
|
TARGET_CPU?= ${TARGET_ARCH}
|
2005-09-11 16:10:07 -07:00
|
|
|
|
2008-09-06 09:26:39 -07:00
|
|
|
#CROSSCPPFLAGS?= -nostdinc -I${CROSSDIR}/usr/include
|
|
|
|
#CROSSLDFLAGS?= -nostdlib -L${CROSSDIR}/usr/lib -static
|
|
|
|
CROSSCFLAGS?= ${CROSSCPPFLAGS} -O2 ${PIPE} ${DEBUG}
|
2005-01-09 12:36:20 -08:00
|
|
|
CROSSCXXFLAGS?= ${CROSSCPPFLAGS}
|
2008-09-06 09:26:39 -07:00
|
|
|
#LDSTATIC?= -static
|
|
|
|
|
|
|
|
# XXX
|
|
|
|
BINMODE?=555
|
|
|
|
BINOWN?=root
|
|
|
|
BINOWN?=bin
|
2005-01-09 12:36:20 -08:00
|
|
|
|
|
|
|
CROSSDIR= ${DESTDIR}/usr/cross/${TARGET}
|
2008-09-06 09:26:39 -07:00
|
|
|
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= \
|
2005-01-09 12:36:20 -08:00
|
|
|
HOSTCFLAGS=\"${CFLAGS}\" HOSTCXXFLAGS=\"${CXXFLAGS}\" \
|
2005-09-11 16:10:07 -07:00
|
|
|
HOSTLDFLAGS=\"${LDFLAGS}\" \
|
2005-01-09 12:36:20 -08:00
|
|
|
CFLAGS=\"${CROSSCFLAGS}\" CPPFLAGS=\"${CROSSCPPFLAGS}\" \
|
|
|
|
CXXFLAGS=\"${CROSSCXXFLAGS}\" \
|
|
|
|
LDFLAGS=\"${CROSSLDFLAGS}\"
|
2008-09-06 09:26:39 -07:00
|
|
|
CROSSADDPATH=:${CROSSDIR}/usr/${TARGET_CANON}/bin
|
|
|
|
CROSSPATH= /usr/bin:/bin:/usr/sbin:/sbin${CROSSADDPATH}
|
2005-01-09 12:36:20 -08:00
|
|
|
CROSSLANGS?= c c++
|
|
|
|
|
2005-01-10 09:47:15 -08:00
|
|
|
TARGET_CANON=`cat ${CROSSDIR}/TARGET_CANON`
|
|
|
|
|
2005-01-09 12:36:20 -08:00
|
|
|
CROSSDIRS= ${CROSSDIR}/.dirs_done
|
2008-09-06 09:26:39 -07:00
|
|
|
CROSSOBJ= ${CROSSDIR}/.obj_done
|
|
|
|
CROSSINCLUDES= ${CROSSDIR}/.includes_done
|
|
|
|
CROSSBINUTILS= ${CROSSDIR}/.binutils_done
|
|
|
|
CROSSGCC= ${CROSSDIR}/.gcc_done
|
|
|
|
#NO_CROSS= isakmpd tn3270 keynote sectok ssh
|
2005-01-09 12:36:20 -08:00
|
|
|
|
2010-05-31 21:33:40 -07:00
|
|
|
# bsd.own.mk can't do it for us
|
|
|
|
.if ${TARGET_ARCH} == "m68k" || ${TARGET_ARCH} == "m88k" || \
|
|
|
|
${TARGET_ARCH} == "sparc" || ${TARGET_ARCH} == "vax"
|
|
|
|
TARGET_USE_GCC3=No
|
|
|
|
COMPILER_VERSION=gcc2
|
2010-09-09 12:46:39 -07:00
|
|
|
.elif ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "hppa" || \
|
|
|
|
${TARGET_ARCH} == "i386" || ${TARGET_ARCH} == "powerpc" || \
|
|
|
|
${TARGET_ARCH} == "sparc64"
|
2010-05-31 21:33:40 -07:00
|
|
|
TARGET_USE_GCC4=Yes
|
|
|
|
COMPILER_VERSION=gcc4
|
|
|
|
.else
|
|
|
|
TARGET_USE_GCC3=Yes
|
|
|
|
COMPILER_VERSION=gcc3
|
|
|
|
.endif
|
|
|
|
|
2005-01-10 09:47:15 -08:00
|
|
|
# no libcrypto.... these won't build
|
2008-09-06 09:26:39 -07:00
|
|
|
#NO_CROSS+= dc login_krb5 login_krb5-or-pwd passwd ppp tcpdump telnet \
|
|
|
|
# ftp gzsig sasyncd vnconfig
|
|
|
|
|
2005-01-10 09:47:15 -08:00
|
|
|
# need host setup for ydr
|
|
|
|
NO_CROSS+=afs
|
|
|
|
# explicit cross-compile
|
|
|
|
NO_CROSS+=bind
|
2008-09-06 09:26:39 -07:00
|
|
|
NO_CROSS+=httpd
|
|
|
|
NO_CROSS+=microcode
|
|
|
|
NO_CROSS+=groff lynx binutils perl texinfo gcc cvs
|
2010-09-19 21:49:08 -07:00
|
|
|
NO_CROSS+=nsd
|
2005-01-10 09:47:15 -08:00
|
|
|
|
2005-01-09 12:36:20 -08:00
|
|
|
cross-dirs: ${CROSSDIRS}
|
|
|
|
cross-obj: ${CROSSOBJ}
|
|
|
|
cross-includes: ${CROSSINCLUDES}
|
|
|
|
cross-binutils: ${CROSSBINUTILS}
|
|
|
|
cross-gcc: ${CROSSGCC}
|
|
|
|
|
|
|
|
cross-env:
|
|
|
|
@echo ${CROSSENV} MACHINE=${TARGET} \
|
2007-02-06 09:17:18 -08:00
|
|
|
MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \
|
2010-02-05 14:36:27 -08:00
|
|
|
MACHINE_CPU=`cat ${CROSSDIR}/TARGET_CPU` \
|
2007-02-06 09:17:18 -08:00
|
|
|
BSDOBJDIR=${CROSSDIR}/usr/obj \
|
|
|
|
BSDSRCDIR=${.CURDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET}
|
2005-01-09 12:36:20 -08:00
|
|
|
|
|
|
|
${CROSSDIRS}:
|
|
|
|
@-mkdir -p ${CROSSDIR}
|
2005-09-11 16:10:07 -07:00
|
|
|
@echo ${TARGET_ARCH} > ${CROSSDIR}/TARGET_ARCH
|
2005-01-09 12:36:20 -08:00
|
|
|
@echo TARGET_ARCH is `cat ${CROSSDIR}/TARGET_ARCH`
|
2010-02-05 14:36:27 -08:00
|
|
|
@echo ${TARGET_CPU} > ${CROSSDIR}/TARGET_CPU
|
|
|
|
@echo TARGET_CPU is `cat ${CROSSDIR}/TARGET_CPU`
|
2005-01-09 12:36:20 -08:00
|
|
|
@eval `grep '^osr=' sys/conf/newvers.sh`; \
|
2010-02-05 14:36:27 -08:00
|
|
|
echo ${TARGET_ARCH}-unknown-openbsd$$osr > \
|
2005-01-09 12:36:20 -08:00
|
|
|
${CROSSDIR}/TARGET_CANON
|
|
|
|
@-mkdir -p ${CROSSDIR}
|
2005-01-10 09:47:15 -08:00
|
|
|
@-mkdir -p ${CROSSDIR}/usr/${TARGET_CANON}
|
2005-01-09 12:36:20 -08:00
|
|
|
@ln -sf ${CROSSDIR}/usr/include \
|
2005-01-10 09:47:15 -08:00
|
|
|
${CROSSDIR}/usr/${TARGET_CANON}/include
|
2005-01-09 12:36:20 -08:00
|
|
|
@ln -sf ${CROSSDIR}/usr/lib \
|
2005-01-10 09:47:15 -08:00
|
|
|
${CROSSDIR}/usr/${TARGET_CANON}/lib
|
|
|
|
@-mkdir -p ${CROSSDIR}/usr/${TARGET_CANON}/bin
|
2005-01-09 12:36:20 -08:00
|
|
|
@(cd ${.CURDIR}/etc && DESTDIR=${CROSSDIR} ${MAKE} distrib-dirs)
|
|
|
|
@touch ${CROSSDIRS}
|
|
|
|
|
|
|
|
${CROSSOBJ}: ${CROSSDIRS}
|
|
|
|
@-mkdir -p ${CROSSDIR}/usr/obj
|
|
|
|
@(cd ${.CURDIR} && \
|
|
|
|
BSDOBJDIR=${CROSSDIR}/usr/obj \
|
2010-05-31 21:33:40 -07:00
|
|
|
COMPILER_VERSION=${COMPILER_VERSION} \
|
2005-01-09 12:36:20 -08:00
|
|
|
MACHINE=${TARGET} \
|
2010-02-05 14:36:27 -08:00
|
|
|
MACHINE_ARCH=${TARGET_ARCH} MACHINE_CPU=${TARGET_CPU} \
|
2005-01-09 12:36:20 -08:00
|
|
|
BSDSRCDIR=${.CURDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
|
|
|
${MAKE} obj)
|
|
|
|
@touch ${CROSSOBJ}
|
|
|
|
|
|
|
|
${CROSSINCLUDES}: ${CROSSOBJ}
|
|
|
|
@-mkdir -p ${CROSSDIR}/usr/include
|
|
|
|
@(cd ${.CURDIR}/include && \
|
2010-05-31 21:33:40 -07:00
|
|
|
COMPILER_VERSION=${COMPILER_VERSION} \
|
2010-02-05 14:36:27 -08:00
|
|
|
MACHINE=${TARGET} \
|
|
|
|
MACHINE_ARCH=${TARGET_ARCH} MACHINE_CPU=${TARGET_CPU} \
|
2005-01-09 12:36:20 -08:00
|
|
|
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
2010-02-05 14:36:27 -08:00
|
|
|
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
|
2005-01-09 12:36:20 -08:00
|
|
|
${MAKE} prereq && \
|
2010-05-31 21:33:40 -07:00
|
|
|
COMPILER_VERSION=${COMPILER_VERSION} \
|
2010-02-05 14:36:27 -08:00
|
|
|
MACHINE=${TARGET} \
|
|
|
|
MACHINE_ARCH=${TARGET_ARCH} MACHINE_CPU=${TARGET_CPU} \
|
2005-01-09 12:36:20 -08:00
|
|
|
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
2010-02-05 14:36:27 -08:00
|
|
|
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
|
2005-01-09 12:36:20 -08:00
|
|
|
${MAKE} DESTDIR=${CROSSDIR} includes)
|
|
|
|
@touch ${CROSSINCLUDES}
|
|
|
|
|
2005-09-11 16:10:07 -07:00
|
|
|
.if (${TARGET_ARCH} == "m68k" || ${TARGET_ARCH} == "m88k" || \
|
|
|
|
${TARGET_ARCH} == "vax")
|
2005-01-09 12:36:20 -08:00
|
|
|
BINUTILS= ar as ld nm ranlib objcopy objdump strings strip
|
|
|
|
NEW_BINUTILS?= No
|
|
|
|
.else
|
|
|
|
BINUTILS= ar as gasp ld nm objcopy objdump ranlib readelf size \
|
|
|
|
strings strip
|
|
|
|
NEW_BINUTILS?= Yes
|
|
|
|
.endif
|
|
|
|
|
|
|
|
${CROSSBINUTILS}: ${CROSSINCLUDES}
|
|
|
|
(cd ${.CURDIR}/gnu/usr.bin/binutils; \
|
|
|
|
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
2006-05-04 12:41:06 -07:00
|
|
|
USING_NEW_BINUTILS=${NEW_BINUTILS} \
|
2010-02-05 14:36:27 -08:00
|
|
|
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
|
|
|
|
PATH=${CROSSPATH} \
|
2005-01-09 12:36:20 -08:00
|
|
|
${MAKE} -f Makefile.bsd-wrapper depend && \
|
|
|
|
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
2006-05-04 12:41:06 -07:00
|
|
|
USING_NEW_BINUTILS=${NEW_BINUTILS} \
|
2010-02-05 14:36:27 -08:00
|
|
|
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
|
2005-01-09 12:36:20 -08:00
|
|
|
${MAKE} -f Makefile.bsd-wrapper all && \
|
|
|
|
DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
2010-05-31 21:33:40 -07:00
|
|
|
COMPILER_VERSION=${COMPILER_VERSION} \
|
2006-05-04 12:41:06 -07:00
|
|
|
USING_NEW_BINUTILS=${NEW_BINUTILS} \
|
2010-02-05 14:36:27 -08:00
|
|
|
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
|
|
|
USING_NEW_BINUTILS=${NEW_BINUTILS} \
|
|
|
|
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
|
2005-01-09 12:36:20 -08:00
|
|
|
${MAKE} -f Makefile.bsd-wrapper install)
|
2006-05-04 12:41:06 -07:00
|
|
|
.if ${NEW_BINUTILS:L} != "yes"
|
2005-01-09 12:36:20 -08:00
|
|
|
(cd ${.CURDIR}/gnu/usr.bin/gas; \
|
2005-01-10 09:47:15 -08:00
|
|
|
TARGET_MACHINE_ARCH=${TARGET_ARCH} \
|
2005-01-09 12:36:20 -08:00
|
|
|
MAKEOBJDIR=obj.${MACHINE}.${TARGET} ${MAKE} depend all; \
|
2005-01-10 09:47:15 -08:00
|
|
|
TARGET_MACHINE_ARCH=${TARGET_ARCH} \
|
2005-01-09 12:36:20 -08:00
|
|
|
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
|
2005-01-09 12:36:20 -08:00
|
|
|
(cd ${.CURDIR}/gnu/usr.bin/ld; \
|
2005-01-10 09:47:15 -08:00
|
|
|
TARGET_MACHINE_ARCH=${TARGET_ARCH} \
|
2005-01-09 12:36:20 -08:00
|
|
|
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
|
|
|
${MAKE} NOPIC= NOMAN= depend all; \
|
2005-01-10 09:47:15 -08:00
|
|
|
TARGET_MACHINE_ARCH=${TARGET_ARCH} \
|
2005-01-09 12:36:20 -08:00
|
|
|
DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
|
|
|
${MAKE} NOPIC= NOMAN= install)
|
|
|
|
ln -sf ${CROSSDIR}/usr/bin/ld \
|
2005-01-10 09:47:15 -08:00
|
|
|
${CROSSDIR}/usr/${TARGET_CANON}/bin/ld
|
2005-01-09 12:36:20 -08:00
|
|
|
(cd ${.CURDIR}/usr.bin/ar; \
|
2006-04-19 11:32:39 -07:00
|
|
|
ELF_TOOLCHAIN=no \
|
2005-01-09 12:36:20 -08:00
|
|
|
MAKEOBJDIR=obj.${MACHINE}.${TARGET} ${MAKE} NOMAN= depend all; \
|
2006-04-19 11:32:39 -07:00
|
|
|
ELF_TOOLCHAIN=no \
|
2005-01-09 12:36:20 -08:00
|
|
|
DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
|
|
|
${MAKE} NOMAN= install)
|
|
|
|
ln -sf ${CROSSDIR}/usr/bin/ar \
|
2005-01-10 09:47:15 -08:00
|
|
|
${CROSSDIR}/usr/${TARGET_CANON}/bin/ar
|
2010-05-31 21:33:40 -07:00
|
|
|
@(cd ${.CURDIR}/usr.bin/ranlib; \
|
2006-04-19 11:32:39 -07:00
|
|
|
ELF_TOOLCHAIN=no \
|
2005-01-09 12:36:20 -08:00
|
|
|
MAKEOBJDIR=obj.${MACHINE}.${TARGET} ${MAKE} NOMAN= depend all; \
|
2006-04-19 11:32:39 -07:00
|
|
|
ELF_TOOLCHAIN=no \
|
2005-01-09 12:36:20 -08:00
|
|
|
DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
|
|
|
${MAKE} NOMAN= install)
|
|
|
|
ln -sf ${CROSSDIR}/usr/bin/ranlib \
|
2005-01-10 09:47:15 -08:00
|
|
|
${CROSSDIR}/usr/${TARGET_CANON}/bin/ranlib
|
2005-01-09 12:36:20 -08:00
|
|
|
(cd ${.CURDIR}/usr.bin/strip; \
|
|
|
|
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
2005-01-10 09:47:15 -08:00
|
|
|
${MAKE} TARGET_MACHINE_ARCH=${TARGET_ARCH} \
|
2005-01-09 12:36:20 -08:00
|
|
|
NOMAN= depend all; \
|
|
|
|
DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
2005-01-10 09:47:15 -08:00
|
|
|
${MAKE} TARGET_MACHINE_ARCH=${TARGET_ARCH} \
|
2005-01-09 12:36:20 -08:00
|
|
|
NOMAN= install)
|
|
|
|
ln -sf ${CROSSDIR}/usr/bin/strip \
|
2005-01-10 09:47:15 -08:00
|
|
|
${CROSSDIR}/usr/${TARGET_CANON}/bin/strip
|
2005-01-09 12:36:20 -08:00
|
|
|
.endif
|
|
|
|
@for cmd in ${BINUTILS}; do \
|
2008-09-06 09:26:39 -07:00
|
|
|
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 ;\
|
2005-01-09 12:36:20 -08:00
|
|
|
fi ;\
|
|
|
|
done
|
|
|
|
@touch ${CROSSBINUTILS}
|
|
|
|
|
|
|
|
|
|
|
|
${CROSSGCC}: ${CROSSBINUTILS}
|
2010-05-31 21:33:40 -07:00
|
|
|
.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/${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
|
|
|
|
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#' \
|
2010-07-09 10:36:08 -07:00
|
|
|
-e 's/@GNUC@//' \
|
2010-05-31 21:33:40 -07:00
|
|
|
-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"
|
2005-01-09 12:36:20 -08:00
|
|
|
(cd ${.CURDIR}/gnu/usr.bin/gcc; \
|
|
|
|
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
2010-02-05 14:36:27 -08:00
|
|
|
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
|
|
|
|
CROSSDIR=${CROSSDIR} \
|
2008-09-06 09:26:39 -07:00
|
|
|
PATH=${CROSSPATH} ${MAKE} -f Makefile.bsd-wrapper depend && \
|
2005-01-09 12:36:20 -08:00
|
|
|
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
2010-02-05 14:36:27 -08:00
|
|
|
TARGET_ARCH=${TARGET_ARCH} TARGET_CPU=${TARGET_CPU} \
|
|
|
|
CROSSDIR=${CROSSDIR} \
|
2005-01-09 12:36:20 -08:00
|
|
|
${MAKE} -f Makefile.bsd-wrapper all && \
|
2008-09-06 09:26:39 -07:00
|
|
|
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#' \
|
2010-07-09 10:36:08 -07:00
|
|
|
-e 's/@GNUC@/-D__GNUC__/' \
|
2008-09-06 09:26:39 -07:00
|
|
|
-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
|
2005-01-09 12:36:20 -08:00
|
|
|
.else
|
|
|
|
(cd ${CROSSDIR}/usr/obj/gnu/egcs/gcc; \
|
|
|
|
/bin/sh ${.CURDIR}/gnu/egcs/gcc/configure \
|
|
|
|
--with-gnu-as --with-gnu-ld --prefix ${CROSSDIR}/usr \
|
2005-01-10 09:47:15 -08:00
|
|
|
--target ${TARGET_CANON} \
|
2005-01-09 12:36:20 -08:00
|
|
|
--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)
|
2008-09-06 09:26:39 -07:00
|
|
|
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#' \
|
2010-07-09 10:36:08 -07:00
|
|
|
-e 's/@GNUC@/-D__GNUC__/' \
|
2005-01-09 12:36:20 -08:00
|
|
|
-e 's#/usr/include#${CROSSDIR}/usr/include#' \
|
2008-09-06 09:26:39 -07:00
|
|
|
-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++
|
2005-01-09 12:36:20 -08:00
|
|
|
.endif
|
|
|
|
@touch ${CROSSGCC}
|
|
|
|
|
|
|
|
# XXX MAKEOBJDIR maybe should be obj.${TARGET} here, revisit later
|
|
|
|
cross-lib: ${CROSSGCC}
|
2010-02-05 14:36:27 -08:00
|
|
|
MACHINE=${TARGET} \
|
|
|
|
MACHINE_ARCH=${TARGET_ARCH} MACHINE_CPU=${TARGET_CPU}; \
|
|
|
|
export MACHINE MACHINE_ARCH MACHINE_CPU; \
|
2005-01-09 12:36:20 -08:00
|
|
|
(cd ${.CURDIR}/lib; \
|
|
|
|
for lib in csu libc; do \
|
|
|
|
(cd $$lib; \
|
|
|
|
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
2008-09-06 09:26:39 -07:00
|
|
|
${MAKE} WANTLINT=no depend all ;\
|
|
|
|
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} DESTDIR=${CROSSDIR} \
|
|
|
|
${MAKE} WANTLINT=no install); \
|
2005-01-09 12:36:20 -08:00
|
|
|
done; \
|
|
|
|
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
|
|
|
SKIPDIR=\"${NO_CROSS} libocurses/PSD.doc\" \
|
2008-09-06 09:26:39 -07:00
|
|
|
${MAKE} WANTLINT=no depend all ; \
|
|
|
|
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} DESTDIR=${CROSSDIR} \
|
|
|
|
SKIPDIR=\"${NO_CROSS} libocurses/PSD.doc\" \
|
|
|
|
${MAKE} WANTLINT=no install)
|
2005-01-09 12:36:20 -08:00
|
|
|
|
|
|
|
cross-bin: ${CROSSOBJ}
|
2010-02-05 14:36:27 -08:00
|
|
|
MACHINE=${TARGET} \
|
|
|
|
MACHINE_ARCH=${TARGET_ARCH} MACHINE_CPU=${TARGET_CPU}; \
|
|
|
|
export MACHINE MACHINE_ARCH MACHINE_CPU; \
|
2005-01-09 12:36:20 -08:00
|
|
|
for i in libexec bin sbin usr.bin usr.sbin; do \
|
|
|
|
(cd ${.CURDIR}/$$i; \
|
|
|
|
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
|
|
|
SKIPDIR=\"${BINUTILS} ${NO_CROSS}\" \
|
2008-09-06 09:26:39 -07:00
|
|
|
${MAKE} depend all ; \
|
|
|
|
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} DESTDIR=${CROSSDIR} \
|
|
|
|
SKIPDIR=\"${BINUTILS} ${NO_CROSS}\" \
|
|
|
|
${MAKE} install); \
|
|
|
|
done
|
|
|
|
|
|
|
|
cross-gnu: ${CROSSOBJ}
|
2010-02-05 14:36:27 -08:00
|
|
|
MACHINE=${TARGET} \
|
|
|
|
MACHINE_ARCH=${TARGET_ARCH} MACHINE_CPU=${TARGET_CPU}; \
|
|
|
|
export MACHINE MACHINE_ARCH MACHINE_CPU; \
|
2008-09-06 09:26:39 -07:00
|
|
|
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}
|
2010-02-05 14:36:27 -08:00
|
|
|
MACHINE=${TARGET} \
|
|
|
|
MACHINE_ARCH=${TARGET_ARCH} MACHINE_CPU=${TARGET_CPU}; \
|
|
|
|
export MACHINE MACHINE_ARCH MACHINE_CPU; \
|
2008-09-06 09:26:39 -07:00
|
|
|
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}
|
2010-02-05 14:36:27 -08:00
|
|
|
MACHINE=${TARGET} \
|
|
|
|
MACHINE_ARCH=${TARGET_ARCH} MACHINE_CPU=${TARGET_CPU}; \
|
|
|
|
export MACHINE MACHINE_ARCH MACHINE_CPU; \
|
2008-09-06 09:26:39 -07:00
|
|
|
for i in sys; do \
|
|
|
|
(cd ${.CURDIR}/$$i; \
|
|
|
|
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
|
|
|
SKIPDIR=\"${NO_CROSS}\" \
|
|
|
|
${MAKE} depend all install); \
|
2005-01-09 12:36:20 -08:00
|
|
|
done
|
|
|
|
|
|
|
|
cross-etc-root-var: ${CROSSOBJ}
|
|
|
|
(cd ${.CURDIR}/etc && \
|
2010-02-05 14:36:27 -08:00
|
|
|
MACHINE=${TARGET} \
|
|
|
|
MACHINE_ARCH=${TARGET_ARCH} MACHINE_CPU=${TARGET_CPU} \
|
|
|
|
DESTDIR=${CROSSDIR} \
|
|
|
|
${MAKE} distribution-etc-root-var)
|
2005-01-09 12:36:20 -08:00
|
|
|
|
|
|
|
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)
|