rc.d/wpa_supplicant: Prefer the DPorts version for the moment
[dragonfly.git] / Makefile
CommitLineData
984263bc
MD
1#
2# $FreeBSD: src/Makefile,v 1.234.2.19 2003/04/16 09:59:40 ru Exp $
3#
4# The user-driven targets are:
5#
e79a303f
AL
6# buildworld - Rebuild *everything* but the kernel, including glue to
7# help do upgrades.
f71956f7
AL
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.
984263bc 11# installworld - Install everything built by "buildworld".
9b724c0d 12# (includes rescue and initrd image)
f71956f7
AL
13# installworld-force - Install everything built by "buildworld";
14# special case for old systems.
9b724c0d
MD
15# installrescue - Install /rescue built by buildworld
16# installinitrd - Install initrd image built by buildworld
984263bc 17# world - buildworld + installworld.
fc7aca3e 18# buildkernel - Rebuild the kernel and the kernel-modules from scratch
f71956f7
AL
19# using build/bootstrap/cross tools from the last
20# buildworld.
21# nativekernel - Rebuild the kernel and the kernel-modules from scratch
22# using native tools.
23# quickkernel - Rebuild the kernel quickly (build or native), and do
24# not clean out the obj modules.
92c9dfec 25# realquickkernel - Like quickkernel, but skips depend too.
984263bc
MD
26# installkernel - Install the kernel and the kernel-modules.
27# reinstallkernel - Reinstall the kernel and the kernel-modules.
28# kernel - buildkernel + installkernel.
e79a303f
AL
29# preupgrade - Do certain upgrades (typically the addition of new
30# users and groups used by installed utilities) before
f71956f7 31# the installworld.
8db5e54f 32# upgrade - Upgrade the files in /etc and also setup the rest
f71956f7 33# of the system for DragonFly. ex. two compilers.
e79a303f
AL
34# rescue - Build and install the statically linked rescue tools.
35# initrd - Build the rescue tools and create the initrd image.
f71956f7 36# backupworld - Copy /bin /sbin /usr/bin /usr/sbin /usr/lib
2decc9b9 37# /usr/libexec to manual backup dir.
f71956f7
AL
38# restoreworld - Install binaries from manual backup dir to world.
39# restoreworld-auto - Install binaries from auto-backup dir to world;
2decc9b9
JM
40# installworld target makes backup to auto-backup dir.
41# backup-auto-clean - Delete backup from auto-backup dir.
42# backup-clean - Delete backup from manual backup dir.
984263bc 43#
114580ac 44# This makefile is simple by design. The DragonFly make automatically reads
f71956f7 45# /usr/share/mk/sys.mk unless the -m argument is specified on the
984263bc
MD
46# command line. By keeping this makefile simple, it doesn't matter too
47# much how different the installed mk files are from those in the source
48# tree. This makefile executes a child make process, forcing it to use
49# the mk files from the source tree which are supposed to DTRT.
50#
f71956f7 51# Most of the user-driven targets (as listed above) are implemented in
e79a303f 52# Makefile.inc1.
984263bc
MD
53#
54# For individuals wanting to build from the sources currently on their
55# system, the simple instructions are:
56#
57# 1. `cd /usr/src' (or to the directory containing your source tree).
58# 2. `make world'
59#
60# For individuals wanting to upgrade their sources (even if only a
61# delta of a few days):
62#
63# 1. `cd /usr/src' (or to the directory containing your source tree).
64# 2. `make buildworld'
9b724c0d
MD
65# 3. `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default X86_64_GENERIC).
66# 4. `make installkernel KERNCONF=YOUR_KERNEL_HERE' (default X86_64_GENERIC).
30d6fede
SW
67# 5. `make installworld'
68# 6. `make upgrade'
69# 7. `reboot'
9b724c0d
MD
70# 8. `make installrescue' (after making sure that the new world works well).
71# 9. `make installinitrd' (after making sure that the new world works well).
984263bc 72#
b2b3ffcd 73# If TARGET_ARCH=arch (e.g. x86_64) is specified you can
984263bc
MD
74# cross build world for other architectures using the buildworld target,
75# and once the world is built you can cross build a kernel using the
76# buildkernel target.
77#
f71956f7 78# For more information, see the build(7) manual page.
984263bc 79#
f71956f7 80
92c9dfec 81TGTS= all all-man buildkernel quickkernel realquickkernel nativekernel \
fc7aca3e 82 buildworld crossworld quickworld realquickworld checkdpadd clean \
5cccfb7b 83 cleandepend cleandir depend everything \
984263bc 84 hierarchy install installcheck installkernel \
e972a8ba 85 reinstallkernel installworld installworld-force \
9b724c0d
MD
86 rescue initrd \
87 quickrescue quickinitrd installrescue installinitrd \
f71956f7 88 libraries lint maninstall \
e972a8ba 89 manlint mk obj objlink regress rerelease tags \
e79a303f 90 backupworld restoreworld restoreworld-auto \
2decc9b9 91 backup-clean backup-auto-clean \
fd4528de 92 _obj _includes _libraries _depend _worldtmp \
9f8ba22c 93 _bootstrap-tools _build-tools _cross-tools
18cdb849 94TGTS+= mandiff # XXX temporary target
984263bc
MD
95
96BITGTS= files includes
97BITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/}
98
99.ORDER: buildworld installworld
828e58f9
SS
100.ORDER: buildworld buildkernel
101.ORDER: buildworld nativekernel
102.ORDER: buildworld quickkernel
92c9dfec 103.ORDER: buildworld realquickkernel
828e58f9
SS
104.ORDER: buildkernel installkernel
105.ORDER: buildkernel reinstallkernel
106.ORDER: quickworld installworld
828e58f9
SS
107.ORDER: quickworld buildkernel
108.ORDER: quickworld nativekernel
109.ORDER: quickworld quickkernel
92c9dfec 110.ORDER: quickworld realquickkernel
828e58f9
SS
111.ORDER: quickkernel installkernel
112.ORDER: quickkernel reinstallkernel
92c9dfec
SW
113.ORDER: realquickkernel installkernel
114.ORDER: realquickkernel reinstallkernel
984263bc 115
ee48961f 116PATH= /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/pkg/bin
984263bc
MD
117MAKE= PATH=${PATH} make -m ${.CURDIR}/share/mk -f Makefile.inc1
118
119#
120# Handle the user-driven targets, using the source relative mk files.
121#
8db5e54f 122${TGTS} ${BITGTS}:
984263bc
MD
123 @cd ${.CURDIR}; \
124 ${MAKE} ${.TARGET}
125
126# Set a reasonable default
127.MAIN: all
128
129STARTTIME!= LC_ALL=C date
130#
131# world
132#
133# Attempt to rebuild and reinstall *everything*, with reasonable chance of
134# success, regardless of how old your existing system is.
135#
8db5e54f 136world:
984263bc 137 @echo "--------------------------------------------------------------"
24c1eacf 138 @echo ">>> make world started on ${STARTTIME}"
984263bc
MD
139 @echo "--------------------------------------------------------------"
140.if target(pre-world)
141 @echo
142 @echo "--------------------------------------------------------------"
24c1eacf 143 @echo ">>> starting pre-world target"
984263bc
MD
144 @echo "--------------------------------------------------------------"
145 @cd ${.CURDIR}; ${MAKE} pre-world
24c1eacf
JM
146 @echo "--------------------------------------------------------------"
147 @echo ">>> pre-world target complete"
148 @echo "--------------------------------------------------------------"
984263bc
MD
149.endif
150 @cd ${.CURDIR}; ${MAKE} buildworld
151 @cd ${.CURDIR}; ${MAKE} -B installworld
152.if target(post-world)
153 @echo
154 @echo "--------------------------------------------------------------"
24c1eacf 155 @echo ">>> starting post-world target"
984263bc
MD
156 @echo "--------------------------------------------------------------"
157 @cd ${.CURDIR}; ${MAKE} post-world
24c1eacf
JM
158 @echo "--------------------------------------------------------------"
159 @echo ">>> post-world target complete"
160 @echo "--------------------------------------------------------------"
984263bc
MD
161.endif
162 @echo
163 @echo "--------------------------------------------------------------"
24c1eacf 164 @printf ">>> make world completed on `LC_ALL=C date`\n (started ${STARTTIME})\n"
984263bc
MD
165 @echo "--------------------------------------------------------------"
166
167#
168# kernel
169#
170# Short hand for `make buildkernel installkernel'
171#
172kernel: buildkernel installkernel
173
984263bc
MD
174#
175# A simple test target used as part of the test to see if make supports
176# the -m argument. Also test that make will only evaluate a conditional
177# as far as is necessary to determine its value.
178#
179test:
180.if defined(notdef)
181.undef notdef
3da8e88f
JM
182.if defined(notdef) && ${notdef:tu}
183.endif
3da8e88f 184.endif
984263bc
MD
185
186#
187# Upgrade the installed make to the current version using the installed
188# headers, libraries and build tools. This is required on installed versions
189# prior to 2.2.5 in which the installed make doesn't support the -m argument.
190#
191make:
192 @echo
193 @echo "--------------------------------------------------------------"
194 @echo " Upgrading the installed make"
195 @echo "--------------------------------------------------------------"
196 @cd ${.CURDIR}/usr.bin/make; \
197 make obj && make depend && make all && make install
198
199#
30d8ccf3
SW
200# Handle the upgrade of /etc, post-installworld updating of static files
201# and removing obsolete files.
984263bc
MD
202#
203
f35282e3 204preupgrade:
ab64cf06 205 @cd ${.CURDIR}/etc; make -m ${.CURDIR}/share/mk preupgrade
f35282e3 206
30d8ccf3 207upgrade:
ab64cf06 208 @cd ${.CURDIR}/etc; make -m ${.CURDIR}/share/mk upgrade_etc
30d8ccf3 209.if !defined(NOMAN) && !defined(NO_MAKEDB_RUN)
e79a303f 210 @cd ${.CURDIR}/share/man; make makedb
30d8ccf3 211.endif
e79a303f
AL
212 @echo "--------------------------------------------------------------"
213 @echo "Now you can reboot into the new system! If the new system works as"
214 @echo "expected, consider updating the rescue tools and initrd image with:"
215 @echo " # cd ${.CURDIR}; make initrd"
216 @echo "NOTE: Do this only after verifying the new system works as expected!"
217 @echo ""
218 @echo "You also need to upgrade the 3rd-party packages with:"
219 @echo " # pkg update; pkg [-f] upgrade"
220 @echo "--------------------------------------------------------------"