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