]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - Makefile.inc0
Fix to properly newfs the MFS in case of custom setup. Mention this in docs.
[FreeBSD/FreeBSD.git] / Makefile.inc0
1 #
2 #       $Id: Makefile.inc0,v 1.6 1998/09/09 06:03:51 jb Exp $
3 #
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
6 # transition period.
7 #
8 # >> Beware, this makefile  overwrites the local build environment! <<
9 #
10
11 #
12 # Build things relative to the user's preferred object directory,
13 # defaulting to /usr/obj if not defined.
14 #
15 MAKEOBJDIRPREFIX?=/usr/obj
16
17 #
18 # Variables passed to make work better if they are set as environment
19 # variables instead of command line options.
20 #
21 MK_ENV= MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${OBJFORMAT}
22
23 #
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).
26 #
27 MAKE=   make -m ${.CURDIR}/share/mk -f Makefile.inc1
28
29 #
30 # These are the backend targets.
31 #
32 BKTGTS= afterdistribute all clean cleandepend cleanobj depend distribute \
33         everything hierarchy includes installmost install most obj \
34         rerelease update
35
36 #
37 # A generic rule for the backend targets.
38 #
39 ${BKTGTS} :
40         @cd ${.CURDIR}; ${MK_ENV} ${MAKE} ${.TARGET}
41
42 #
43 # Temporary path and environment for the legacy build.
44 #
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
49
50 #
51 # world
52 #
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.
56 #
57 world:
58         @echo "--------------------------------------------------------------"
59         @echo " ${OBJFORMAT} make world started on `LC_TIME=C date`"
60         @echo "--------------------------------------------------------------"
61 .if target(pre-world)
62         @echo
63         @echo "--------------------------------------------------------------"
64         @echo " Making 'pre-world' target"
65         @echo "--------------------------------------------------------------"
66         @cd ${.CURDIR}; ${MK_ENV} ${MAKE} pre-world
67 .endif
68         @cd ${.CURDIR}; ${MK_ENV} ${MAKE} buildworld
69 .if     ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
70         @cd ${.CURDIR}; ${LEGACY_ENV} ${MAKE} legacy-build
71 .endif
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
75 .endif
76 .if target(post-world)
77         @echo
78         @echo "--------------------------------------------------------------"
79         @echo " Making 'post-world' target"
80         @echo "--------------------------------------------------------------"
81         @cd ${.CURDIR}; ${MK_ENV} ${MAKE} post-world
82 .endif
83         @echo
84         @echo "--------------------------------------------------------------"
85         @echo " ${OBJFORMAT} make world completed on `LC_TIME=C date`"
86         @echo "--------------------------------------------------------------"
87
88 #
89 # buildworld
90 #
91 # Build the world in the current object format, plus the legacy aout
92 # support if the current object format is elf on i386.
93 #
94 buildworld      :
95         @cd ${.CURDIR}; ${MK_ENV} ${MAKE} buildworld
96 .if     ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
97         @cd ${.CURDIR}; ${LEGACY_ENV} ${MAKE} legacy-build
98 .endif
99
100 #
101 # installworld
102 #
103 # Install the world in the current object format, plus the legacy aout
104 # support if the current object format is elf on i386.
105 #
106 installworld    :
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
110 .endif