2004-01-14 15:26:24 -08:00
|
|
|
# $OpenBSD: Makefile,v 1.97 2004/01/14 23:26:24 brad Exp $
|
1995-10-18 01:37:01 -07:00
|
|
|
|
1997-04-17 23:47:08 -07:00
|
|
|
#
|
|
|
|
# For more information on building in tricky environments, please see
|
|
|
|
# the list of possible environment variables described in
|
|
|
|
# /usr/share/mk/bsd.README.
|
2002-06-08 22:47:26 -07:00
|
|
|
#
|
1997-04-17 23:47:08 -07:00
|
|
|
# Building recommendations:
|
2002-06-08 22:47:26 -07:00
|
|
|
#
|
1997-04-17 23:47:08 -07:00
|
|
|
# 1) If at all possible, put this source tree in /usr/src. If /usr/src
|
|
|
|
# must be a symbolic link, setenv BSDSRCDIR to point to the real location.
|
|
|
|
#
|
|
|
|
# 2) It is also recommended that you compile with objects outside the
|
|
|
|
# source tree. To do this, ensure /usr/obj exists or points to some
|
|
|
|
# area of disk of sufficient size. Then do "cd /usr/src; make obj".
|
|
|
|
# This will make a symbolic link called "obj" in each directory, as
|
|
|
|
# well as populate the /usr/obj properly with directories for the
|
|
|
|
# objects.
|
|
|
|
#
|
1998-09-30 06:27:28 -07:00
|
|
|
# 3) It is strongly recommended that you build and install a new kernel
|
|
|
|
# before rebuilding your system. Some of the new programs may use new
|
|
|
|
# functionality or depend on API changes that your old kernel doesn't have.
|
|
|
|
#
|
|
|
|
# 4) If you are reasonably sure that things will compile OK, use the
|
1997-04-17 23:47:08 -07:00
|
|
|
# "make build" target supplied here. Good luck.
|
1998-05-18 11:29:07 -07:00
|
|
|
#
|
1998-09-30 06:27:28 -07:00
|
|
|
# 5) If you want to setup a cross-build environment, there is a "cross-tools"
|
2002-06-08 22:47:26 -07:00
|
|
|
# target available which upon completion of "make TARGET=<target> cross-tools"
|
1998-05-18 11:29:07 -07:00
|
|
|
# (where <target> is one of the names in the /sys/arch directory) will produce
|
|
|
|
# a set of compilation tools along with the includes in the /usr/cross/<target>
|
2002-08-15 19:04:58 -07:00
|
|
|
# directory. The "cross-distrib" target will build cross-tools as well as
|
|
|
|
# binaries for a given <target>.
|
1998-05-18 11:29:07 -07:00
|
|
|
#
|
1996-04-23 02:47:22 -07:00
|
|
|
|
1997-04-17 23:47:08 -07:00
|
|
|
.include <bsd.own.mk> # for NOMAN, if it's there.
|
1995-10-18 01:37:01 -07:00
|
|
|
|
|
|
|
SUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share games
|
|
|
|
SUBDIR+= gnu
|
|
|
|
|
1996-03-02 13:04:11 -08:00
|
|
|
SUBDIR+= sys lkm
|
1995-10-18 01:37:01 -07:00
|
|
|
|
2001-06-26 08:33:28 -07:00
|
|
|
.if (${KERBEROS5:L} == "yes")
|
|
|
|
SUBDIR+= kerberosV
|
|
|
|
.endif
|
|
|
|
|
1997-08-06 02:40:10 -07:00
|
|
|
.if make(clean) || make(cleandir) || make(obj)
|
2002-01-02 18:19:20 -08:00
|
|
|
SUBDIR+= distrib regress
|
1997-08-06 02:40:10 -07:00
|
|
|
.endif
|
|
|
|
|
1995-10-18 01:37:01 -07:00
|
|
|
.if exists(regress)
|
|
|
|
regression-tests:
|
|
|
|
@echo Running regression tests...
|
2002-02-22 15:31:11 -08:00
|
|
|
@cd ${.CURDIR}/regress && ${MAKE} depend && exec ${MAKE} regress
|
1995-10-18 01:37:01 -07:00
|
|
|
.endif
|
|
|
|
|
1996-05-17 22:37:48 -07:00
|
|
|
includes:
|
2001-06-24 16:31:07 -07:00
|
|
|
cd ${.CURDIR}/include && ${MAKE} prereq && exec ${SUDO} ${MAKE} includes
|
1996-05-17 22:37:48 -07:00
|
|
|
|
1996-05-06 13:31:44 -07:00
|
|
|
beforeinstall:
|
2001-05-14 05:34:26 -07:00
|
|
|
cd ${.CURDIR}/etc && exec ${MAKE} DESTDIR=${DESTDIR} distrib-dirs
|
|
|
|
cd ${.CURDIR}/include && exec ${MAKE} includes
|
1995-10-18 01:37:01 -07:00
|
|
|
|
|
|
|
afterinstall:
|
|
|
|
.ifndef NOMAN
|
2001-05-14 05:34:26 -07:00
|
|
|
cd ${.CURDIR}/share/man && exec ${MAKE} makedb
|
1995-10-18 01:37:01 -07:00
|
|
|
.endif
|
|
|
|
|
|
|
|
build:
|
1997-07-28 20:37:03 -07:00
|
|
|
.ifdef GLOBAL_AUTOCONF_CACHE
|
2000-12-29 22:45:52 -08:00
|
|
|
cp /dev/null ${GLOBAL_AUTOCONF_CACHE}
|
1997-07-28 20:18:39 -07:00
|
|
|
.endif
|
2001-05-14 05:34:26 -07:00
|
|
|
cd ${.CURDIR}/share/mk && exec ${SUDO} ${MAKE} install
|
|
|
|
cd ${.CURDIR}/include && ${MAKE} prereq && exec ${SUDO} ${MAKE} includes
|
1999-01-06 20:57:13 -08:00
|
|
|
${SUDO} ${MAKE} cleandir
|
2001-05-14 05:34:26 -07:00
|
|
|
cd ${.CURDIR}/lib && ${MAKE} depend && ${MAKE} && \
|
|
|
|
NOMAN=1 exec ${SUDO} ${MAKE} install
|
|
|
|
cd ${.CURDIR}/gnu/lib && ${MAKE} depend && ${MAKE} && \
|
|
|
|
NOMAN=1 exec ${SUDO} ${MAKE} install
|
|
|
|
${MAKE} depend && ${MAKE} && exec ${SUDO} ${MAKE} install
|
1995-10-18 01:37:01 -07:00
|
|
|
|
1997-02-28 15:22:07 -08:00
|
|
|
.if !defined(TARGET)
|
2002-08-15 19:04:58 -07:00
|
|
|
cross-tools cross-distrib:
|
1997-02-28 15:22:07 -08:00
|
|
|
echo "TARGET must be set"; exit 1
|
|
|
|
.else
|
2002-08-15 19:04:58 -07:00
|
|
|
cross-tools: cross-includes cross-binutils cross-gcc cross-lib
|
|
|
|
cross-distrib: cross-tools cross-bin cross-etc-root-var
|
|
|
|
|
|
|
|
CROSSCPPFLAGS?= -nostdinc -I${CROSSDIR}/usr/include
|
|
|
|
CROSSLDFLAGS?= -nostdlib -L${CROSSDIR}/usr/lib -static
|
|
|
|
CROSSCFLAGS?= ${CROSSCPPFLAGS}
|
|
|
|
CROSSCXXFLAGS?= ${CROSSCPPFLAGS}
|
|
|
|
LDSTATIC?= -static
|
1997-02-28 15:22:07 -08:00
|
|
|
|
|
|
|
CROSSDIR= ${DESTDIR}/usr/cross/${TARGET}
|
1998-05-16 13:56:52 -07:00
|
|
|
CROSSENV= AR=${CROSSDIR}/usr/bin/ar AS=${CROSSDIR}/usr/bin/as \
|
|
|
|
CC=${CROSSDIR}/usr/bin/cc CPP=${CROSSDIR}/usr/bin/cpp \
|
2001-09-13 23:03:11 -07:00
|
|
|
CXX=${CROSSDIR}/usr/bin/c++ \
|
1998-05-16 13:56:52 -07:00
|
|
|
LD=${CROSSDIR}/usr/bin/ld NM=${CROSSDIR}/usr/bin/nm \
|
2001-09-13 23:03:11 -07:00
|
|
|
LORDER=/usr/bin/lorder RANLIB=${CROSSDIR}/usr/bin/ranlib \
|
1998-05-16 13:56:52 -07:00
|
|
|
SIZE=${CROSSDIR}/usr/bin/size STRIP=${CROSSDIR}/usr/bin/strip \
|
2003-01-05 14:52:19 -08:00
|
|
|
HOSTCC=\"${CC}\" HOSTCXX=\"${CXX}\" NOMAN= DESTDIR=${CROSSDIR} \
|
|
|
|
HOSTCFLAGS=\"${CFLAGS}\" HOSTCXXFLAGS=\"${CXXFLAGS}\" \
|
|
|
|
HOSTLDFLAGS=\"${LDFLAGS} \" \
|
|
|
|
CFLAGS=\"${CROSSCFLAGS}\" CPPFLAGS=\"${CROSSCPPFLAGS}\" \
|
|
|
|
CXXFLAGS=\"${CROSSCXXFLAGS}\" \
|
|
|
|
LDFLAGS=\"${CROSSLDFLAGS}\"
|
2001-01-26 16:58:23 -08:00
|
|
|
CROSSPATH= ${PATH}:${CROSSDIR}/usr/bin
|
2002-08-15 19:04:58 -07:00
|
|
|
CROSSLANGS?= c c++
|
|
|
|
|
|
|
|
CROSSDIRS= ${CROSSDIR}/.dirs_done
|
|
|
|
CROSSOBJ= ${CROSSDIR}/usr/obj/.obj_done
|
|
|
|
CROSSINCLUDES= ${CROSSDIR}/usr/include/.includes_done
|
|
|
|
CROSSBINUTILS= ${CROSSDIR}/usr/bin/.binutils_done
|
|
|
|
CROSSGCC= ${CROSSDIR}/usr/bin/.gcc_done
|
|
|
|
NO_CROSS= isakmpd tn3270 less sudo openssl libkeynote libssl \
|
|
|
|
photurisd keynote sectok ssh
|
|
|
|
|
|
|
|
cross-dirs: ${CROSSDIRS}
|
|
|
|
cross-obj: ${CROSSOBJ}
|
|
|
|
cross-includes: ${CROSSINCLUDES}
|
|
|
|
cross-binutils: ${CROSSBINUTILS}
|
|
|
|
cross-gcc: ${CROSSGCC}
|
|
|
|
|
|
|
|
cross-env: .PHONY
|
|
|
|
@echo ${CROSSENV} MACHINE=${TARGET} \
|
|
|
|
MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH`
|
|
|
|
|
|
|
|
${CROSSDIRS}:
|
2001-06-26 11:00:16 -07:00
|
|
|
@-mkdir -p ${CROSSDIR}
|
2001-09-16 18:18:34 -07:00
|
|
|
@case ${TARGET} in \
|
|
|
|
sparc|i386|m68k|alpha|hppa|powerpc|sparc64|m88k|vax) \
|
|
|
|
echo ${TARGET} ;;\
|
|
|
|
amiga|sun3|mac68k|hp300|mvme68k) \
|
|
|
|
echo m68k ;;\
|
|
|
|
mvme88k) \
|
|
|
|
echo m88k ;;\
|
2004-01-14 15:26:24 -08:00
|
|
|
mvmeppc|macppc|pegasos) \
|
2001-09-16 18:18:34 -07:00
|
|
|
echo powerpc ;;\
|
2002-08-15 19:04:58 -07:00
|
|
|
sgi) \
|
|
|
|
echo mips ;;\
|
2001-09-16 18:18:34 -07:00
|
|
|
*) \
|
|
|
|
(echo Unknown arch ${TARGET} >&2) ; exit 1;; \
|
|
|
|
esac > ${CROSSDIR}/TARGET_ARCH
|
|
|
|
@echo TARGET_ARCH is `cat ${CROSSDIR}/TARGET_ARCH`
|
|
|
|
@eval `grep '^osr=' sys/conf/newvers.sh`; \
|
1997-02-28 15:22:07 -08:00
|
|
|
sed "s/\$$/-unknown-openbsd$$osr/" ${CROSSDIR}/TARGET_ARCH > \
|
|
|
|
${CROSSDIR}/TARGET_CANON
|
1999-02-02 00:53:32 -08:00
|
|
|
@-mkdir -p ${CROSSDIR}
|
|
|
|
@-mkdir -p ${CROSSDIR}/usr/`cat ${CROSSDIR}/TARGET_CANON`
|
|
|
|
@ln -sf ${CROSSDIR}/usr/include \
|
2001-09-13 23:03:11 -07:00
|
|
|
${CROSSDIR}/usr/`cat ${CROSSDIR}/TARGET_CANON`/include
|
1999-02-02 00:53:32 -08:00
|
|
|
@ln -sf ${CROSSDIR}/usr/lib \
|
|
|
|
${CROSSDIR}/usr/`cat ${CROSSDIR}/TARGET_CANON`/lib
|
|
|
|
@-mkdir -p ${CROSSDIR}/usr/`cat ${CROSSDIR}/TARGET_CANON`/bin
|
2002-08-15 19:04:58 -07:00
|
|
|
@(cd ${.CURDIR}/etc && DESTDIR=${CROSSDIR} ${MAKE} distrib-dirs)
|
|
|
|
@touch ${CROSSDIRS}
|
1999-02-02 00:53:32 -08:00
|
|
|
|
2002-08-15 19:04:58 -07:00
|
|
|
${CROSSOBJ}: ${CROSSDIRS}
|
|
|
|
@-mkdir -p ${CROSSDIR}/usr/obj
|
|
|
|
@(cd ${.CURDIR} && \
|
|
|
|
BSDOBJDIR=${CROSSDIR}/usr/obj \
|
|
|
|
MACHINE=${TARGET} \
|
|
|
|
MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \
|
|
|
|
BSDSRCDIR=${.CURDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
|
|
|
${MAKE} obj)
|
|
|
|
@touch ${CROSSOBJ}
|
1999-02-02 00:53:32 -08:00
|
|
|
|
2002-08-15 19:04:58 -07:00
|
|
|
${CROSSINCLUDES}: ${CROSSOBJ}
|
|
|
|
@-mkdir -p ${CROSSDIR}/usr/include
|
|
|
|
@(cd ${.CURDIR}/include && \
|
2001-01-26 16:58:23 -08:00
|
|
|
MACHINE=${TARGET} MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \
|
|
|
|
${MAKE} prereq && \
|
|
|
|
MACHINE=${TARGET} MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \
|
2002-08-15 19:04:58 -07:00
|
|
|
${MAKE} DESTDIR=${CROSSDIR} includes)
|
|
|
|
@touch ${CROSSINCLUDES}
|
|
|
|
|
2003-04-16 20:48:56 -07:00
|
|
|
.if ${TARGET} == "alpha" || ${TARGET} == "hppa" || ${TARGET} == "i386" || \
|
|
|
|
${TARGET} == "macppc" || ${TARGET} == "mvmeppc" || ${TARGET} == "sgi" || \
|
|
|
|
${TARGET} == "sparc" || ${TARGET} == "sparc64"
|
2002-08-15 19:04:58 -07:00
|
|
|
BINUTILS= ar as gasp ld nm objcopy objdump ranlib readelf size \
|
|
|
|
strings strip
|
|
|
|
NEW_BINUTILS?= Yes
|
1998-04-24 23:42:44 -07:00
|
|
|
.else
|
2004-01-04 17:33:40 -08:00
|
|
|
BINUTILS= ar as ld nm ranlib objcopy objdump strings strip
|
2002-08-15 19:04:58 -07:00
|
|
|
NEW_BINUTILS?= No
|
1998-04-24 23:42:44 -07:00
|
|
|
.endif
|
|
|
|
|
2002-08-15 19:04:58 -07:00
|
|
|
${CROSSBINUTILS}: ${CROSSINCLUDES}
|
|
|
|
.if ${NEW_BINUTILS:L} == "yes"
|
|
|
|
export BSDSRCDIR=${.CURDIR}; \
|
1997-02-28 15:22:07 -08:00
|
|
|
(cd ${CROSSDIR}/usr/obj/gnu/usr.bin/binutils; \
|
1998-03-17 10:10:53 -08:00
|
|
|
/bin/sh ${BSDSRCDIR}/gnu/usr.bin/binutils/configure \
|
1997-02-28 15:22:07 -08:00
|
|
|
--prefix ${CROSSDIR}/usr \
|
2000-12-12 10:37:12 -08:00
|
|
|
--disable-nls --disable-gdbtk --disable-commonbfdlib \
|
1997-02-28 15:22:07 -08:00
|
|
|
--target `cat ${CROSSDIR}/TARGET_CANON` && \
|
2001-09-13 23:03:11 -07:00
|
|
|
${MAKE} CFLAGS="${CFLAGS}" && ${MAKE} install )
|
2002-08-15 19:04:58 -07:00
|
|
|
.else
|
1998-05-18 10:37:04 -07:00
|
|
|
(cd ${.CURDIR}/gnu/usr.bin/gas; \
|
2001-09-16 18:18:34 -07:00
|
|
|
TARGET_MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \
|
2002-08-15 19:04:58 -07:00
|
|
|
MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \
|
2001-09-16 18:18:34 -07:00
|
|
|
MAKEOBJDIR=obj.${MACHINE}.${TARGET} ${MAKE} depend all; \
|
|
|
|
TARGET_MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \
|
2002-08-15 19:04:58 -07:00
|
|
|
MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \
|
1998-04-24 23:42:44 -07:00
|
|
|
DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
|
|
|
${MAKE} NOMAN= install)
|
|
|
|
ln -sf ${CROSSDIR}/usr/bin/as \
|
|
|
|
${CROSSDIR}/usr/`cat ${CROSSDIR}/TARGET_CANON`/bin/as
|
1998-05-18 10:37:04 -07:00
|
|
|
(cd ${.CURDIR}/gnu/usr.bin/ld; \
|
2001-09-16 18:18:34 -07:00
|
|
|
TARGET_MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \
|
2002-08-15 19:04:58 -07:00
|
|
|
MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \
|
2002-09-17 09:19:49 -07:00
|
|
|
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
|
|
|
${MAKE} NOPIC= NOMAN= depend all; \
|
2001-09-16 18:18:34 -07:00
|
|
|
TARGET_MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \
|
2002-08-15 19:04:58 -07:00
|
|
|
MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \
|
1998-04-24 23:42:44 -07:00
|
|
|
DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
2002-09-17 09:19:49 -07:00
|
|
|
${MAKE} NOPIC= NOMAN= install)
|
1998-04-24 23:42:44 -07:00
|
|
|
ln -sf ${CROSSDIR}/usr/bin/ld \
|
|
|
|
${CROSSDIR}/usr/`cat ${CROSSDIR}/TARGET_CANON`/bin/ld
|
1998-05-18 10:37:04 -07:00
|
|
|
(cd ${.CURDIR}/usr.bin/ar; \
|
2001-09-07 12:29:49 -07:00
|
|
|
MAKEOBJDIR=obj.${MACHINE}.${TARGET} ${MAKE} NOMAN= depend all; \
|
1998-02-15 12:56:40 -08:00
|
|
|
DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
|
|
|
${MAKE} NOMAN= install)
|
1998-04-24 23:42:44 -07:00
|
|
|
ln -sf ${CROSSDIR}/usr/bin/ar \
|
|
|
|
${CROSSDIR}/usr/`cat ${CROSSDIR}/TARGET_CANON`/bin/ar
|
1998-05-18 10:37:04 -07:00
|
|
|
(cd ${.CURDIR}/usr.bin/ranlib; \
|
2001-09-07 12:29:49 -07:00
|
|
|
MAKEOBJDIR=obj.${MACHINE}.${TARGET} ${MAKE} NOMAN= depend all; \
|
1998-05-11 00:43:12 -07:00
|
|
|
DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
|
|
|
${MAKE} NOMAN= install)
|
|
|
|
ln -sf ${CROSSDIR}/usr/bin/ranlib \
|
|
|
|
${CROSSDIR}/usr/`cat ${CROSSDIR}/TARGET_CANON`/bin/ranlib
|
1998-05-18 10:37:04 -07:00
|
|
|
(cd ${.CURDIR}/usr.bin/strip; \
|
1998-05-11 00:43:12 -07:00
|
|
|
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
2001-09-16 18:18:34 -07:00
|
|
|
${MAKE} TARGET_MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \
|
2002-08-15 19:04:58 -07:00
|
|
|
MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \
|
2001-09-16 18:18:34 -07:00
|
|
|
NOMAN= depend all; \
|
1998-05-11 00:43:12 -07:00
|
|
|
DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
2001-09-16 18:18:34 -07:00
|
|
|
${MAKE} TARGET_MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \
|
2002-08-15 19:04:58 -07:00
|
|
|
MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \
|
2001-09-16 18:18:34 -07:00
|
|
|
NOMAN= install)
|
1998-05-11 00:43:12 -07:00
|
|
|
ln -sf ${CROSSDIR}/usr/bin/strip \
|
|
|
|
${CROSSDIR}/usr/`cat ${CROSSDIR}/TARGET_CANON`/bin/strip
|
1998-05-18 10:37:04 -07:00
|
|
|
(cd ${.CURDIR}/usr.bin/nm; \
|
1998-05-16 13:56:52 -07:00
|
|
|
MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
2001-09-16 18:18:34 -07:00
|
|
|
${MAKE} TARGET_MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \
|
2002-08-15 19:04:58 -07:00
|
|
|
MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \
|
2001-09-16 18:18:34 -07:00
|
|
|
NOMAN= depend all; \
|
1998-05-11 00:43:12 -07:00
|
|
|
DESTDIR=${CROSSDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
|
|
|
${MAKE} NOMAN= install)
|
|
|
|
ln -sf ${CROSSDIR}/usr/bin/nm \
|
|
|
|
${CROSSDIR}/usr/`cat ${CROSSDIR}/TARGET_CANON`/bin/nm
|
2004-01-04 17:33:40 -08:00
|
|
|
ln -sf ${CROSSDIR}/usr/bin/size \
|
|
|
|
${CROSSDIR}/usr/`cat ${CROSSDIR}/TARGET_CANON`/bin/nm
|
2002-08-15 19:04:58 -07:00
|
|
|
.endif
|
|
|
|
@for cmd in ${BINUTILS}; do \
|
|
|
|
if [ ! -e ${CROSSDIR}/usr/bin/$$cmd -a \
|
|
|
|
-e ${CROSSDIR}/usr/bin/`cat ${CROSSDIR}/TARGET_CANON`-$$cmd ]; then \
|
|
|
|
ln -sf ${CROSSDIR}/usr/bin/`cat ${CROSSDIR}/TARGET_CANON`-$$cmd \
|
|
|
|
${CROSSDIR}/usr/bin/$$cmd ;\
|
|
|
|
elif [ -e ${CROSSDIR}/usr/bin/$$cmd -a \
|
|
|
|
! -e ${CROSSDIR}/usr/bin/`cat ${CROSSDIR}/TARGET_CANON`-$$cmd ]; then \
|
|
|
|
ln -sf ${CROSSDIR}/usr/bin/$$cmd \
|
|
|
|
${CROSSDIR}/usr/bin/`cat ${CROSSDIR}/TARGET_CANON`-$$cmd; \
|
|
|
|
fi ;\
|
|
|
|
done
|
|
|
|
@touch ${CROSSBINUTILS}
|
1998-05-11 00:43:12 -07:00
|
|
|
|
2002-08-15 19:04:58 -07:00
|
|
|
${CROSSGCC}: ${CROSSBINUTILS}
|
1999-12-22 13:25:24 -08:00
|
|
|
(cd ${CROSSDIR}/usr/obj/gnu/egcs/gcc; \
|
|
|
|
/bin/sh ${.CURDIR}/gnu/egcs/gcc/configure \
|
1997-02-28 15:22:07 -08:00
|
|
|
--prefix ${CROSSDIR}/usr \
|
2001-09-13 23:03:11 -07:00
|
|
|
--target `cat ${CROSSDIR}/TARGET_CANON` \
|
|
|
|
--with-gxx-include-dir=${CROSSDIR}/usr/include/g++ && \
|
2002-08-15 19:04:58 -07:00
|
|
|
PATH=${CROSSPATH} ${MAKE} BISON=yacc LANGUAGES="${CROSSLANGS}" \
|
|
|
|
LDFLAGS="${LDSTATIC}" build_infodir=. \
|
2001-01-17 12:14:04 -08:00
|
|
|
GCC_FOR_TARGET="./xgcc -B./ -I${CROSSDIR}/usr/include" && \
|
2002-08-15 19:04:58 -07:00
|
|
|
${MAKE} BISON=yacc LANGUAGES="${CROSSLANGS}" LDFLAGS="${LDSTATIC}" \
|
2001-01-17 12:14:04 -08:00
|
|
|
GCC_FOR_TARGET="./xgcc -B./ -I${CROSSDIR}/usr/include" \
|
1998-05-16 13:56:52 -07:00
|
|
|
build_infodir=. INSTALL_MAN= INSTALL_HEADERS_DIR= install)
|
1998-05-14 14:43:02 -07:00
|
|
|
ln -sf ${CROSSDIR}/usr/bin/`cat ${CROSSDIR}/TARGET_CANON`-gcc \
|
|
|
|
${CROSSDIR}/usr/bin/cc
|
2001-09-13 23:03:11 -07:00
|
|
|
ln -sf ${CROSSDIR}/usr/bin/`cat ${CROSSDIR}/TARGET_CANON`-g++ \
|
|
|
|
${CROSSDIR}/usr/bin/c++
|
2001-01-26 16:58:23 -08:00
|
|
|
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
|
2001-09-03 09:26:02 -07:00
|
|
|
${CROSSDIR}/usr/obj/gnu/egcs/gcc/cpp \
|
2001-01-26 16:58:23 -08:00
|
|
|
${CROSSDIR}/usr/libexec/cpp
|
|
|
|
sed -e 's#/usr/libexec/cpp#${CROSSDIR}/usr/libexec/cpp#' \
|
1998-05-18 10:37:04 -07:00
|
|
|
-e 's#/usr/include#${CROSSDIR}/usr/include#' \
|
|
|
|
${.CURDIR}/usr.bin/cpp/cpp.sh > ${CROSSDIR}/usr/bin/cpp
|
1998-05-14 14:43:02 -07:00
|
|
|
chmod ${BINMODE} ${CROSSDIR}/usr/bin/cpp
|
2001-01-26 16:58:23 -08:00
|
|
|
chown ${BINOWN}:${BINGRP} ${CROSSDIR}/usr/bin/cpp
|
2002-08-15 19:04:58 -07:00
|
|
|
@touch ${CROSSGCC}
|
1998-05-14 14:43:02 -07:00
|
|
|
|
1999-01-24 08:40:42 -08:00
|
|
|
# XXX MAKEOBJDIR maybe should be obj.${TARGET} here, revisit later
|
2002-08-15 19:04:58 -07:00
|
|
|
cross-lib: ${CROSSGCC}
|
1998-05-16 13:56:52 -07:00
|
|
|
MACHINE=${TARGET} MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH`; \
|
|
|
|
export MACHINE MACHINE_ARCH; \
|
1998-05-18 10:37:04 -07:00
|
|
|
(cd ${.CURDIR}/lib; \
|
1998-05-16 13:56:52 -07:00
|
|
|
for lib in csu libc; do \
|
2002-08-15 19:04:58 -07:00
|
|
|
(cd $$lib; \
|
2003-10-04 17:12:52 -07:00
|
|
|
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
2002-08-15 19:04:58 -07:00
|
|
|
${MAKE} depend all install); \
|
1998-05-16 13:56:52 -07:00
|
|
|
done; \
|
2003-10-04 17:12:52 -07:00
|
|
|
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
2003-10-04 17:18:02 -07:00
|
|
|
SKIPDIR=\"${NO_CROSS} libocurses/PSD.doc\" \
|
2002-08-15 19:04:58 -07:00
|
|
|
${MAKE} depend all install)
|
1997-02-28 15:22:07 -08:00
|
|
|
|
2002-08-15 19:04:58 -07:00
|
|
|
cross-bin: ${CROSSOBJ}
|
|
|
|
MACHINE=${TARGET} MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH`; \
|
|
|
|
export MACHINE MACHINE_ARCH; \
|
|
|
|
for i in libexec bin sbin usr.bin usr.sbin; do \
|
|
|
|
(cd ${.CURDIR}/$$i; \
|
2003-10-04 17:12:52 -07:00
|
|
|
eval ${CROSSENV} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
2003-10-04 17:18:02 -07:00
|
|
|
SKIPDIR=\"${BINUTILS} ${NO_CROSS}\" \
|
2002-08-15 19:04:58 -07:00
|
|
|
${MAKE} depend all install); \
|
|
|
|
done
|
|
|
|
|
|
|
|
cross-etc-root-var: ${CROSSOBJ}
|
|
|
|
(cd ${.CURDIR}/etc && \
|
|
|
|
DESTDIR=${CROSSDIR} ${MAKE} distribution-etc-root-var)
|
|
|
|
|
|
|
|
cross-depend: .PHONY
|
|
|
|
@(cd ${.CURDIR} && \
|
|
|
|
BSDOBJDIR=${CROSSDIR}/usr/obj \
|
|
|
|
BSDSRCDIR=${.CURDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
|
|
|
SKIPDIR="${NO_CROSS}" \
|
|
|
|
${MAKE} depend)
|
|
|
|
|
|
|
|
cross-clean: .PHONY
|
|
|
|
@(cd ${.CURDIR} && \
|
|
|
|
BSDOBJDIR=${CROSSDIR}/usr/obj \
|
|
|
|
BSDSRCDIR=${.CURDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
|
|
|
SKIPDIR="${NO_CROSS}" \
|
|
|
|
${MAKE} clean)
|
|
|
|
|
|
|
|
cross-cleandir: .PHONY
|
|
|
|
@(cd ${.CURDIR} && \
|
|
|
|
BSDOBJDIR=${CROSSDIR}/usr/obj \
|
|
|
|
BSDSRCDIR=${.CURDIR} MAKEOBJDIR=obj.${MACHINE}.${TARGET} \
|
|
|
|
SKIPDIR="${NO_CROSS}" \
|
|
|
|
${MAKE} cleandir)
|
|
|
|
|
|
|
|
.endif # defined(TARGET)
|
|
|
|
|
1995-10-18 01:37:01 -07:00
|
|
|
.include <bsd.subdir.mk>
|