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