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