nrelease: Add back the creation of the /usr/local hierarchy on the LiveCD.
[dragonfly.git] / nrelease / Makefile
1 #########################################################################
2 #                               ENHANCEMENTS                            #
3 #########################################################################
4
5 # New method e.g. 'make gui release'.  A series of enhancement
6 # targes may be specified which set make variables which enhance
7 # the build in various ways.
8 #
9 gui installer img:
10
11 #########################################################################
12 #                                SETUP                                  #
13 #########################################################################
14
15 ISODIR?=        /usr/release
16 ISOROOT?=       ${ISODIR}/root
17 OBJSYS=         ${.OBJDIR}/../sys
18
19 MAKE_JOBS?=     $$(sysctl -n hw.ncpu)
20
21 # temporary until everybody has converted to x86_64
22 .if ${MACHINE_ARCH} == "amd64"
23 MACHINE_ARCH=   x86_64
24 .makeenv MACHINE_ARCH
25 .endif
26
27 .if make(gui)
28 KERNCONF ?= DFLYLIVE VKERNEL DFLYLIVE-SMP DFLYLIVE-SMP-NOAPIC
29 .else
30 # XXX makeshift fix to build the right kernel for the (target) architecture
31 # We should configure this in the platform files somehow
32 .if ${MACHINE_ARCH} == "i386"
33 KERNCONF ?= GENERIC VKERNEL
34 .else
35 KERNCONF ?= X86_64_GENERIC VKERNEL64
36 .endif
37 .endif
38
39 PKGSRC_PREFIX?=         /usr/pkg
40 PKGBIN_PKG_ADD?=        ${PKGSRC_PREFIX}/sbin/pkg_add
41 PKGBIN_PKG_DELETE?=     ${PKGSRC_PREFIX}/sbin/pkg_delete
42 PKGBIN_PKG_ADMIN?=      ${PKGSRC_PREFIX}/sbin/pkg_admin
43 PKGBIN_MKISOFS?=        ${PKGSRC_PREFIX}/bin/mkisofs
44 PKGSRC_PKG_PATH?=       ${ISODIR}/packages
45 PKGSRC_BOOTSTRAP_URL?=  http://avalon.dragonflybsd.org/DragonFly-pkgsrc-packages/i386/1.12.0-RELEASE-BUILD
46
47 # We use env -i in the chroot, so that environment variables won't
48 # disturb any (pkgsrc) build.  This has happened for TARGET_ARCH,
49 # which is used by gmake in completely different context.
50 #
51 CHROOT_CMD?=            env -i CCVER=${CCVER:Q} /usr/sbin/chroot ${ISOROOT} sh -c
52
53 # User may specify extra packages in addition to the defaults
54 #
55 PKGSRC_EXTRA_PACKAGES?=
56
57 # Pkgsrc packages to be built and installed on the release ISO
58 #
59 PKGSRC_PACKAGES?=       pkgtools/pkg_leaves \
60                         pkgtools/pkg_tarup \
61                         pkgtools/pkgin \
62                         devel/scmgit \
63                         net/isc-dhcp4 \
64                         net/isc-dhcpd4 \
65                         sysutils/cdrtools \
66                         net/csup \
67                         ${PKGSRC_EXTRA_PACKAGES}
68
69 # pkgsrc options to use when building packages
70 #
71 PKGSRC_OPTIONS+=        MAKE_JOBS=${MAKE_JOBS}
72 PKGSRC_OPTIONS+=        WRKOBJDIR=/usr/pkgobj
73 PKGSRC_OPTIONS+=        PKG_DEFAULT_OPTIONS='dri inet6'
74 .if !make(gui)
75 PKGSRC_OPTIONS+=        PKG_OPTIONS.scmgit=-scmgit-gui
76 .endif
77
78 # Even though buildiso wipes the packages, our check target has to run
79 # first and old packages (listed as they appear in pkg_info) must be
80 # cleaned out in order for the pkg_add -n test we use in the check target
81 # to operate properly.
82 #
83 OLD_PKGSRC_PACKAGES?=   cdrtools-2.01.01.27nb1 \
84                         cdrecord-2.00.3nb2 \
85                         bootstrap-kit-20070205 \
86                         dfuibe_installer-1.1.6 \
87                         gettext-lib-0.14.5 \
88                         dfuibe_installer-1.1.7nb1 \
89                         dfuife_curses-1.5 \
90                         gettext-lib-0.14.6 \
91                         gettext-tools-0.14.6nb1 \
92                         libaura-3.1 \
93                         libdfui-4.2 \
94                         libinstaller-5.1 \
95                         bootstrap-kit-20080211 \
96                         cdrtools-ossdvd-2.01.1.36nb2 \
97                         isc-dhcp-base-4.0.0 \
98                         isc-dhcp-server-4.0.0
99
100 # Specify which root skeletons are required, and let the user include
101 # their own.  They are copied into ISODIR during the `customizeiso'
102 # target; each overwrites the last.
103 #
104 REQ_ROOTSKELS=  ${.CURDIR}/root
105 ROOTSKELS?=     ${REQ_ROOTSKELS}
106
107 .if make(gui)
108 ISOFILE?=               ${ISODIR}/dfly-gui.iso
109 IMGFILE?=               ${ISODIR}/dfly-gui.img
110 PKGSRC_PACKAGES+=       meta-pkgs/modular-xorg-apps \
111                         meta-pkgs/modular-xorg-drivers \
112                         meta-pkgs/modular-xorg-fonts \
113                         meta-pkgs/modular-xorg-libs \
114                         wm/fluxbox \
115                         wm/fvwm \
116                         www/firefox \
117                         print/xpdf \
118                         shells/zsh \
119                         editors/emacs \
120                         editors/vim \
121                         chat/pidgin \
122                         chat/irssi \
123                         chat/xchat \
124                         x11/modular-xorg-server \
125                         x11/rxvt-unicode \
126                         x11/eterm \
127                         lang/perl5 \
128                         editors/nano \
129                         shells/bash \
130                         devel/exctags \
131                         archivers/zip \
132                         security/sudo \
133                         www/links-gui \
134                         net/nmap \
135                         net/wget \
136                         fonts/terminus-font \
137                         net/rsync \
138                         sysutils/idesk \
139                         time/asclock \
140                         misc/screen
141 ROOTSKELS+=             ${.CURDIR}/gui
142 .endif
143
144 ISOFILE ?= ${ISODIR}/dfly.iso
145 IMGFILE ?= ${ISODIR}/dfly.img
146
147 IMGMNT ?= ${ISODIR}/mnt
148
149 # USB umass now probes starting at da8, so the usb stick is
150 # probably sitting on da8.
151 #
152 IMGUSBDEV ?= da8
153
154 # note: we use the '${NRLOBJDIR}/nrelease' construct, that is we add
155 # the additional '/nrelease' manually, as a safety measure.
156 #
157 NRLOBJDIR?= /usr/obj
158
159 #########################################################################
160 #                               BASE ISO TARGETS                        #
161 #########################################################################
162
163 release:        check clean buildworld1 buildkernel1 \
164                 buildiso srcs customizeiso mklocatedb \
165                 mkiso mkimg
166
167 quickrel:       check clean buildworld2 buildkernel2 \
168                 buildiso srcs customizeiso mklocatedb \
169                 mkiso mkimg
170
171 realquickrel:   check clean \
172                 buildiso srcs customizeiso mklocatedb \
173                 mkiso mkimg
174
175 restartpkgs:    check customizeiso mklocatedb mkiso mkimg
176
177 quick:          quickrel
178
179 realquick:      realquickrel
180
181
182 #########################################################################
183 #                          CORE SUPPORT TARGETS                         #
184 #########################################################################
185
186 check:
187 .if !exists(${PKGBIN_PKG_ADMIN})
188         @echo "You never bootstrapped pkgsrc on your machine.  You can install it with:"
189         @echo "    make pkgsrc_bootstrap"
190 .endif
191 .if !exists (${PKGBIN_MKISOFS})
192         @echo
193         @echo "Your machine does not have cdrtools installed.  You can install it with:"
194         @echo "    make pkgsrc_cdrecord"
195 .endif
196 .if !defined(PKGSRC_PATH)
197         @echo "Please set PKGSRC_PATH to the pkgsrc tree that shall be used for"
198         @echo "package building.  For example /usr/pkgsrc.  See the Makefile"
199         @echo "in /usr if you are unfamiliar with pkgsrc."
200 .endif
201 .if !exists (${PKGBIN_MKISOFS})
202         @exit 1
203 .endif
204 .if !defined(PKGSRC_PATH)
205         @exit 1
206 .endif
207
208 buildworld1 buildworld2:
209         cd ${.CURDIR}/..; \
210         ${WORLD_CCVER:C/^..*$/WORLD_CCVER=/}${WORLD_CCVER} \
211                 make -j ${MAKE_JOBS} -DWANT_INSTALLER ${.TARGET:C/build(.*)2/quick\1/:C/1//}
212
213 buildkernel1 buildkernel2:
214 .if make(gui)
215         cd ${.CURDIR}/..; \
216         for kernconf in ${KERNCONF}; do \
217                 ${WORLD_CCVER:C/^..*$/WORLD_CCVER=/}${WORLD_CCVER} \
218                         make -j ${MAKE_JOBS} ${.TARGET:C/build(.*)2/quick\1/:C/1//} \
219                         KERNCONF=$${kernconf} KERNCONFDIR=${.CURDIR}/gui/root; \
220         done
221 .else
222         cd ${.CURDIR}/..; \
223         first=; \
224         for kernconf in ${KERNCONF}; do \
225                 ${WORLD_CCVER:C/^..*$/WORLD_CCVER=/}${WORLD_CCVER} \
226                         make -j ${MAKE_JOBS} ${.TARGET:C/build(.*)2/quick\1/:C/1//} \
227                         KERNCONF=$${kernconf} \
228                         $${first:+-DNO_MODULES}; \
229                 first=done; \
230         done
231 .endif
232
233 # note that we do not want to mess with any /usr/obj directories not related
234 # to buildworld, buildkernel, or nrelease, so we must supply the proper
235 # MAKEOBJDIRPREFIX for targets that are not run through the buildworld and 
236 # buildkernel mechanism.
237 #
238 # Unconditionally clean out /usr/release/root so a previous img build
239 # does not blow up a future quick iso build
240 #
241 buildiso:
242         -rm -rf ${ISOROOT}
243         -chflags -R noschg ${ISOROOT}
244         rm -rf ${ISOROOT}
245         mkdir -p ${ISOROOT}
246         if [ ! -d ${NRLOBJDIR}/nrelease ]; then mkdir -p ${NRLOBJDIR}/nrelease; fi
247         ( cd ${.CURDIR}/..; make -DWANT_INSTALLER DESTDIR=${ISOROOT} installworld )
248         ( cd ${.CURDIR}/../etc; MAKEOBJDIRPREFIX=${NRLOBJDIR}/nrelease \
249                 make -m ${.CURDIR}/../share/mk DESTDIR=${ISOROOT} distribution )
250         cpdup ${ISOROOT}/etc ${ISOROOT}/etc.hdd
251 .if make(gui)
252         if [ ! -d ${ISOROOT}/kernel.smp/boot ]; then mkdir -p ${ISOROOT}/kernel.smp/boot; fi
253         cd ${.CURDIR}/..; \
254         make installkernel DESTDIR=${ISOROOT} \
255         KERNCONF=DFLYLIVE DESTKERNNAME=kernel KERNCONFDIR=${.CURDIR}/gui/root; \
256         cd ${.CURDIR}/..; \
257         make installkernel DESTDIR=${ISOROOT} \
258         KERNCONF=VKERNEL DESTKERNNAME=kernel.VKERNEL -DNO_MODULES KERNCONFDIR=${.CURDIR}/gui/root; \
259         cd ${.CURDIR}/..; \
260         make installkernel DESTDIR=${ISOROOT}/kernel.smp \
261         KERNCONF=DFLYLIVE-SMP DESTKERNNAME=kernel KERNCONFDIR=${.CURDIR}/gui/root; \
262         cd ${.CURDIR}/..; \
263         make installkernel DESTDIR=${ISOROOT}/kernel.smp \
264         KERNCONF=DFLYLIVE-SMP-NOAPIC DESTKERNNAME=kernel.noapic \
265                 KERNCONFDIR=${.CURDIR}/gui/root -DNO_MODULES;
266 .else
267         cd ${.CURDIR}/..; \
268         first=; \
269         for kernconf in ${KERNCONF}; do \
270                 make DESTDIR=${ISOROOT} \
271                         installkernel KERNCONF=$${kernconf} \
272                         $${first:+DESTKERNNAME=kernel.$${kernconf}} \
273                         $${first:+-DNO_MODULES}; \
274                 first=done; \
275         done
276 .endif
277         ln -s kernel ${ISOROOT}/boot/kernel.BOOTP
278         mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.local.dist -p ${ISOROOT}/usr/local/
279         mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.var.dist -p ${ISOROOT}/var
280         dev_mkdb -f ${ISOROOT}/var/run/dev.db ${ISOROOT}/dev
281
282 # Release CD: Kernel sources (~16M) and the full pkgsrc tree (~27M)
283 # Release DVD: Full sources (~90M) and the full pkgsrc tree (~27M)
284 #
285 srcs:
286 .if !defined(WITHOUT_SRCS)
287         rm -f ${ISOROOT}/usr/pkgsrc-git.tgz
288         rm -f ${ISOROOT}/usr/pkgsrc
289         mkdir -p ${ISOROOT}/usr/pkgsrc
290         cd ${ISOROOT}/usr/pkgsrc && git init
291         cd ${ISOROOT}/usr/pkgsrc && \
292                 git remote add origin git://git.dragonflybsd.org/pkgsrc.git
293         cd ${ISOROOT}/usr/pkgsrc && git fetch origin
294         cd ${ISOROOT}/usr/pkgsrc && git branch vendor origin/vendor
295         cd ${ISOROOT}/usr/pkgsrc && git gc
296 .if make(gui)
297         rm -f ${ISOROOT}/usr/src-git.tgz
298         rm -rf ${ISOROOT}/usr/src
299         mkdir -p ${ISOROOT}/usr/src
300         cd ${ISOROOT}/usr/src && git init
301         cd ${ISOROOT}/usr/src && \
302                 git remote add origin git://git.dragonflybsd.org/dragonfly.git
303         cd ${ISOROOT}/usr/src && git fetch origin
304         cd ${ISOROOT}/usr/src && git branch master origin/master
305         cd ${ISOROOT}/usr/src && git gc
306 .else
307         rm -f ${ISOROOT}/usr/src-sys.tgz
308         cd ${.CURDIR}/.. && tar --exclude .git --exclude CVS -s '/^\./src/' \
309                 -czf ${ISOROOT}/usr/src-sys.tgz ./Makefile ./Makefile.inc1 ./sys
310 .endif
311 .endif
312
313 # Customize the ISO by copying rootskels in reverse priority order,
314 # building packages, and doing other post-install tasks.
315 #
316 customizeiso:
317         # Copy the rootskels.  Allow sources to be owned by someone other
318         # then root (as is common when checked out via git).
319         #
320 .for ROOTSKEL in ${ROOTSKELS}
321         cpdup -X cpignore -o ${ROOTSKEL} ${ISOROOT}
322         @test -O ${.CURDIR} || echo "chowning copied files to root:wheel"
323         @test -O ${.CURDIR} || ((cd ${ROOTSKEL} && find .) | fgrep -v cpignore | (cd ${ISOROOT} && xargs chown root:wheel))
324 .endfor
325         pwd_mkdb -p -d ${ISOROOT}/etc ${ISOROOT}/etc/master.passwd
326 .for UPGRADE_ITEM in Makefile                   \
327                      etc.${MACHINE_ARCH}        \
328                      isdn/Makefile              \
329                      rc.d/Makefile              \
330                      periodic/Makefile          \
331                      periodic/daily/Makefile    \
332                      periodic/security/Makefile \
333                      periodic/weekly/Makefile   \
334                      periodic/monthly/Makefile
335         cp -R ${.CURDIR}/../etc/${UPGRADE_ITEM} ${ISOROOT}/etc/${UPGRADE_ITEM}
336 .endfor
337         #
338         # Setup some things & mount pkgsrc tree.  Use defensive umounts and
339         # rm -rf's to allow restarts.  Allow /usr/pkgsrc to be read-only.
340         #
341         # If we did not get past the bootstrap we clean out the entire
342         # /usr/pkg infrastructure.  Otherwise we attempt to pick up where
343         # we left off.
344         #
345         cp -p /etc/resolv.conf ${ISOROOT}/etc
346         ${CHROOT_CMD} "ldconfig -elf /usr/lib /usr/lib/gcc* /usr/lib/compat"
347         -@umount ${ISOROOT}/usr/pkgsrc/distfiles
348         -@umount ${ISOROOT}/usr/pkgsrc
349         -@umount ${ISOROOT}/dev
350         mkdir -p ${ISODIR}/distfiles
351         rm -rf ${ISOROOT}/usr/pkgobj
352         #
353         # Mount /usr/pkgsrc, make sure /usr/pkgsrc/distfiles is writable.
354         # Make /usr/pkgsrc read-only for safety, else a failed umount and
355         # our rm -rf will do bad things.
356         #
357         mkdir -p ${ISOROOT}/usr/pkgobj
358         mkdir -p ${ISOROOT}/usr/pkgobj/bootstrap
359         mkdir -p ${ISOROOT}/usr/pkgsrc
360         mount_null -o ro ${PKGSRC_PATH} ${ISOROOT}/usr/pkgsrc
361         mount_null /dev ${ISOROOT}/dev
362         cp /etc/shells ${ISOROOT}/usr/pkgsrc/distfiles/.test > /dev/null 2>&1 \
363             || mount_null ${ISODIR}/distfiles ${ISOROOT}/usr/pkgsrc/distfiles
364         #
365         # Bootstrap, if not already installed, and add licenses needed
366         # for the gui release
367         #
368         test -e ${ISODIR}/.didbootstrap || \
369             rm -rf ${ISOROOT}/usr/pkg ${ISOROOT}/var/db/pkg \
370                     ${ISOROOT}/var/db/pkg.refcount
371         test -e ${ISODIR}/.didbootstrap || \
372             ${CHROOT_CMD} "cd /usr/pkgsrc/bootstrap;    \
373                 ./bootstrap --workdir /usr/pkgobj/bootstrap/work"
374 .if make(gui)
375         test -e ${ISODIR}/.didbootstrap || \
376             echo ".ifdef BSD_PKG_MK     # added by nrelease" \
377                 >> ${ISOROOT}/usr/pkg/etc/mk.conf
378         test -e ${ISODIR}/.didbootstrap || \
379             echo "ACCEPTABLE_LICENSES+=openmotif-license" \
380                 >> ${ISOROOT}/usr/pkg/etc/mk.conf
381         test -e ${ISODIR}/.didbootstrap || \
382             echo "ACCEPTABLE_LICENSES+=vim-license" \
383                 >> ${ISOROOT}/usr/pkg/etc/mk.conf
384         test -e ${ISODIR}/.didbootstrap || \
385             echo ".endif                        # added by nrelease" \
386                 >> ${ISOROOT}/usr/pkg/etc/mk.conf
387 .endif
388         test -e ${ISODIR}/.didbootstrap || sync
389         test -e ${ISODIR}/.didbootstrap || touch ${ISODIR}/.didbootstrap
390         #
391         # Build and install packages, skip packages already installed
392         #
393 .for PKG in ${PKGSRC_PACKAGES}
394         ${CHROOT_CMD} "cd /usr/pkgsrc/${PKG} && \
395             (bmake check > /dev/null 2>&1 || \
396             bmake ${PKGSRC_OPTIONS} clean build install)"
397 .endfor
398         #
399         # Remove packages which nothing depends on and clean up
400         #
401         ${CHROOT_CMD} "pkg_leaves | xargs pkg_delete -R"
402         -umount ${ISOROOT}/usr/pkgsrc/distfiles
403         umount ${ISOROOT}/dev
404         umount ${ISOROOT}/usr/pkgsrc
405         rm -rf ${ISOROOT}/usr/pkgobj
406         rm -f ${ISOROOT}/etc/resolv.conf
407         makewhatis ${ISOROOT}/usr/pkg/man
408
409 # So locate works
410 #
411 mklocatedb:
412         ( find -s ${ISOROOT} -path ${ISOROOT}/tmp -or \
413                 -path ${ISOROOT}/usr/tmp -or -path ${ISOROOT}/var/tmp \
414                 -prune -o -print | sed -e 's#^${ISOROOT}##g' | \
415                 /usr/libexec/locate.mklocatedb \
416                 -presort >${ISOROOT}/var/db/locate.database )
417
418 mkiso:
419         ( cd ${ISOROOT}; ${PKGBIN_MKISOFS} -b boot/cdboot -no-emul-boot \
420                 -R -J -o ${ISOFILE} \
421                 -V "DragonFly `${.CURDIR}/../tools/gitrev.sh | cut -c -22`" . )
422
423
424 mkimg:
425 .if make(img)
426         if [ ! -d ${IMGMNT} ]; then mkdir -p ${IMGMNT}; fi
427         -if [ -f ${ISODIR}/vn.which ]; then umount ${IMGMNT};           \
428             vnconfig -u `cat ${ISODIR}/vn.which`; fi
429         @echo "STEP: determine required image size"
430         sz=`du -ck ${ISOROOT} | tail -n 1 | cut -f 1`;                  \
431             sz=`bc -e "(($${sz}) / 1024) * 1.15" -equit | cut -f1 -d.`; \
432             dd if=/dev/zero of=${IMGFILE} bs=1m count=$${sz};
433         fdisk -IB -p ${IMGFILE}
434         @echo "STEP: determine free vn device"
435         vnconfig -l | grep "not in use" | head -n 1 |                   \
436             cut -f 1 -d: > ${ISODIR}/vn.which
437         vnconfig -e -s labels `cat ${ISODIR}/vn.which` ${IMGFILE}
438         @echo "STEP: write standard disklabel"
439         disklabel -w -r `cat ${ISODIR}/vn.which`s1 auto
440         @echo "STEP: read disklabel back"
441         disklabel -r `cat ${ISODIR}/vn.which`s1 > ${IMGFILE}.label
442         @echo "STEP: determine number of sectors of whole disk"
443         secs=`tail -n 1 ${IMGFILE}.label | cut -f 3 -w`;                \
444             echo "  a:  $${secs} 0 4.2BSD" >> ${IMGFILE}.label;
445         @echo "STEP: write modified disklabel back"
446         disklabel -R -r `cat ${ISODIR}/vn.which`s1 ${IMGFILE}.label
447         rm ${IMGFILE}.label
448         @echo "STEP: write bootsector"
449         disklabel -B `cat ${ISODIR}/vn.which`s1
450         boot0cfg -B -o noupdate `cat ${ISODIR}/vn.which`
451         newfs /dev/`cat ${ISODIR}/vn.which`s1a
452         mount /dev/`cat ${ISODIR}/vn.which`s1a ${IMGMNT}
453         cpdup ${ISOROOT} ${IMGMNT}
454         @echo "STEP: fixup ${IMGMNT}/etc/fstab"
455         echo "/dev/${IMGUSBDEV}s1a / ufs rw,noatime 0 1" > ${IMGMNT}/etc/fstab
456         echo "proc /proc procfs rw 0 0" >> ${IMGMNT}/etc/fstab
457         @echo "STEP: fixup ${IMGMNT}/boot/loader.conf"
458         -fgrep -v kernel_options ${IMGMNT}/boot/loader.conf > ${IMGMNT}/boot/loader.conf.new
459         echo 'vfs.root.mountfrom="ufs:${IMGUSBDEV}s1a"' >> ${IMGMNT}/boot/loader.conf.new
460         mv ${IMGMNT}/boot/loader.conf.new ${IMGMNT}/boot/loader.conf
461         @echo "STEP: cleanup"
462         df ${IMGMNT}
463         umount ${IMGMNT}
464         vnconfig -u `cat ${ISODIR}/vn.which`
465         rm -f ${ISODIR}/vn.which
466         rmdir ${IMGMNT}
467         @echo "STEP: done"
468 .endif
469
470 clean:
471         -umount ${ISOROOT}/usr/pkgsrc/distfiles > /dev/null 2>&1
472         -umount ${ISOROOT}/usr/pkgsrc > /dev/null 2>&1
473         -umount ${ISOROOT}/dev > /dev/null 2>&1
474         -if [ -f ${ISODIR}/vn.which ]; then umount ${IMGMNT};           \
475             vnconfig -u `cat ${ISODIR}/vn.which`; fi
476         if [ -d ${ISOROOT} ]; then chflags -R noschg ${ISOROOT}; fi
477         rm -rf ${ISOROOT}
478         rm -rf ${NRLOBJDIR}/nrelease
479         rm -f ${ISODIR}/.didbootstrap ${ISODIR}/vn.which
480
481 realclean:      clean
482         rm -rf ${OBJSYS}/${KERNCONF}
483         #
484         # do not use PKGSRC_PKG_PATH here, we do not want to destroy an
485         # override location.
486         #
487         rm -rf ${ISODIR}/packages
488         rm -rf ${ISODIR}/distfiles
489
490 pkgsrc_bootstrap:
491         mkdir -p /usr/release/bootstrap
492         (cd ${PKGSRC_PATH}/bootstrap; ./bootstrap --workdir /usr/release/bootstrap)
493
494 pkgsrc_cdrecord:
495 .if !exists (${PKGBIN_MKISOFS})
496         (cd ${PKGSRC_PATH}/sysutils/cdrtools; bmake clean build install)
497 .endif
498
499 help all:
500         @echo "make [gui] release   - complete build from scratch"
501         @echo "make [gui] quick     - attempt to do an incremental rebuild"
502         @echo "make [gui] realquick - attempt to restart after world & kernel"
503         @echo "make [gui] restartpkgs - attempt to restart at the pkg building stage"
504         @echo ""
505         @echo "Extra packages may be specified with PKGSRC_EXTRA_PACKAGES"
506
507 .PHONY: release quickrel realquickrel
508 .PHONY: installer
509 .PHONY: quick realquick
510 .PHONY: check buildworld1 buildworld2
511 .PHONY: buildkernel1 buildkernel2 buildiso customizeiso mklocatedb mkiso mkimg
512 .PHONY: clean realclean help all srcs
513
514 .include <bsd.prog.mk>