=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/Makefile,v retrieving revision 1.5 retrieving revision 1.23 diff -u -r1.5 -r1.23 --- src/Makefile 1996/03/02 21:04:11 1.5 +++ src/Makefile 1997/12/09 19:45:29 1.23 @@ -1,18 +1,40 @@ -# $NetBSD: Makefile,v 1.25 1995/10/09 02:11:28 thorpej Exp $ +# $OpenBSD: Makefile,v 1.23 1997/12/09 19:45:29 niklas Exp $ -# NOTE THAT etc *DOES NOT* BELONG IN THE LIST BELOW +# +# For more information on building in tricky environments, please see +# the list of possible environment variables described in +# /usr/share/mk/bsd.README. +# +# Building recommendations: +# +# 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. +# +# 3) If you are reasonably sure that things will compile OK, use the +# "make build" target supplied here. Good luck. +.include # for NOMAN, if it's there. + SUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share games SUBDIR+= gnu SUBDIR+= sys lkm -.include # for NOMAN, if it's there. - -.if defined(KERBEROS) +.if (${KERBEROS} == "yes") SUBDIR+= kerberosIV .endif +.if make(clean) || make(cleandir) || make(obj) +SUBDIR+= distrib +.endif + .if exists(regress) .ifmake !(install) SUBDIR+= regress @@ -23,22 +45,92 @@ @(cd ${.CURDIR}/regress && ${MAKE} regress) .endif -#beforeinstall: -# (cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs) +includes: + (cd ${.CURDIR}/include; ${MAKE} includes) +beforeinstall: +.ifndef DESTDIR + (cd ${.CURDIR}/etc && ${MAKE} DESTDIR=/ distrib-dirs) +.else + (cd ${.CURDIR}/etc && ${MAKE} distrib-dirs) +.endif + (cd ${.CURDIR}/include; ${MAKE} includes) + afterinstall: .ifndef NOMAN (cd ${.CURDIR}/share/man && ${MAKE} makedb) .endif build: - (cd ${.CURDIR}/include && ${MAKE} install) +.ifdef GLOBAL_AUTOCONF_CACHE + rm -f ${GLOBAL_AUTOCONF_CACHE} +.endif + (cd ${.CURDIR}/share/mk && ${MAKE} install) + (cd ${.CURDIR}/include; ${MAKE} includes) ${MAKE} cleandir (cd ${.CURDIR}/lib && ${MAKE} depend && ${MAKE} && ${MAKE} install) (cd ${.CURDIR}/gnu/lib && ${MAKE} depend && ${MAKE} && ${MAKE} install) -.if defined(KERBEROS) +.if (${MACHINE_ARCH} == "mips") + ldconfig +.endif +.if (${KERBEROS} == "yes") (cd ${.CURDIR}/kerberosIV && ${MAKE} build) .endif +.if (${MACHINE_ARCH} == "mips") + ldconfig +.endif ${MAKE} depend && ${MAKE} && ${MAKE} install + +.if !defined(TARGET) +cross-tools: + echo "TARGET must be set"; exit 1 +.else +cross-tools: cross-helpers cross-includes cross-binutils cross-gcc + +CROSSDIR= ${DESTDIR}/usr/cross/${TARGET} + +cross-helpers: + -mkdir -p ${CROSSDIR}/usr/include + echo _MACHINE_ARCH | \ + cat ${.CURDIR}/sys/arch/${TARGET}/include/param.h - | \ + ${CPP} -E |sed -n '$$p' >${CROSSDIR}/TARGET_ARCH + eval `grep '^osr=' sys/conf/newvers.sh`; \ + sed "s/\$$/-unknown-openbsd$$osr/" ${CROSSDIR}/TARGET_ARCH > \ + ${CROSSDIR}/TARGET_CANON + +cross-includes: + ${MAKE} MACHINE=${TARGET} MACHINE_ARCH=`cat ${CROSSDIR}/TARGET_ARCH` \ + DESTDIR=${CROSSDIR} includes + +cross-binutils: + -mkdir -p ${CROSSDIR}/usr/obj + export BSDSRCDIR=`pwd`; \ + (cd ${.CURDIR}/gnu/usr.bin/binutils; \ + BSDOBJDIR=${CROSSDIR}/usr/obj \ + MAKEOBJDIR=obj.${MACHINE}.${TARGET} \ + ${MAKE} -f Makefile.bsd-wrapper obj); \ + (cd ${CROSSDIR}/usr/obj/gnu/usr.bin/binutils; \ + ${BSDSRCDIR}/gnu/usr.bin/binutils/configure \ + --prefix ${CROSSDIR}/usr \ + --target `cat ${CROSSDIR}/TARGET_CANON` && \ + ${MAKE} && ${MAKE} install) + ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 755 \ + ${.CURDIR}/usr.bin/lorder/lorder.sh.gnm \ + ${CROSSDIR}/usr/bin/`cat ${CROSSDIR}/TARGET_CANON`-lorder + +cross-gcc: + -mkdir -p ${CROSSDIR}/usr/obj + (cd gnu/usr.bin/gcc; \ + BSDOBJDIR=${CROSSDIR}/usr/obj BSDSRCDIR=${.CURDIR} \ + MAKEOBJDIR=obj.${MACHINE}.${TARGET} \ + ${MAKE} -f Makefile.bsd-wrapper obj) + (cd ${CROSSDIR}/usr/obj/gnu/usr.bin/gcc; \ + ${.CURDIR}/gnu/usr.bin/gcc/configure \ + --prefix ${CROSSDIR}/usr \ + --target `cat ${CROSSDIR}/TARGET_CANON` && \ + ${MAKE} BISON=yacc LANGUAGES=c \ + GCC_FOR_TARGET="./xgcc -B./ -I${CROSSDIR}/usr/include" && \ + ${MAKE} LANGUAGES=c install) +.endif .include