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