Bump sub-versions and DragonFly_version in preparation for branching.
[dragonfly.git] / Makefile
CommitLineData
984263bc
MD
1#
2# $FreeBSD: src/Makefile,v 1.234.2.19 2003/04/16 09:59:40 ru Exp $
aaa73ee0 3# $DragonFly: src/Makefile,v 1.17 2006/01/01 00:12:35 dillon Exp $
984263bc
MD
4#
5# The user-driven targets are:
6#
7# buildworld - Rebuild *everything*, including glue to help do
8# upgrades.
1397f94a
MD
9# quickworld - Skip bootstrap, build and cross-build tool steps
10# realquickworld - Skip above steps, plus depend
11# crossworld - Just do the bootstrap, build, and cross-build steps
984263bc
MD
12# installworld - Install everything built by "buildworld".
13# world - buildworld + installworld.
fc7aca3e
MD
14# buildkernel - Rebuild the kernel and the kernel-modules from scratch
15# using build/bootstrap/cross tools from the last
16# buildworld.
17# nativekernel - Rebuild the kernel and the kernel-modules from scratch
18# using native tools.
19# quickkernel - rebuild the kernel quickly (build or native), skip
20# the make depend step and do not clean out the obj
21# modules.
984263bc
MD
22# installkernel - Install the kernel and the kernel-modules.
23# reinstallkernel - Reinstall the kernel and the kernel-modules.
24# kernel - buildkernel + installkernel.
25# update - Convenient way to update your source tree (cvs).
f35282e3
MD
26# preupgrade - Certain upgrades may have to be done before installworld.
27# installworld will complain if they have not been done. This
28# target will do those upgrades... typically the addition of
29# new special groups and users used by installed utilities.
8db5e54f
DR
30# upgrade - Upgrade the files in /etc and also setup the rest
31# of the system for DragonFly. ex. two compilers
984263bc
MD
32# most - Build user commands, no libraries or include files.
33# installmost - Install user commands, no libraries or include files.
984263bc
MD
34#
35# This makefile is simple by design. The FreeBSD make automatically reads
36# the /usr/share/mk/sys.mk unless the -m argument is specified on the
37# command line. By keeping this makefile simple, it doesn't matter too
38# much how different the installed mk files are from those in the source
39# tree. This makefile executes a child make process, forcing it to use
40# the mk files from the source tree which are supposed to DTRT.
41#
42# The user-driven targets (as listed above) are implemented in Makefile.inc1.
43#
44# If you want to build your system from source be sure that /usr/obj has
45# at least 400MB of diskspace available.
46#
47# For individuals wanting to build from the sources currently on their
48# system, the simple instructions are:
49#
50# 1. `cd /usr/src' (or to the directory containing your source tree).
51# 2. `make world'
52#
53# For individuals wanting to upgrade their sources (even if only a
54# delta of a few days):
55#
56# 1. `cd /usr/src' (or to the directory containing your source tree).
57# 2. `make buildworld'
58# 3. `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
59# 4. `make installkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
60# 5. `reboot' (in single user mode: boot -s from the loader prompt).
61# 6. `mergemaster -p'
62# 7. `make installworld'
63# 8. `mergemaster'
64# 9. `reboot'
65#
66# See src/UPDATING `COMMON ITEMS' for more complete information.
67#
8db5e54f 68# If TARGET_ARCH=arch (e.g. amd64) is specified you can
984263bc
MD
69# cross build world for other architectures using the buildworld target,
70# and once the world is built you can cross build a kernel using the
71# buildkernel target.
72#
984263bc
MD
73# Define the user-driven targets. These are listed here in alphabetical
74# order, but that's not important.
75#
fc7aca3e
MD
76TGTS= all all-man buildkernel quickkernel nativekernel \
77 buildworld crossworld quickworld realquickworld checkdpadd clean \
984263bc
MD
78 cleandepend cleandir depend distribute distributeworld everything \
79 hierarchy install installcheck installkernel \
80 reinstallkernel installmost installworld libraries lint maninstall \
4d351aa0 81 manlint mk most obj objlink regress rerelease tags update \
fd4528de
MD
82 _obj _includes _libraries _depend _worldtmp \
83 _bootstrap-tools _obj _build-tools _cross-tools
984263bc
MD
84
85BITGTS= files includes
86BITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/}
87
88.ORDER: buildworld installworld
89.ORDER: buildworld distributeworld
fc7aca3e
MD
90.ORDER: buildworld buildkernel nativekernel quickkernel
91.ORDER: buildkernel nativekernel quickkernel installkernel
92.ORDER: buildkernel nativekernel quickkernel reinstallkernel
984263bc
MD
93
94PATH= /sbin:/bin:/usr/sbin:/usr/bin
95MAKE= PATH=${PATH} make -m ${.CURDIR}/share/mk -f Makefile.inc1
96
97#
98# Handle the user-driven targets, using the source relative mk files.
99#
8db5e54f 100${TGTS} ${BITGTS}:
984263bc
MD
101 @cd ${.CURDIR}; \
102 ${MAKE} ${.TARGET}
103
104# Set a reasonable default
105.MAIN: all
106
107STARTTIME!= LC_ALL=C date
108#
109# world
110#
111# Attempt to rebuild and reinstall *everything*, with reasonable chance of
112# success, regardless of how old your existing system is.
113#
8db5e54f 114world:
984263bc 115 @echo "--------------------------------------------------------------"
aa8d5dcb 116 @echo ">>> elf make world started on ${STARTTIME}"
984263bc
MD
117 @echo "--------------------------------------------------------------"
118.if target(pre-world)
119 @echo
120 @echo "--------------------------------------------------------------"
121 @echo ">>> Making 'pre-world' target"
122 @echo "--------------------------------------------------------------"
123 @cd ${.CURDIR}; ${MAKE} pre-world
124.endif
125 @cd ${.CURDIR}; ${MAKE} buildworld
126 @cd ${.CURDIR}; ${MAKE} -B installworld
127.if target(post-world)
128 @echo
129 @echo "--------------------------------------------------------------"
130 @echo ">>> Making 'post-world' target"
131 @echo "--------------------------------------------------------------"
132 @cd ${.CURDIR}; ${MAKE} post-world
133.endif
134 @echo
135 @echo "--------------------------------------------------------------"
aa8d5dcb 136 @printf ">>> elf make world completed on `LC_ALL=C date`\n (started ${STARTTIME})\n"
984263bc
MD
137 @echo "--------------------------------------------------------------"
138
139#
140# kernel
141#
142# Short hand for `make buildkernel installkernel'
143#
144kernel: buildkernel installkernel
145
984263bc
MD
146#
147# A simple test target used as part of the test to see if make supports
148# the -m argument. Also test that make will only evaluate a conditional
149# as far as is necessary to determine its value.
150#
151test:
152.if defined(notdef)
153.undef notdef
154.if defined(notdef) && ${notdef:U}
155.endif
156.endif
157
158#
159# Upgrade the installed make to the current version using the installed
160# headers, libraries and build tools. This is required on installed versions
161# prior to 2.2.5 in which the installed make doesn't support the -m argument.
162#
163make:
164 @echo
165 @echo "--------------------------------------------------------------"
166 @echo " Upgrading the installed make"
167 @echo "--------------------------------------------------------------"
168 @cd ${.CURDIR}/usr.bin/make; \
169 make obj && make depend && make all && make install
170
171#
8db5e54f 172# Handle the upgrade of /etc
984263bc
MD
173#
174
f35282e3 175preupgrade:
ab64cf06 176 @cd ${.CURDIR}/etc; make -m ${.CURDIR}/share/mk preupgrade
f35282e3 177
e50c8f0c
MD
178upgrade: upgrade_etc
179
180#
181# Handle post-installworld updating of static files (e.g. like /etc/rc)
182#
183upgrade_etc:
ab64cf06 184 @cd ${.CURDIR}/etc; make -m ${.CURDIR}/share/mk upgrade_etc
fa123c6f 185
68dbf81b
MD
186#
187# Convenient targets for use by the CVS repository meister.
188#
189update_preview_tag: iamoncrater
34c3f536 190 cvs -d /cvs rtag -a -F DragonFly_Preview src
68dbf81b
MD
191
192update_release1_2_slip_tag: iamoncrater
34c3f536 193 cvs -d /cvs rtag -a -F -rDragonFly_RELEASE_1_2 DragonFly_RELEASE_1_2_Slip src
68dbf81b 194
aaa73ee0
MD
195update_release1_4_slip_tag: iamoncrater
196 cvs -d /cvs rtag -a -F -rDragonFly_RELEASE_1_4 DragonFly_RELEASE_1_4_Slip src
197
68dbf81b
MD
198iamoncrater:
199 @ [ "`hostname`" = "crater.dragonflybsd.org" ] || \
200 (echo "You are not on the master cvs host"; exit 1)
201
202#
203# Build compatibility overrides
204#
3471b4b9 205.ifdef CCVER
fa123c6f
JS
206.if ${CCVER} == "gcc2"
207CCVER= gcc34
208.endif
209.endif
68dbf81b 210