Regenerate the pciconf(8) database from the following files:
[dragonfly.git] / nrelease / Makefile
CommitLineData
fb92f9a7 1# $DragonFly: src/nrelease/Makefile,v 1.76 2008/03/07 20:29:24 swildner Exp $
6ca9a59c 2#
5b22b655 3
9b29c40a
MD
4#########################################################################
5# ENHANCEMENTS #
6#########################################################################
7
8# These targets are now obsolete and should not be used
9#
10installer_release: warning release
11installer_quickrel: warning quickrel
12installer_realquickrel: warning realquickrel
13installer_fetch: warning fetch
cc224c64 14
bce110a5 15.if make(installer_release) || make(installer_quickrel) || make(installer_realquickrel) || make(installer_fetch)
cc224c64
JS
16WITH_INSTALLER=
17.endif
18
9b29c40a
MD
19# New method e.g. 'make installer fetch'. A series of enhancement
20# targes may be specified which set make variables which enhance
21# the build in various ways.
22#
23installer:
24
25warning:
26 @echo "WARNING: The installer_* targets are now obsolete, please"
27 @echo "use 'make installer blah' instead of 'make installer_blah'"
28 @echo ""
29 @echo "will continue in 10 seconds"
30 @sleep 10
31
32.if make(installer)
33WITH_INSTALLER=
34.endif
35
36#########################################################################
37# SETUP #
38#########################################################################
39
6ca9a59c
MD
40ISODIR ?= /usr/release
41ISOFILE ?= ${ISODIR}/dfly.iso
42ISOROOT = ${ISODIR}/root
43OBJSYS= ${.OBJDIR}/../sys
1d3eb8c5 44KERNCONF ?= GENERIC VKERNEL
6ca9a59c 45
cc224c64 46PKGSRC_PREFIX?= /usr/pkg
bce110a5 47PKGBIN_PKG_ADD?= ${PKGSRC_PREFIX}/sbin/pkg_add
95b64753 48PKGBIN_PKG_DELETE?= ${PKGSRC_PREFIX}/sbin/pkg_delete
c791834f 49PKGBIN_PKG_ADMIN?= ${PKGSRC_PREFIX}/sbin/pkg_admin
bce110a5
MD
50PKGBIN_MKISOFS?= ${PKGSRC_PREFIX}/bin/mkisofs
51PKGSRC_PKG_PATH?= ${ISODIR}/packages
52PKGSRC_DB?= /var/db/pkg
356095db 53PKGSRC_BOOTSTRAP_URL?= http://pkgbox.dragonflybsd.org/DragonFly-pkgsrc-packages/i386/1.12.0-RELEASE-BUILD
cc224c64 54
2157278d 55ENVCMD?= env
cc224c64 56TAR?= tar
cc224c64 57
356095db
MD
58PKGSRC_CDRECORD?= cdrtools-ossdvd-2.01.1.36nb2.tgz
59PKGSRC_BOOTSTRAP_KIT?= bootstrap-kit-20080211
4b08f3df 60CVSUP_BOOTSTRAP_KIT?= cvsup-bootstrap-20070716
bce110a5 61
95b64753
MD
62# Default packages to be installed on the release ISO.
63#
356095db 64PKGSRC_PACKAGES?= cdrtools-ossdvd-2.01.1.36nb2.tgz
8188de86 65
95b64753
MD
66# Even though buildiso wipes the packages, our check target has to run
67# first and old packages (listed as they appear in pkg_info) must be
68# cleaned out in order for the pkg_add -n test we use in the check target
69# to operate properly.
70#
356095db
MD
71OLD_PKGSRC_PACKAGES?= cdrtools-2.01.01.27nb1 cdrecord-2.00.3nb2 \
72 bootstrap-kit-20070205
95b64753 73
8188de86
MD
74# Specify which root skeletons are required, and let the user include
75# their own. They are copied into ISODIR during the `pkgcustomizeiso'
76# target; each overwrites the last.
77#
78REQ_ROOTSKELS= ${.CURDIR}/root
cc224c64
JS
79ROOTSKELS?= ${REQ_ROOTSKELS}
80
81.if defined(WITH_INSTALLER)
356095db
MD
82# note: the old dfuibe_install and curses depend on the old gettext and
83# must be removed for the old gettext to be removed. The new dfuibe install
84# and curses are named the same as the old.
85#
86OLD_PKGSRC_PACKAGES+= dfuibe_installer-1.1.6 gettext-lib-0.14.5 \
87 dfuibe_installer-1.1.7nb1 dfuife_curses-1.5
95b64753 88PKGSRC_PACKAGES+= dfuibe_installer-1.1.7nb1.tgz dfuife_curses-1.5.tgz
356095db
MD
89PKGSRC_PACKAGES+= gettext-lib-0.14.6.tgz gettext-tools-0.14.6nb1.tgz
90PKGSRC_PACKAGES+= libaura-3.1.tgz libdfui-4.2.tgz libinstaller-5.1.tgz
2b990685 91ROOTSKELS+= ${.CURDIR}/installer
cc224c64 92.endif
8188de86 93
5b22b655
MD
94# note: we use the '${NRLOBJDIR}/nrelease' construct, that is we add
95# the additional '/nrelease' manually, as a safety measure.
96#
97NRLOBJDIR?= /usr/obj
98
acc392b5
JS
99WORLD_CCVER ?= ${CCVER}
100KERNEL_CCVER ?= ${CCVER}
101
8188de86
MD
102#########################################################################
103# BASE ISO TARGETS #
104#########################################################################
105
106release: check clean buildworld1 buildkernel1 \
19d86faa 107 buildiso syssrcs customizeiso mklocatedb mkiso
8188de86
MD
108
109quickrel: check clean buildworld2 buildkernel2 \
19d86faa 110 buildiso syssrcs customizeiso mklocatedb mkiso
2e3f8f38 111
19d86faa 112realquickrel: check clean buildiso syssrcs customizeiso mklocatedb mkiso
6ca9a59c 113
9b29c40a
MD
114quick: quickrel
115
116realquick: realquickrel
117
118#########################################################################
119# CORE SUPPORT TARGETS #
120#########################################################################
121
d2582113 122check:
bce110a5
MD
123.if !exists(${PKGBIN_PKG_ADD})
124 @echo "Unable to find ${PKGBIN_PKG_ADD}. You can use the following"
125 @echo "command to bootstrap pkgsrc:"
126 @echo " make pkgsrc_bootstrap"
127 @exit 1
128.endif
95b64753
MD
129.for PKG in ${OLD_PKGSRC_PACKAGES}
130 @${ENVCMD} PKG_PATH=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_DELETE} -K ${ISOROOT}/var/db/pkg ${PKG} > /dev/null 2>&1 || exit 0
131.endfor
bce110a5 132.for PKG in ${PKGSRC_PACKAGES}
a0b76df4 133 @${ENVCMD} PKG_PATH=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_ADD} -K ${ISOROOT}/var/db/pkg -n ${PKG} > /dev/null 2>&1 || \
cbbd7681 134 (echo "Unable to find ${PKG}, use the following command to fetch required packages:"; echo " make [installer] fetch"; exit 1)
bce110a5
MD
135.endfor
136.if !exists(${PKGBIN_MKISOFS})
137 @echo "mkisofs is not installed. It is part of the cdrecord package."
138 @echo "You can install it with:"
139 @echo " make pkgsrc_cdrecord"
140 @exit 1
141.endif
0a1628e7
MD
142.if !exists(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
143 @echo "The pkgsrc bootstrap kit is not installed. You can install it with:"
cbbd7681 144 @echo " make [installer] fetch"
0a1628e7
MD
145 @exit 1
146.endif
147.if !exists(${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}.tgz)
148 @echo "The cvsup bootstrap kit is not installed. You can install it with:"
cbbd7681 149 @echo " make [installer] fetch"
0a1628e7
MD
150 @exit 1
151.endif
2e3f8f38 152
588a679c
SS
153buildworld1 buildworld2:
154 cd ${.CURDIR}/..; CCVER=${WORLD_CCVER} make ${.TARGET:C/build(.*)2/quick\1/:C/1//}
6ca9a59c 155
588a679c
SS
156buildkernel1 buildkernel2:
157 cd ${.CURDIR}/..; \
158 first=; \
159 for kernconf in ${KERNCONF}; do \
160 CCVER=${KERNEL_CCVER} make ${.TARGET:C/build(.*)2/quick\1/:C/1//} \
161 KERNCONF=$${kernconf} \
162 $${first:+-DNO_MODULES}; \
163 first=done; \
164 done
6ca9a59c 165
5b22b655
MD
166# note that we do not want to mess with any /usr/obj directories not related
167# to buildworld, buildkernel, or nrelease, so we must supply the proper
168# MAKEOBJDIRPREFIX for targets that are not run through the buildworld and
169# buildkernel mechanism.
170#
6ca9a59c
MD
171buildiso:
172 if [ ! -d ${ISOROOT} ]; then mkdir -p ${ISOROOT}; fi
5b22b655 173 if [ ! -d ${NRLOBJDIR}/nrelease ]; then mkdir -p ${NRLOBJDIR}/nrelease; fi
6ca9a59c 174 ( cd ${.CURDIR}/..; make DESTDIR=${ISOROOT} installworld )
ab64cf06
SS
175 ( cd ${.CURDIR}/../etc; MAKEOBJDIRPREFIX=${NRLOBJDIR}/nrelease \
176 make -m ${.CURDIR}/../share/mk DESTDIR=${ISOROOT} distribution )
a0b76df4 177 chroot ${ISOROOT} /usr/bin/newaliases
21aa02d0 178 cpdup ${ISOROOT}/etc ${ISOROOT}/etc.hdd
588a679c
SS
179 cd ${.CURDIR}/..; \
180 first=; \
181 for kernconf in ${KERNCONF}; do \
182 make DESTDIR=${ISOROOT} \
183 installkernel KERNCONF=$${kernconf} \
184 $${first:+DESTKERNNAME=kernel.$${kernconf}} \
185 $${first:+-DNO_MODULES}; \
186 first=done; \
187 done
c5c5e6fc 188 ln -s kernel ${ISOROOT}/kernel.BOOTP
6ca9a59c
MD
189 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.local.dist -p ${ISOROOT}/usr/local/
190 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.var.dist -p ${ISOROOT}/var
191 dev_mkdb -f ${ISOROOT}/var/run/dev.db ${ISOROOT}/dev
8188de86 192
19d86faa
MD
193# Include kernel sources on the release CD (~14MB)
194#
195syssrcs:
66b79064
MD
196.if !defined(WITHOUT_SRCS)
197 ( cd ${.CURDIR}/../..; tar --exclude CVS -cf - src/Makefile src/Makefile.inc1 src/sys | bzip2 -9 > ${ISOROOT}/usr/src-sys.tar.bz2 )
198.endif
19d86faa 199
8188de86 200customizeiso:
0a1628e7 201 (cd ${PKGSRC_PKG_PATH}; tar xzpf ${CVSUP_BOOTSTRAP_KIT}.tgz)
8188de86
MD
202.for ROOTSKEL in ${ROOTSKELS}
203 cpdup -X cpignore -o ${ROOTSKEL} ${ISOROOT}
204.endfor
f6c08bce 205 rm -rf ${ISOROOT}/tmp/bootstrap ${ISOROOT}/usr/obj/pkgsrc
20585f87 206 cd ${ISOROOT}; tar xvzpf ${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz
0a1628e7 207 cp -p ${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}/usr/local/bin/cvsup ${ISOROOT}/usr/local/bin/cvsup
c751e497 208 cp -p ${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}/usr/local/man/man1/cvsup.1 ${ISOROOT}/usr/local/man/man1/cvsup.1
d08963d3 209 rm -rf ${ISOROOT}/tmp/bootstrap ${ISOROOT}/usr/obj/pkgsrc
8188de86 210 rm -rf `find ${ISOROOT} -type d -name CVS -print`
21aa02d0 211 rm -rf ${ISOROOT}/usr/local/share/pristine
7249926b 212 pwd_mkdb -p -d ${ISOROOT}/etc ${ISOROOT}/etc/master.passwd
4fba3387
CP
213.for UPGRADE_ITEM in Makefile \
214 etc.${MACHINE_ARCH} \
215 isdn/Makefile \
216 rc.d/Makefile \
217 periodic/Makefile \
218 periodic/daily/Makefile \
219 periodic/security/Makefile \
220 periodic/weekly/Makefile \
221 periodic/monthly/Makefile
222 cp -R ${.CURDIR}/../etc/${UPGRADE_ITEM} ${ISOROOT}/etc/${UPGRADE_ITEM}
20585f87 223.endfor
fb92f9a7
SW
224 # There seems to be no reliable way to install a package to a target
225 # directory prefix so we mount_null our package directory into the
226 # ISO root and do the install chrooted.
20585f87 227 #
20585f87 228 mkdir ${ISOROOT}/tmp/packages
fb92f9a7 229 mount_null -o ro ${PKGSRC_PKG_PATH} ${ISOROOT}/tmp/packages
bce110a5 230.for PKG in ${PKGSRC_PACKAGES}
90741959 231 ${ENVCMD} PKG_PATH=/tmp/packages chroot ${ISOROOT} ${PKGBIN_PKG_ADD} -I ${PKG}
8188de86 232.endfor
fb92f9a7
SW
233 umount ${ISOROOT}/tmp/packages
234 rmdir ${ISOROOT}/tmp/packages
c791834f 235 find ${ISOROOT}${PKGSRC_DB} -name +CONTENTS -type f -exec sed -i '' -e 's,${ISOROOT},,' -- {} \;
20585f87 236 chroot ${ISOROOT} ${PKGBIN_PKG_ADMIN} rebuild
6ca9a59c 237
8398ca17
SW
238mklocatedb:
239 ( find -s ${ISOROOT} -path ${ISOROOT}/tmp -or \
240 -path ${ISOROOT}/usr/tmp -or -path ${ISOROOT}/var/tmp \
241 -prune -o -print | sed -e 's#^${ISOROOT}##g' | \
242 /usr/libexec/locate.mklocatedb \
243 -presort >${ISOROOT}/var/db/locate.database )
244
6ca9a59c 245mkiso:
bce110a5 246 ( cd ${ISOROOT}; ${PKGBIN_MKISOFS} -b boot/cdboot -no-emul-boot \
382f1ee3 247 -R -J -V DragonFly -o ${ISOFILE} . )
6ca9a59c
MD
248
249clean:
250 if [ -d ${ISOROOT} ]; then chflags -R noschg ${ISOROOT}; fi
8188de86 251 if [ -d ${ISOROOT} ]; then rm -rf ${ISOROOT}/*; fi
5b22b655 252 if [ -d ${NRLOBJDIR}/nrelease ]; then rm -rf ${NRLOBJDIR}/nrelease; fi
6ca9a59c
MD
253
254realclean: clean
3ebedc5e 255 rm -rf ${OBJSYS}/${KERNCONF}
bce110a5
MD
256 # do not use PKGSRC_PKG_PATH here, we do not want to destroy an
257 # override location.
258 if [ -d ${ISODIR}/packages ]; then rm -rf ${ISODIR}/packages; fi
6ca9a59c 259
cc224c64 260fetch:
9b29c40a 261 @if [ ! -d ${PKGSRC_PKG_PATH} ]; then mkdir -p ${PKGSRC_PKG_PATH}; fi
bce110a5 262.for PKG in ${PKGSRC_PACKAGES}
a0b76df4 263 @${ENVCMD} PKG_PATH=${PKGSRC_PKG_PATH} ${PKGBIN_PKG_ADD} -K ${ISOROOT}/var/db/pkg -n ${PKG} > /dev/null 2>&1 || \
bce110a5
MD
264 (cd ${PKGSRC_PKG_PATH}; echo "Fetching ${PKGSRC_BOOTSTRAP_URL}/${PKG}"; fetch ${PKGSRC_BOOTSTRAP_URL}/${PKG})
265.endfor
266.if !exists(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
267 (cd ${PKGSRC_PKG_PATH}; fetch ${PKGSRC_BOOTSTRAP_URL}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
268.endif
0a1628e7
MD
269.if !exists(${PKGSRC_PKG_PATH}/${CVSUP_BOOTSTRAP_KIT}.tgz)
270 (cd ${PKGSRC_PKG_PATH}; fetch ${PKGSRC_BOOTSTRAP_URL}/${CVSUP_BOOTSTRAP_KIT}.tgz)
271.endif
bce110a5
MD
272
273pkgsrc_bootstrap:
274 mkdir -p ${PKGSRC_PKG_PATH}
275.if !exists(${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
276 (cd ${PKGSRC_PKG_PATH}; fetch ${PKGSRC_BOOTSTRAP_URL}/${PKGSRC_BOOTSTRAP_KIT}.tgz)
277.endif
278 (cd ${PKGSRC_PKG_PATH}; tar xzpf ${PKGSRC_BOOTSTRAP_KIT}.tgz)
279 (cd ${PKGSRC_PKG_PATH}/${PKGSRC_BOOTSTRAP_KIT}/bootstrap; ./bootstrap)
280
bce110a5
MD
281pkgsrc_cdrecord:
282.if !exists (${PKGBIN_MKISOFS})
20585f87 283 ${PKGBIN_PKG_ADD} ${PKGSRC_PKG_PATH}/cdrtools*
bce110a5 284.endif
cc224c64 285
588a679c 286
cc224c64 287.PHONY: all release installer_release quickrel installer_quickrel realquickrel
9b29c40a
MD
288.PHONY: installer_fetch installer
289.PHONY: quick realquick
cc224c64
JS
290.PHONY: installer_realquickrel check buildworld1 buildworld2
291.PHONY: buildkernel1 buildkernel2 buildiso customizeiso mklocatedb mkiso
d5c58845 292.PHONY: clean realclean fetch
cc224c64 293
6ca9a59c 294.include <bsd.prog.mk>