2 # $FreeBSD: src/Makefile,v 1.234.2.19 2003/04/16 09:59:40 ru Exp $
4 # The user-driven targets are:
6 # buildworld - Rebuild *everything*, including glue to help do
8 # quickworld - Skip bootstrap, build and cross-build tool steps
9 # realquickworld - Skip above steps, plus depend
10 # crossworld - Just do the bootstrap, build, and cross-build steps
11 # installworld - Install everything built by "buildworld".
12 # world - buildworld + installworld.
13 # buildkernel - Rebuild the kernel and the kernel-modules from scratch
14 # using build/bootstrap/cross tools from the last
16 # nativekernel - Rebuild the kernel and the kernel-modules from scratch
18 # quickkernel - rebuild the kernel quickly (build or native), skip
19 # the make depend step and do not clean out the obj
21 # installkernel - Install the kernel and the kernel-modules.
22 # reinstallkernel - Reinstall the kernel and the kernel-modules.
23 # kernel - buildkernel + installkernel.
24 # preupgrade - Certain upgrades may have to be done before installworld.
25 # installworld will complain if they have not been done. This
26 # target will do those upgrades... typically the addition of
27 # new special groups and users used by installed utilities.
28 # upgrade - Upgrade the files in /etc and also setup the rest
29 # of the system for DragonFly. ex. two compilers
30 # most - Build user commands, no libraries or include files.
31 # installmost - Install user commands, no libraries or include files.
32 # backupworld - Copies /bin /sbin /usr/bin /usr/sbin /usr/lib
33 # /usr/libexec to manual backup dir.
34 # restoreworld - Installs binaries from manual backup dir to world.
35 # restoreworld-auto - Installs binaries from auto-backup dir to world;
36 # installworld target makes backup to auto-backup dir.
37 # backup-auto-clean - Delete backup from auto-backup dir.
38 # backup-clean - Delete backup from manual backup dir.
40 # This makefile is simple by design. The DragonFly make automatically reads
41 # /usr/share/mk/sys.mk unless the -m argument is specified on the
42 # command line. By keeping this makefile simple, it doesn't matter too
43 # much how different the installed mk files are from those in the source
44 # tree. This makefile executes a child make process, forcing it to use
45 # the mk files from the source tree which are supposed to DTRT.
47 # The user-driven targets (as listed above) are implemented in Makefile.inc1.
49 # If you want to build your system from source be sure that /usr/obj has
50 # at least 800MB of diskspace available.
52 # For individuals wanting to build from the sources currently on their
53 # system, the simple instructions are:
55 # 1. `cd /usr/src' (or to the directory containing your source tree).
58 # For individuals wanting to upgrade their sources (even if only a
59 # delta of a few days):
61 # 1. `cd /usr/src' (or to the directory containing your source tree).
62 # 2. `make buildworld'
63 # 3. `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
64 # 4. `make installkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
65 # 5. `make installworld'
69 # See src/UPDATING `COMMON ITEMS' for more complete information.
71 # If TARGET_ARCH=arch (e.g. x86_64) is specified you can
72 # cross build world for other architectures using the buildworld target,
73 # and once the world is built you can cross build a kernel using the
76 # Define the user-driven targets. These are listed here in alphabetical
77 # order, but that's not important.
79 TGTS
= all all-man buildkernel quickkernel nativekernel \
80 buildworld crossworld quickworld realquickworld checkdpadd
clean \
81 cleandepend cleandir depend everything \
82 hierarchy
install installcheck installkernel \
83 reinstallkernel installmost installworld libraries lint maninstall \
84 manlint mk most obj objlink regress rerelease
tags \
85 backupworld restoreworld restoreworld-auto \
86 backup-clean backup-auto-clean \
87 _obj _includes _libraries _depend _worldtmp \
88 _bootstrap-tools _build-tools _cross-tools
89 TGTS
+= mandiff
# XXX temporary target
91 BITGTS
= files includes
92 BITGTS
:=${BITGTS} ${BITGTS
:S
/^
/build
/} ${BITGTS
:S
/^
/install/}
94 .ORDER
: buildworld installworld
95 .ORDER
: buildworld buildkernel
96 .ORDER
: buildworld nativekernel
97 .ORDER
: buildworld quickkernel
98 .ORDER
: buildkernel installkernel
99 .ORDER
: buildkernel reinstallkernel
100 .ORDER
: quickworld installworld
101 .ORDER
: quickworld buildkernel
102 .ORDER
: quickworld nativekernel
103 .ORDER
: quickworld quickkernel
104 .ORDER
: quickkernel installkernel
105 .ORDER
: quickkernel reinstallkernel
107 PATH
= /sbin
:/bin
:/usr
/sbin
:/usr
/bin
:/usr
/local
/bin
:/usr
/pkg
/bin
108 MAKE
= PATH
=${PATH} make
-m
${.CURDIR
}/share
/mk
-f Makefile.inc1
111 # Handle the user-driven targets, using the source relative mk files.
117 # Set a reasonable default
120 STARTTIME
!= LC_ALL
=C date
124 # Attempt to rebuild and reinstall *everything*, with reasonable chance of
125 # success, regardless of how old your existing system is.
128 @echo
"--------------------------------------------------------------"
129 @echo
">>> elf make world started on ${STARTTIME}"
130 @echo
"--------------------------------------------------------------"
131 .if target
(pre-world
)
133 @echo
"--------------------------------------------------------------"
134 @echo
">>> Making 'pre-world' target"
135 @echo
"--------------------------------------------------------------"
136 @cd
${.CURDIR
}; ${MAKE} pre-world
138 @cd
${.CURDIR
}; ${MAKE} buildworld
139 @cd
${.CURDIR
}; ${MAKE} -B installworld
140 .if target
(post-world
)
142 @echo
"--------------------------------------------------------------"
143 @echo
">>> Making 'post-world' target"
144 @echo
"--------------------------------------------------------------"
145 @cd
${.CURDIR
}; ${MAKE} post-world
148 @echo
"--------------------------------------------------------------"
149 @printf
">>> elf make world completed on `LC_ALL=C date`\n (started ${STARTTIME})\n"
150 @echo
"--------------------------------------------------------------"
155 # Short hand for `make buildkernel installkernel'
157 kernel
: buildkernel installkernel
160 # A simple test target used as part of the test to see if make supports
161 # the -m argument. Also test that make will only evaluate a conditional
162 # as far as is necessary to determine its value.
167 .if defined
(notdef
) && ${notdef
:tu
}
172 # Upgrade the installed make to the current version using the installed
173 # headers, libraries and build tools. This is required on installed versions
174 # prior to 2.2.5 in which the installed make doesn't support the -m argument.
178 @echo
"--------------------------------------------------------------"
179 @echo
" Upgrading the installed make"
180 @echo
"--------------------------------------------------------------"
181 @cd
${.CURDIR
}/usr.bin
/make
; \
182 make obj
&& make depend
&& make
all && make
install
185 # Handle the upgrade of /etc, post-installworld updating of static files
186 # and removing obsolete files.
190 @cd
${.CURDIR
}/etc
; make
-m
${.CURDIR
}/share
/mk preupgrade
193 @cd
${.CURDIR
}/etc
; make
-m
${.CURDIR
}/share
/mk upgrade_etc
194 .if
!defined
(NOMAN
) && !defined
(NO_MAKEDB_RUN
)
195 cd
${.CURDIR
}/share
/man
; make makedb