summaryrefslogtreecommitdiffstats
path: root/Makefile.inc0
blob: a5841252cad29b83f4c798b0c4da6ad631b22e67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#
#	$Id: Makefile.inc0,v 1.10 1998/09/29 22:03:13 jkh Exp $
#
# This makefile ensures that the object directory is set according to the
# object format to avoid mixing aout and elf formatted files during the
# transition period.
#
# >> Beware, this makefile  overwrites the local build environment! <<
#

#
# Build things relative to the user's preferred object directory,
# defaulting to /usr/obj if not defined.
#
MAKEOBJDIRPREFIX?=/usr/obj

#
# Variables passed to make work better if they are set as environment
# variables instead of command line options.
#
MK_ENV=	MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${OBJFORMAT}

#
# We should always use the current set of mk files, not the installed ones.
# This makefile is a wrapper for the backend makefile (Makefile.inc1).
#
MAKE=	make -m ${.CURDIR}/share/mk -f Makefile.inc1

#
# These are the backend targets.
#
BKTGTS=	afterdistribute all checkdpadd clean cleandepend cleandir \
	depend distribute everything hierarchy includes install installmost \
	lint maninstall mk most obj objlink regress rerelease \
	tags update

#
# A generic rule for the backend targets.
#
${BKTGTS} :
	@cd ${.CURDIR}; ${MK_ENV} ${MAKE} ${.TARGET}

#
# Temporary path and environment for the legacy build.
#
ELFTMP=		${MAKEOBJDIRPREFIX}/elf${.CURDIR}/tmp
ELFTMPPATH=	${ELFTMP}/sbin:${ELFTMP}/bin:${ELFTMP}/usr/sbin:${ELFTMP}/usr/bin:${ELFTMP}/usr/games
LEGACY_ENV=	PATH=${ELFTMPPATH} OBJFORMAT=aout NOTOOLS=1 TOOLROOT=${ELFTMP} \
		MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/aout
XMAKE=		${ELFTMP}/usr/bin/${MAKE}

#
# world
#
# Attempt to rebuild and reinstall *everything*, with reasonable chance of
# success, regardless of how old your existing system is. If building on
# an i386/elf system, build the aout legacy cruft too.
#
world:
	@echo "--------------------------------------------------------------"
	@echo ">>> ${OBJFORMAT} make world started on `LC_TIME=C date`"
	@echo "--------------------------------------------------------------"
.if target(pre-world)
	@echo
	@echo "--------------------------------------------------------------"
	@echo ">>> Making 'pre-world' target"
	@echo "--------------------------------------------------------------"
	@cd ${.CURDIR}; ${MK_ENV} ${MAKE} pre-world
.endif
	@cd ${.CURDIR}; ${MK_ENV} ${MAKE} buildworld
.if	${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
	@cd ${.CURDIR}; ${LEGACY_ENV} ${XMAKE} legacy-build
.endif
	@cd ${.CURDIR}; ${MK_ENV} ${MAKE} -B installworld
.if	${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
	@cd ${.CURDIR}; ${LEGACY_ENV} ${XMAKE} legacy-install
.endif
.if target(post-world)
	@echo
	@echo "--------------------------------------------------------------"
	@echo ">>> Making 'post-world' target"
	@echo "--------------------------------------------------------------"
	@cd ${.CURDIR}; ${MK_ENV} ${MAKE} post-world
.endif
	@echo
	@echo "--------------------------------------------------------------"
	@echo ">>> ${OBJFORMAT} make world completed on `LC_TIME=C date`"
	@echo "--------------------------------------------------------------"

#
# buildworld
#
# Build the world in the current object format, plus the legacy aout
# support if the current object format is elf on i386.
#
buildworld	:
	@cd ${.CURDIR}; ${MK_ENV} ${MAKE} buildworld
.if	${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
	@cd ${.CURDIR}; ${LEGACY_ENV} ${XMAKE} legacy-build
.endif

#
# installworld
#
# Install the world in the current object format, plus the legacy aout
# support if the current object format is elf on i386.
#
installworld	:
	@cd ${.CURDIR}; ${MK_ENV} ${MAKE} installworld
.if	${MACHINE_ARCH} == "i386" && ${OBJFORMAT} == "elf" && !defined(NOAOUT)
	@cd ${.CURDIR}; ${LEGACY_ENV} ${XMAKE} -DNOMAN -DNOINFO legacy-install
.endif
OpenPOWER on IntegriCloud