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