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