pkg - Adjust pkg-bootstrap-force
[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#
6# buildworld - Rebuild *everything*, including glue to help do
7# upgrades.
1397f94a
MD
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
MD
11# installworld - Install everything built by "buildworld".
12# world - buildworld + installworld.
fc7aca3e
MD
13# buildkernel - Rebuild the kernel and the kernel-modules from scratch
14# using build/bootstrap/cross tools from the last
15# buildworld.
16# nativekernel - Rebuild the kernel and the kernel-modules from scratch
17# using native tools.
18# quickkernel - rebuild the kernel quickly (build or native), skip
19# the make depend step and do not clean out the obj
20# modules.
984263bc
MD
21# installkernel - Install the kernel and the kernel-modules.
22# reinstallkernel - Reinstall the kernel and the kernel-modules.
23# kernel - buildkernel + installkernel.
f35282e3
MD
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.
8db5e54f
DR
28# upgrade - Upgrade the files in /etc and also setup the rest
29# of the system for DragonFly. ex. two compilers
984263bc
MD
30# most - Build user commands, no libraries or include files.
31# installmost - Install user commands, no libraries or include files.
917662e5 32# rescue - Create rescue image in /boot
2decc9b9
JM
33# backupworld - Copies /bin /sbin /usr/bin /usr/sbin /usr/lib
34# /usr/libexec to manual backup dir.
35# restoreworld - Installs binaries from manual backup dir to world.
36# restoreworld-auto - Installs binaries from auto-backup dir to world;
37# installworld target makes backup to auto-backup dir.
38# backup-auto-clean - Delete backup from auto-backup dir.
39# backup-clean - Delete backup from manual backup dir.
984263bc 40#
114580ac
SW
41# This makefile is simple by design. The DragonFly make automatically reads
42# /usr/share/mk/sys.mk unless the -m argument is specified on the
984263bc
MD
43# command line. By keeping this makefile simple, it doesn't matter too
44# much how different the installed mk files are from those in the source
45# tree. This makefile executes a child make process, forcing it to use
46# the mk files from the source tree which are supposed to DTRT.
47#
48# The user-driven targets (as listed above) are implemented in Makefile.inc1.
49#
50# If you want to build your system from source be sure that /usr/obj has
30d6fede 51# at least 800MB of diskspace available.
984263bc
MD
52#
53# For individuals wanting to build from the sources currently on their
54# system, the simple instructions are:
55#
56# 1. `cd /usr/src' (or to the directory containing your source tree).
57# 2. `make world'
58#
59# For individuals wanting to upgrade their sources (even if only a
60# delta of a few days):
61#
62# 1. `cd /usr/src' (or to the directory containing your source tree).
63# 2. `make buildworld'
64# 3. `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
65# 4. `make installkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
30d6fede
SW
66# 5. `make installworld'
67# 6. `make upgrade'
68# 7. `reboot'
984263bc
MD
69#
70# See src/UPDATING `COMMON ITEMS' for more complete information.
71#
b2b3ffcd 72# If TARGET_ARCH=arch (e.g. x86_64) is specified you can
984263bc
MD
73# cross build world for other architectures using the buildworld target,
74# and once the world is built you can cross build a kernel using the
75# buildkernel target.
76#
984263bc
MD
77# Define the user-driven targets. These are listed here in alphabetical
78# order, but that's not important.
79#
fc7aca3e
MD
80TGTS= all all-man buildkernel quickkernel nativekernel \
81 buildworld crossworld quickworld realquickworld checkdpadd clean \
5cccfb7b 82 cleandepend cleandir depend everything \
984263bc
MD
83 hierarchy install installcheck installkernel \
84 reinstallkernel installmost installworld libraries lint maninstall \
28d76656 85 manlint mk most obj objlink regress rerelease tags \
917662e5 86 rescue backupworld restoreworld restoreworld-auto \
2decc9b9 87 backup-clean backup-auto-clean \
fd4528de 88 _obj _includes _libraries _depend _worldtmp \
9f8ba22c 89 _bootstrap-tools _build-tools _cross-tools
18cdb849 90TGTS+= mandiff # XXX temporary target
984263bc
MD
91
92BITGTS= files includes
93BITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/}
94
95.ORDER: buildworld installworld
828e58f9
SS
96.ORDER: buildworld buildkernel
97.ORDER: buildworld nativekernel
98.ORDER: buildworld quickkernel
99.ORDER: buildkernel installkernel
100.ORDER: buildkernel reinstallkernel
101.ORDER: quickworld installworld
828e58f9
SS
102.ORDER: quickworld buildkernel
103.ORDER: quickworld nativekernel
104.ORDER: quickworld quickkernel
105.ORDER: quickkernel installkernel
106.ORDER: quickkernel reinstallkernel
984263bc 107
ee48961f 108PATH= /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/pkg/bin
984263bc
MD
109MAKE= PATH=${PATH} make -m ${.CURDIR}/share/mk -f Makefile.inc1
110
111#
112# Handle the user-driven targets, using the source relative mk files.
113#
8db5e54f 114${TGTS} ${BITGTS}:
984263bc
MD
115 @cd ${.CURDIR}; \
116 ${MAKE} ${.TARGET}
117
118# Set a reasonable default
119.MAIN: all
120
121STARTTIME!= LC_ALL=C date
122#
123# world
124#
125# Attempt to rebuild and reinstall *everything*, with reasonable chance of
126# success, regardless of how old your existing system is.
127#
8db5e54f 128world:
984263bc 129 @echo "--------------------------------------------------------------"
aa8d5dcb 130 @echo ">>> elf make world started on ${STARTTIME}"
984263bc
MD
131 @echo "--------------------------------------------------------------"
132.if target(pre-world)
133 @echo
134 @echo "--------------------------------------------------------------"
135 @echo ">>> Making 'pre-world' target"
136 @echo "--------------------------------------------------------------"
137 @cd ${.CURDIR}; ${MAKE} pre-world
138.endif
139 @cd ${.CURDIR}; ${MAKE} buildworld
140 @cd ${.CURDIR}; ${MAKE} -B installworld
141.if target(post-world)
142 @echo
143 @echo "--------------------------------------------------------------"
144 @echo ">>> Making 'post-world' target"
145 @echo "--------------------------------------------------------------"
146 @cd ${.CURDIR}; ${MAKE} post-world
147.endif
148 @echo
149 @echo "--------------------------------------------------------------"
aa8d5dcb 150 @printf ">>> elf make world completed on `LC_ALL=C date`\n (started ${STARTTIME})\n"
984263bc
MD
151 @echo "--------------------------------------------------------------"
152
153#
154# kernel
155#
156# Short hand for `make buildkernel installkernel'
157#
158kernel: buildkernel installkernel
159
984263bc
MD
160#
161# A simple test target used as part of the test to see if make supports
162# the -m argument. Also test that make will only evaluate a conditional
163# as far as is necessary to determine its value.
164#
165test:
166.if defined(notdef)
167.undef notdef
3da8e88f
JM
168.if defined(notdef) && ${notdef:tu}
169.endif
3da8e88f 170.endif
984263bc
MD
171
172#
173# Upgrade the installed make to the current version using the installed
174# headers, libraries and build tools. This is required on installed versions
175# prior to 2.2.5 in which the installed make doesn't support the -m argument.
176#
177make:
178 @echo
179 @echo "--------------------------------------------------------------"
180 @echo " Upgrading the installed make"
181 @echo "--------------------------------------------------------------"
182 @cd ${.CURDIR}/usr.bin/make; \
183 make obj && make depend && make all && make install
184
185#
30d8ccf3
SW
186# Handle the upgrade of /etc, post-installworld updating of static files
187# and removing obsolete files.
984263bc
MD
188#
189
f35282e3 190preupgrade:
ab64cf06 191 @cd ${.CURDIR}/etc; make -m ${.CURDIR}/share/mk preupgrade
f35282e3 192
30d8ccf3 193upgrade:
ab64cf06 194 @cd ${.CURDIR}/etc; make -m ${.CURDIR}/share/mk upgrade_etc
30d8ccf3
SW
195.if !defined(NOMAN) && !defined(NO_MAKEDB_RUN)
196 cd ${.CURDIR}/share/man; make makedb
197.endif