Properly free the temporary sf_buf in uiomove_fromphys() if a copyin/copyout
[dragonfly.git] / Makefile
1 #
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 $
4 #
5 # The user-driven targets are:
6 #
7 # buildworld          - Rebuild *everything*, including glue to help do
8 #                       upgrades.
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.
24 #
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.
31 #
32 # The user-driven targets (as listed above) are implemented in Makefile.inc1.
33 #
34 # If you want to build your system from source be sure that /usr/obj has
35 # at least 400MB of diskspace available.
36 #
37 # For individuals wanting to build from the sources currently on their
38 # system, the simple instructions are:
39 #
40 # 1.  `cd /usr/src'  (or to the directory containing your source tree).
41 # 2.  `make world'
42 #
43 # For individuals wanting to upgrade their sources (even if only a
44 # delta of a few days):
45 #
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).
51 # 6.  `mergemaster -p'
52 # 7.  `make installworld'
53 # 8.  `mergemaster'
54 # 9.  `reboot'
55 #
56 # See src/UPDATING `COMMON ITEMS' for more complete information.
57 #
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
61 # buildkernel target.
62 #
63 # Define the user-driven targets. These are listed here in alphabetical
64 # order, but that's not important.
65 #
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
72
73 BITGTS= files includes
74 BITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/}
75
76 .ORDER: buildworld installworld
77 .ORDER: buildworld distributeworld
78 .ORDER: buildworld buildkernel
79 .ORDER: buildkernel installkernel
80 .ORDER: buildkernel reinstallkernel
81
82 PATH=   /sbin:/bin:/usr/sbin:/usr/bin
83 MAKE=   PATH=${PATH} make -m ${.CURDIR}/share/mk -f Makefile.inc1
84
85 #
86 # Handle the user-driven targets, using the source relative mk files.
87 #
88 ${TGTS} ${BITGTS}:
89         @cd ${.CURDIR}; \
90                 ${MAKE} ${.TARGET}
91
92 # Set a reasonable default
93 .MAIN:  all
94
95 STARTTIME!= LC_ALL=C date
96 #
97 # world
98 #
99 # Attempt to rebuild and reinstall *everything*, with reasonable chance of
100 # success, regardless of how old your existing system is.
101 #
102 world:
103         @echo "--------------------------------------------------------------"
104         @echo ">>> elf make world started on ${STARTTIME}"
105         @echo "--------------------------------------------------------------"
106 .if target(pre-world)
107         @echo
108         @echo "--------------------------------------------------------------"
109         @echo ">>> Making 'pre-world' target"
110         @echo "--------------------------------------------------------------"
111         @cd ${.CURDIR}; ${MAKE} pre-world
112 .endif
113         @cd ${.CURDIR}; ${MAKE} buildworld
114         @cd ${.CURDIR}; ${MAKE} -B installworld
115 .if target(post-world)
116         @echo
117         @echo "--------------------------------------------------------------"
118         @echo ">>> Making 'post-world' target"
119         @echo "--------------------------------------------------------------"
120         @cd ${.CURDIR}; ${MAKE} post-world
121 .endif
122         @echo
123         @echo "--------------------------------------------------------------"
124         @printf ">>> elf make world completed on `LC_ALL=C date`\n                        (started ${STARTTIME})\n"
125         @echo "--------------------------------------------------------------"
126
127 #
128 # kernel
129 #
130 # Short hand for `make buildkernel installkernel'
131 #
132 kernel: buildkernel installkernel
133
134 #
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.
138 #
139 test:
140 .if defined(notdef)
141 .undef notdef
142 .if defined(notdef) && ${notdef:U}
143 .endif
144 .endif
145
146 #
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.
150 #
151 make:
152         @echo
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
158
159 #
160 # Handle the upgrade of /etc
161 #
162
163 upgrade:        upgrade_etc
164
165 #
166 # Handle post-installworld updating of static files (e.g. like /etc/rc)
167 #
168 upgrade_etc:
169         @cd ${.CURDIR}/etc; make upgrade_etc