]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - Makefile.inc0
Split out afterdistribute and distribute from BKTGTS because they do
[FreeBSD/FreeBSD.git] / Makefile.inc0
1 #
2 #       $Id: Makefile.inc0,v 1.12 1998/12/16 11:45:51 ache 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= all checkdpadd clean cleandepend cleandir \
33         depend everything hierarchy includes install installmost \
34         lint maninstall mk most obj objlink regress rerelease \
35         tags update
36
37 #
38 # A generic rule for the backend targets.
39 #
40 ${BKTGTS} :
41         @cd ${.CURDIR}; ${MAKE} ${.TARGET}
42
43 # These targets are used during a make release, which is done after a
44 # make world, so they should use the same OBJDIRPREFIX that was used
45 # during the make world.
46 RELTGTS= afterdistribute distribute
47
48 ${RELTGTS} :
49         @cd ${.CURDIR}; ${MK_ENV} ${MAKE} ${.TARGET}
50
51 #
52 # Temporary path and environment for the legacy build.
53 #
54 ELFTMP=         ${MAKEOBJDIRPREFIX}/elf${.CURDIR}/tmp
55 ELFTMPPATH=     ${ELFTMP}/sbin:${ELFTMP}/bin:${ELFTMP}/usr/sbin:${ELFTMP}/usr/bin:${ELFTMP}/usr/games
56 LEGACY_ENV=     PATH=${ELFTMPPATH} OBJFORMAT=aout NOTOOLS=1 TOOLROOT=${ELFTMP} \
57                 MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/aout
58 XMAKE=          ${ELFTMP}/usr/bin/${MAKE}
59
60 #
61 # world
62 #
63 # Attempt to rebuild and reinstall *everything*, with reasonable chance of
64 # success, regardless of how old your existing system is. If building on
65 # an i386/elf system, build the aout legacy cruft too.
66 #
67 world:
68         @echo "--------------------------------------------------------------"
69         @echo ">>> ${OBJFORMAT} make world started on `LC_TIME=C date`"
70         @echo "--------------------------------------------------------------"
71 .if target(pre-world)
72         @echo
73         @echo "--------------------------------------------------------------"
74         @echo ">>> Making 'pre-world' target"
75         @echo "--------------------------------------------------------------"
76         @cd ${.CURDIR}; ${MK_ENV} ${MAKE} pre-world
77 .endif
78         @cd ${.CURDIR}; ${MK_ENV} ${MAKE} buildworld
79 .if     ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
80         @cd ${.CURDIR}; ${LEGACY_ENV} ${XMAKE} legacy-build
81 .endif
82         @cd ${.CURDIR}; ${MK_ENV} ${MAKE} -B installworld
83 .if     ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
84         @cd ${.CURDIR}; ${LEGACY_ENV} ${XMAKE} legacy-install
85 .endif
86 .if target(post-world)
87         @echo
88         @echo "--------------------------------------------------------------"
89         @echo ">>> Making 'post-world' target"
90         @echo "--------------------------------------------------------------"
91         @cd ${.CURDIR}; ${MK_ENV} ${MAKE} post-world
92 .endif
93         @echo
94         @echo "--------------------------------------------------------------"
95         @echo ">>> ${OBJFORMAT} make world completed on `LC_TIME=C date`"
96         @echo "--------------------------------------------------------------"
97
98 #
99 # buildworld
100 #
101 # Build the world in the current object format, plus the legacy aout
102 # support if the current object format is elf on i386.
103 #
104 buildworld      :
105         @cd ${.CURDIR}; ${MK_ENV} ${MAKE} buildworld
106 .if     ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
107         @cd ${.CURDIR}; ${LEGACY_ENV} ${XMAKE} legacy-build
108 .endif
109
110 #
111 # installworld
112 #
113 # Install the world in the current object format, plus the legacy aout
114 # support if the current object format is elf on i386.
115 #
116 installworld    :
117         @cd ${.CURDIR}; ${MK_ENV} ${MAKE} installworld
118 .if     ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
119         @cd ${.CURDIR}; ${LEGACY_ENV} ${XMAKE} -DNOMAN -DNOINFO legacy-install
120 .endif