]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - Makefile.inc0
I don't want to be the only one to use ``cut''. Use ``sed'' instead.
[FreeBSD/FreeBSD.git] / Makefile.inc0
1 #
2 #       $Id: Makefile.inc0,v 1.5 1998/09/07 18:10:26 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= afterdistribute all clean cleandepend cleanobj depend distribute \
33         everything includes installmost install most obj rerelease update
34
35 #
36 # A generic rule for the backend targets.
37 #
38 ${BKTGTS} :
39         @cd ${.CURDIR}; ${MK_ENV} ${MAKE} ${.TARGET}
40
41 #
42 # Temporary path and environment for the legacy build.
43 #
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
48
49 #
50 # world
51 #
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.
55 #
56 world:
57         @echo "--------------------------------------------------------------"
58         @echo " ${OBJFORMAT} make world started on `LC_TIME=C date`"
59         @echo "--------------------------------------------------------------"
60 .if target(pre-world)
61         @echo
62         @echo "--------------------------------------------------------------"
63         @echo " Making 'pre-world' target"
64         @echo "--------------------------------------------------------------"
65         @cd ${.CURDIR}; ${MK_ENV} ${MAKE} pre-world
66 .endif
67         @cd ${.CURDIR}; ${MK_ENV} ${MAKE} buildworld
68 .if     ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
69         @cd ${.CURDIR}; ${LEGACY_ENV} ${MAKE} legacy-build
70 .endif
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
74 .endif
75 .if target(post-world)
76         @echo
77         @echo "--------------------------------------------------------------"
78         @echo " Making 'post-world' target"
79         @echo "--------------------------------------------------------------"
80         @cd ${.CURDIR}; ${MK_ENV} ${MAKE} post-world
81 .endif
82         @echo
83         @echo "--------------------------------------------------------------"
84         @echo " ${OBJFORMAT} make world completed on `LC_TIME=C date`"
85         @echo "--------------------------------------------------------------"
86
87 #
88 # buildworld
89 #
90 # Build the world in the current object format, plus the legacy aout
91 # support if the current object format is elf on i386.
92 #
93 buildworld      :
94         @cd ${.CURDIR}; ${MK_ENV} ${MAKE} buildworld
95 .if     ${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
96         @cd ${.CURDIR}; ${LEGACY_ENV} ${MAKE} legacy-build
97 .endif
98
99 #
100 # installworld
101 #
102 # Install the world in the current object format, plus the legacy aout
103 # support if the current object format is elf on i386.
104 #
105 installworld    :
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
109 .endif