2 # $FreeBSD: src/Makefile,v 1.234.2.19 2003/04/16 09:59:40 ru Exp $
3 # $DragonFly: src/Makefile,v 1.7 2004/04/24 04:38:49 drhodus Exp $
5 # The user-driven targets are:
7 # buildworld - Rebuild *everything*, including glue to help do
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
12 # installworld - Install everything built by "buildworld".
13 # world - buildworld + installworld.
14 # buildkernel - Rebuild the kernel and the kernel-modules.
15 # nativekernel - Rebuild the kernel using native tools via config.
16 # installkernel - Install the kernel and the kernel-modules.
17 # reinstallkernel - Reinstall the kernel and the kernel-modules.
18 # kernel - buildkernel + installkernel.
19 # update - Convenient way to update your source tree (cvs).
20 # upgrade - Upgrade the files in /etc and also setup the rest
21 # of the system for DragonFly. ex. two compilers
22 # most - Build user commands, no libraries or include files.
23 # installmost - Install user commands, no libraries or include files.
25 # This makefile is simple by design. The FreeBSD make automatically reads
26 # the /usr/share/mk/sys.mk unless the -m argument is specified on the
27 # command line. By keeping this makefile simple, it doesn't matter too
28 # much how different the installed mk files are from those in the source
29 # tree. This makefile executes a child make process, forcing it to use
30 # the mk files from the source tree which are supposed to DTRT.
32 # The user-driven targets (as listed above) are implemented in Makefile.inc1.
34 # If you want to build your system from source be sure that /usr/obj has
35 # at least 400MB of diskspace available.
37 # For individuals wanting to build from the sources currently on their
38 # system, the simple instructions are:
40 # 1. `cd /usr/src' (or to the directory containing your source tree).
43 # For individuals wanting to upgrade their sources (even if only a
44 # delta of a few days):
46 # 1. `cd /usr/src' (or to the directory containing your source tree).
47 # 2. `make buildworld'
48 # 3. `make buildkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
49 # 4. `make installkernel KERNCONF=YOUR_KERNEL_HERE' (default is GENERIC).
50 # 5. `reboot' (in single user mode: boot -s from the loader prompt).
52 # 7. `make installworld'
56 # See src/UPDATING `COMMON ITEMS' for more complete information.
58 # If TARGET_ARCH=arch (e.g. amd64) is specified you can
59 # cross build world for other architectures using the buildworld target,
60 # and once the world is built you can cross build a kernel using the
63 # Define the user-driven targets. These are listed here in alphabetical
64 # order, but that's not important.
66 TGTS= all all-man buildkernel buildworld crossworld quickworld \
67 realquickworld checkdpadd clean \
68 cleandepend cleandir depend distribute distributeworld everything \
69 hierarchy install installcheck installkernel \
70 reinstallkernel installmost installworld libraries lint maninstall \
71 mk most nativekernel obj objlink regress rerelease tags update
73 BITGTS= files includes
74 BITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/}
76 .ORDER: buildworld installworld
77 .ORDER: buildworld distributeworld
78 .ORDER: buildworld buildkernel
79 .ORDER: buildkernel installkernel
80 .ORDER: buildkernel reinstallkernel
82 PATH= /sbin:/bin:/usr/sbin:/usr/bin
83 MAKE= PATH=${PATH} make -m ${.CURDIR}/share/mk -f Makefile.inc1
86 # Handle the user-driven targets, using the source relative mk files.
92 # Set a reasonable default
95 STARTTIME!= LC_ALL=C date
99 # Attempt to rebuild and reinstall *everything*, with reasonable chance of
100 # success, regardless of how old your existing system is.
103 @echo "--------------------------------------------------------------"
104 @echo ">>> elf make world started on ${STARTTIME}"
105 @echo "--------------------------------------------------------------"
106 .if target(pre-world)
108 @echo "--------------------------------------------------------------"
109 @echo ">>> Making 'pre-world' target"
110 @echo "--------------------------------------------------------------"
111 @cd ${.CURDIR}; ${MAKE} pre-world
113 @cd ${.CURDIR}; ${MAKE} buildworld
114 @cd ${.CURDIR}; ${MAKE} -B installworld
115 .if target(post-world)
117 @echo "--------------------------------------------------------------"
118 @echo ">>> Making 'post-world' target"
119 @echo "--------------------------------------------------------------"
120 @cd ${.CURDIR}; ${MAKE} post-world
123 @echo "--------------------------------------------------------------"
124 @printf ">>> elf make world completed on `LC_ALL=C date`\n (started ${STARTTIME})\n"
125 @echo "--------------------------------------------------------------"
130 # Short hand for `make buildkernel installkernel'
132 kernel: buildkernel installkernel
135 # A simple test target used as part of the test to see if make supports
136 # the -m argument. Also test that make will only evaluate a conditional
137 # as far as is necessary to determine its value.
142 .if defined(notdef) && ${notdef:U}
147 # Upgrade the installed make to the current version using the installed
148 # headers, libraries and build tools. This is required on installed versions
149 # prior to 2.2.5 in which the installed make doesn't support the -m argument.
153 @echo "--------------------------------------------------------------"
154 @echo " Upgrading the installed make"
155 @echo "--------------------------------------------------------------"
156 @cd ${.CURDIR}/usr.bin/make; \
157 make obj && make depend && make all && make install
160 # Handle the upgrade of /etc
166 # Handle post-installworld updating of static files (e.g. like /etc/rc)
169 @cd ${.CURDIR}/etc; make upgrade_etc