2 # $Id: Makefile.inc0,v 1.6 1998/09/09 06:03:51 jb 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 hierarchy includes installmost install most obj \
37 # A generic rule for the backend targets.
40 @cd ${.CURDIR}; ${MK_ENV} ${MAKE} ${.TARGET}
43 # Temporary path and environment for the legacy build.
45 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
46 LEGACY_ENV= MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/aout \
47 PATH=${ELFTMPPATH} OBJFORMAT=aout NOTOOLS=1 \
48 TOOLROOT=${MAKEOBJDIRPREFIX}/elf${.CURDIR}/tmp
53 # Attempt to rebuild and reinstall *everything*, with reasonable chance of
54 # success, regardless of how old your existing system is. If building on
55 # an i386/elf system, build the aout legacy cruft too.
58 @echo "--------------------------------------------------------------"
59 @echo " ${OBJFORMAT} make world started on `LC_TIME=C date`"
60 @echo "--------------------------------------------------------------"
63 @echo "--------------------------------------------------------------"
64 @echo " Making 'pre-world' target"
65 @echo "--------------------------------------------------------------"
66 @cd ${.CURDIR}; ${MK_ENV} ${MAKE} pre-world
68 @cd ${.CURDIR}; ${MK_ENV} ${MAKE} buildworld
69 .if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
70 @cd ${.CURDIR}; ${LEGACY_ENV} ${MAKE} legacy-build
72 @cd ${.CURDIR}; ${MK_ENV} ${MAKE} -B installworld
73 .if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
74 @cd ${.CURDIR}; ${LEGACY_ENV} ${MAKE} legacy-install
76 .if target(post-world)
78 @echo "--------------------------------------------------------------"
79 @echo " Making 'post-world' target"
80 @echo "--------------------------------------------------------------"
81 @cd ${.CURDIR}; ${MK_ENV} ${MAKE} post-world
84 @echo "--------------------------------------------------------------"
85 @echo " ${OBJFORMAT} make world completed on `LC_TIME=C date`"
86 @echo "--------------------------------------------------------------"
91 # Build the world in the current object format, plus the legacy aout
92 # support if the current object format is elf on i386.
95 @cd ${.CURDIR}; ${MK_ENV} ${MAKE} buildworld
96 .if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
97 @cd ${.CURDIR}; ${LEGACY_ENV} ${MAKE} legacy-build
103 # Install the world in the current object format, plus the legacy aout
104 # support if the current object format is elf on i386.
107 @cd ${.CURDIR}; ${MK_ENV} ${MAKE} installworld
108 .if ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
109 @cd ${.CURDIR}; ${LEGACY_ENV} ${MAKE} -DNOMAN -DNOINFO legacy-install