1998-08-31 03:08:08 +02:00
|
|
|
#
|
1999-01-14 07:45:53 +01:00
|
|
|
# $Id: Makefile.inc0,v 1.13 1998/12/20 14:30:08 jhay Exp $
|
1998-08-31 03:08:08 +02:00
|
|
|
#
|
|
|
|
# This makefile ensures that the object directory is set according to the
|
|
|
|
# object format to avoid mixing aout and elf formatted files during the
|
|
|
|
# transition period.
|
|
|
|
#
|
|
|
|
# >> Beware, this makefile overwrites the local build environment! <<
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build things relative to the user's preferred object directory,
|
|
|
|
# defaulting to /usr/obj if not defined.
|
|
|
|
#
|
|
|
|
MAKEOBJDIRPREFIX?=/usr/obj
|
|
|
|
|
|
|
|
#
|
|
|
|
# Variables passed to make work better if they are set as environment
|
|
|
|
# variables instead of command line options.
|
|
|
|
#
|
1999-01-14 07:45:53 +01:00
|
|
|
.if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "aout"
|
1998-08-31 03:08:08 +02:00
|
|
|
MK_ENV= MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${OBJFORMAT}
|
1999-01-14 07:45:53 +01:00
|
|
|
.endif
|
1998-08-31 03:08:08 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# We should always use the current set of mk files, not the installed ones.
|
|
|
|
# This makefile is a wrapper for the backend makefile (Makefile.inc1).
|
|
|
|
#
|
|
|
|
MAKE= make -m ${.CURDIR}/share/mk -f Makefile.inc1
|
|
|
|
|
|
|
|
#
|
|
|
|
# These are the backend targets.
|
|
|
|
#
|
1998-12-20 15:30:08 +01:00
|
|
|
BKTGTS= all checkdpadd clean cleandepend cleandir \
|
|
|
|
depend everything hierarchy includes install installmost \
|
1998-10-17 17:25:26 +02:00
|
|
|
lint maninstall mk most obj objlink regress rerelease \
|
|
|
|
tags update
|
1998-08-31 03:08:08 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# A generic rule for the backend targets.
|
|
|
|
#
|
|
|
|
${BKTGTS} :
|
1998-12-16 12:45:51 +01:00
|
|
|
@cd ${.CURDIR}; ${MAKE} ${.TARGET}
|
1998-08-31 03:08:08 +02:00
|
|
|
|
1998-12-20 15:30:08 +01:00
|
|
|
# These targets are used during a make release, which is done after a
|
|
|
|
# make world, so they should use the same OBJDIRPREFIX that was used
|
|
|
|
# during the make world.
|
|
|
|
RELTGTS= afterdistribute distribute
|
|
|
|
|
|
|
|
${RELTGTS} :
|
|
|
|
@cd ${.CURDIR}; ${MK_ENV} ${MAKE} ${.TARGET}
|
|
|
|
|
1998-08-31 03:08:08 +02:00
|
|
|
#
|
|
|
|
# Temporary path and environment for the legacy build.
|
|
|
|
#
|
1999-01-14 07:45:53 +01:00
|
|
|
ELFTMP= ${MAKEOBJDIRPREFIX}${.CURDIR}/tmp
|
1998-09-28 22:41:31 +02:00
|
|
|
ELFTMPPATH= ${ELFTMP}/sbin:${ELFTMP}/bin:${ELFTMP}/usr/sbin:${ELFTMP}/usr/bin:${ELFTMP}/usr/games
|
|
|
|
LEGACY_ENV= PATH=${ELFTMPPATH} OBJFORMAT=aout NOTOOLS=1 TOOLROOT=${ELFTMP} \
|
|
|
|
MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/aout
|
|
|
|
XMAKE= ${ELFTMP}/usr/bin/${MAKE}
|
1998-08-31 03:08:08 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# world
|
|
|
|
#
|
|
|
|
# Attempt to rebuild and reinstall *everything*, with reasonable chance of
|
|
|
|
# success, regardless of how old your existing system is. If building on
|
|
|
|
# an i386/elf system, build the aout legacy cruft too.
|
|
|
|
#
|
|
|
|
world:
|
|
|
|
@echo "--------------------------------------------------------------"
|
1998-09-17 18:32:00 +02:00
|
|
|
@echo ">>> ${OBJFORMAT} make world started on `LC_TIME=C date`"
|
1998-08-31 03:08:08 +02:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
.if target(pre-world)
|
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
1998-09-17 18:32:00 +02:00
|
|
|
@echo ">>> Making 'pre-world' target"
|
1998-08-31 03:08:08 +02:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@cd ${.CURDIR}; ${MK_ENV} ${MAKE} pre-world
|
|
|
|
.endif
|
|
|
|
@cd ${.CURDIR}; ${MK_ENV} ${MAKE} buildworld
|
|
|
|
.if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
|
1998-09-28 22:41:31 +02:00
|
|
|
@cd ${.CURDIR}; ${LEGACY_ENV} ${XMAKE} legacy-build
|
1998-08-31 03:08:08 +02:00
|
|
|
.endif
|
|
|
|
@cd ${.CURDIR}; ${MK_ENV} ${MAKE} -B installworld
|
|
|
|
.if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
|
1998-09-28 22:41:31 +02:00
|
|
|
@cd ${.CURDIR}; ${LEGACY_ENV} ${XMAKE} legacy-install
|
1998-08-31 03:08:08 +02:00
|
|
|
.endif
|
|
|
|
.if target(post-world)
|
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
1998-09-17 18:32:00 +02:00
|
|
|
@echo ">>> Making 'post-world' target"
|
1998-08-31 03:08:08 +02:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@cd ${.CURDIR}; ${MK_ENV} ${MAKE} post-world
|
|
|
|
.endif
|
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
1998-09-17 18:32:00 +02:00
|
|
|
@echo ">>> ${OBJFORMAT} make world completed on `LC_TIME=C date`"
|
1998-08-31 03:08:08 +02:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
|
|
|
|
#
|
|
|
|
# buildworld
|
|
|
|
#
|
|
|
|
# Build the world in the current object format, plus the legacy aout
|
|
|
|
# support if the current object format is elf on i386.
|
|
|
|
#
|
|
|
|
buildworld :
|
|
|
|
@cd ${.CURDIR}; ${MK_ENV} ${MAKE} buildworld
|
|
|
|
.if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
|
1998-09-28 22:41:31 +02:00
|
|
|
@cd ${.CURDIR}; ${LEGACY_ENV} ${XMAKE} legacy-build
|
1998-08-31 03:08:08 +02:00
|
|
|
.endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# installworld
|
|
|
|
#
|
|
|
|
# Install the world in the current object format, plus the legacy aout
|
|
|
|
# support if the current object format is elf on i386.
|
|
|
|
#
|
|
|
|
installworld :
|
|
|
|
@cd ${.CURDIR}; ${MK_ENV} ${MAKE} installworld
|
|
|
|
.if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
|
1998-09-28 22:41:31 +02:00
|
|
|
@cd ${.CURDIR}; ${LEGACY_ENV} ${XMAKE} -DNOMAN -DNOINFO legacy-install
|
1998-08-31 03:08:08 +02:00
|
|
|
.endif
|