2 # $Id: Makefile.inc0,v 1.5 1998/09/07 18:10:26 ache Exp $
4 # This makefile ensures that the object directory is set according to the
5 # object format to avoid mixing aout and elf formatted files during the
8 # >> Beware, this makefile overwrites the local build environment! <<
12 # Build things relative to the user's preferred object directory,
13 # defaulting to /usr/obj if not defined.
15 MAKEOBJDIRPREFIX?=/usr/obj
18 # Variables passed to make work better if they are set as environment
19 # variables instead of command line options.
21 MK_ENV= MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${OBJFORMAT}
24 # We should always use the current set of mk files, not the installed ones.
25 # This makefile is a wrapper for the backend makefile (Makefile.inc1).
27 MAKE= make -m ${.CURDIR}/share/mk -f Makefile.inc1
30 # These are the backend targets.
32 BKTGTS= afterdistribute all clean cleandepend cleanobj depend distribute \
33 everything includes installmost install most obj rerelease update
36 # A generic rule for the backend targets.
39 @cd ${.CURDIR}; ${MK_ENV} ${MAKE} ${.TARGET}
42 # Temporary path and environment for the legacy build.
44 ELFTMPPATH= ${MAKEOBJDIRPREFIX}/elf${.CURDIR}/tmp/sbin:${MAKEOBJDIRPREFIX}/elf${.CURDIR}/tmp/bin:${MAKEOBJDIRPREFIX}/elf${.CURDIR}/tmp/usr/sbin:${MAKEOBJDIRPREFIX}/elf${.CURDIR}/tmp/usr/bin:${MAKEOBJDIRPREFIX}/elf${.CURDIR}/tmp/usr/games
45 LEGACY_ENV= MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/aout \
46 PATH=${ELFTMPPATH} OBJFORMAT=aout NOTOOLS=1 \
47 TOOLROOT=${MAKEOBJDIRPREFIX}/elf${.CURDIR}/tmp
52 # Attempt to rebuild and reinstall *everything*, with reasonable chance of
53 # success, regardless of how old your existing system is. If building on
54 # an i386/elf system, build the aout legacy cruft too.
57 @echo "--------------------------------------------------------------"
58 @echo " ${OBJFORMAT} make world started on `LC_TIME=C date`"
59 @echo "--------------------------------------------------------------"
62 @echo "--------------------------------------------------------------"
63 @echo " Making 'pre-world' target"
64 @echo "--------------------------------------------------------------"
65 @cd ${.CURDIR}; ${MK_ENV} ${MAKE} pre-world
67 @cd ${.CURDIR}; ${MK_ENV} ${MAKE} buildworld
68 .if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
69 @cd ${.CURDIR}; ${LEGACY_ENV} ${MAKE} legacy-build
71 @cd ${.CURDIR}; ${MK_ENV} ${MAKE} -B installworld
72 .if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
73 @cd ${.CURDIR}; ${LEGACY_ENV} ${MAKE} legacy-install
75 .if target(post-world)
77 @echo "--------------------------------------------------------------"
78 @echo " Making 'post-world' target"
79 @echo "--------------------------------------------------------------"
80 @cd ${.CURDIR}; ${MK_ENV} ${MAKE} post-world
83 @echo "--------------------------------------------------------------"
84 @echo " ${OBJFORMAT} make world completed on `LC_TIME=C date`"
85 @echo "--------------------------------------------------------------"
90 # Build the world in the current object format, plus the legacy aout
91 # support if the current object format is elf on i386.
94 @cd ${.CURDIR}; ${MK_ENV} ${MAKE} buildworld
95 .if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
96 @cd ${.CURDIR}; ${LEGACY_ENV} ${MAKE} legacy-build
102 # Install the world in the current object format, plus the legacy aout
103 # support if the current object format is elf on i386.
106 @cd ${.CURDIR}; ${MK_ENV} ${MAKE} installworld
107 .if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
108 @cd ${.CURDIR}; ${LEGACY_ENV} ${MAKE} -DNOMAN -DNOINFO legacy-install