Add documentation for the pfil interface. This is NetBSD's rev. 1.24
[dragonfly.git] / nrelease / Makefile
CommitLineData
d5c58845 1# $DragonFly: src/nrelease/Makefile,v 1.46 2005/12/11 18:36:14 dillon Exp $
6ca9a59c 2#
5b22b655 3
cc224c64
JS
4# compat target
5installer_release: release
6installer_quickrel:
7installer_realquickrel: realquickrel
8
9.if make(installer_release) || make(installer_quickrel) || make(installer_realquickrel)
10WITH_INSTALLER=
11.endif
12
6ca9a59c
MD
13ISODIR ?= /usr/release
14ISOFILE ?= ${ISODIR}/dfly.iso
15ISOROOT = ${ISODIR}/root
16OBJSYS= ${.OBJDIR}/../sys
17KERNCONF ?= GENERIC
18
cc224c64
JS
19PKGSRC_PKG_ADD?= /usr/pkg/sbin/pkg_add
20PKGSRC_PKG_PATH?= ${.CURDIR}
21PKGSRC_BOOTSTRAP_FILE?= ${PKGSRC_PKG_PATH}/bootstrap.tar.gz
22PKGSRC_DB?= /var/db/pkg
23PKGSRC_PREFIX?= /usr/pkg
24PKGSRC_RSYNC_SRC?= rsync://packages.stura.uni-rostock.de/dfly14-nrelease
25
26ENV?= env
27TAR?= tar
28RSYNC_CMD?= rsync -avz
29
30PKGSRC_PACKAGES?= cdrecord
8188de86
MD
31
32# Specify which root skeletons are required, and let the user include
33# their own. They are copied into ISODIR during the `pkgcustomizeiso'
34# target; each overwrites the last.
35#
36REQ_ROOTSKELS= ${.CURDIR}/root
cc224c64
JS
37ROOTSKELS?= ${REQ_ROOTSKELS}
38
39.if defined(WITH_INSTALLER)
40PKGSRC_PACKAGES+= dfuibe_installer dfuife_curses
41ROOTSKELS+= installer
42.endif
8188de86 43
5b22b655
MD
44# note: we use the '${NRLOBJDIR}/nrelease' construct, that is we add
45# the additional '/nrelease' manually, as a safety measure.
46#
47NRLOBJDIR?= /usr/obj
48
acc392b5
JS
49WORLD_CCVER ?= ${CCVER}
50KERNEL_CCVER ?= ${CCVER}
51
8188de86
MD
52#########################################################################
53# BASE ISO TARGETS #
54#########################################################################
55
56release: check clean buildworld1 buildkernel1 \
cc224c64 57 buildiso customizeiso mklocatedb mkiso
8188de86
MD
58
59quickrel: check clean buildworld2 buildkernel2 \
cc224c64 60 buildiso customizeiso mklocatedb mkiso
2e3f8f38 61
cc224c64 62realquickrel: check clean buildiso customizeiso mklocatedb mkiso
6ca9a59c 63
d2582113 64check:
cc224c64
JS
65 @${ECHO} Testing mkisofs...
66 @mkisofs --version > /dev/null
67 @${ECHO} Testing pkg_add and list of packages...
68 @${ENV} PKG_PATH=${PKGSRC_PKG_PATH} ${PKGSRC_PKG_ADD} -n ${PKGSRC_PACKAGES} > /dev/null 2>&1
69 @${ECHO} Testing for existence of bootstrap kit...
70 @[ -r ${PKGSRC_BOOTSTRAP_FILE} ]
2e3f8f38 71
6ca9a59c 72buildworld1:
c3f3fe6d 73 ( cd ${.CURDIR}/..; CCVER=${WORLD_CCVER} make buildworld )
6ca9a59c
MD
74
75buildworld2:
82a1be39 76 ( cd ${.CURDIR}/..; CCVER=${WORLD_CCVER} make quickworld )
6ca9a59c
MD
77
78buildkernel1:
c3f3fe6d 79 ( cd ${.CURDIR}/..; CCVER=${KERNEL_CCVER} make buildkernel KERNCONF=${KERNCONF} )
6ca9a59c
MD
80
81buildkernel2:
82a1be39 82 ( cd ${.CURDIR}/..; CCVER=${KERNEL_CCVER} make quickkernel KERNCONF=${KERNCONF} )
6ca9a59c 83
5b22b655
MD
84# note that we do not want to mess with any /usr/obj directories not related
85# to buildworld, buildkernel, or nrelease, so we must supply the proper
86# MAKEOBJDIRPREFIX for targets that are not run through the buildworld and
87# buildkernel mechanism.
88#
6ca9a59c
MD
89buildiso:
90 if [ ! -d ${ISOROOT} ]; then mkdir -p ${ISOROOT}; fi
5b22b655 91 if [ ! -d ${NRLOBJDIR}/nrelease ]; then mkdir -p ${NRLOBJDIR}/nrelease; fi
6ca9a59c 92 ( cd ${.CURDIR}/..; make DESTDIR=${ISOROOT} installworld )
ab64cf06
SS
93 ( cd ${.CURDIR}/../etc; MAKEOBJDIRPREFIX=${NRLOBJDIR}/nrelease \
94 make -m ${.CURDIR}/../share/mk DESTDIR=${ISOROOT} distribution )
21aa02d0 95 cpdup ${ISOROOT}/etc ${ISOROOT}/etc.hdd
6ca9a59c
MD
96 ( cd ${.CURDIR}/..; make DESTDIR=${ISOROOT} \
97 installkernel KERNCONF=${KERNCONF} )
c5c5e6fc 98 ln -s kernel ${ISOROOT}/kernel.BOOTP
6ca9a59c
MD
99 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.local.dist -p ${ISOROOT}/usr/local/
100 mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.var.dist -p ${ISOROOT}/var
101 dev_mkdb -f ${ISOROOT}/var/run/dev.db ${ISOROOT}/dev
8188de86
MD
102
103customizeiso:
104.for ROOTSKEL in ${ROOTSKELS}
105 cpdup -X cpignore -o ${ROOTSKEL} ${ISOROOT}
106.endfor
107 rm -rf `find ${ISOROOT} -type d -name CVS -print`
21aa02d0 108 rm -rf ${ISOROOT}/usr/local/share/pristine
7249926b 109 pwd_mkdb -p -d ${ISOROOT}/etc ${ISOROOT}/etc/master.passwd
4fba3387
CP
110.for UPGRADE_ITEM in Makefile \
111 etc.${MACHINE_ARCH} \
112 isdn/Makefile \
113 rc.d/Makefile \
114 periodic/Makefile \
115 periodic/daily/Makefile \
116 periodic/security/Makefile \
117 periodic/weekly/Makefile \
118 periodic/monthly/Makefile
119 cp -R ${.CURDIR}/../etc/${UPGRADE_ITEM} ${ISOROOT}/etc/${UPGRADE_ITEM}
120.endfor
cc224c64
JS
121 cd ${ISOROOT} && ${TAR} xzf ${PKGSRC_BOOTSTRAP_FILE}
122.for pkg in ${PKGSRC_PACKAGES}
123 ${ENV} PKG_PATH=${PKGSRC_PKG_PATH} ${PKGSRC_PKG_ADD} -I -K ${ISOROOT}${PKGSRC_DB} -p ${ISOROOT}${PKGSRC_PREFIX} ${pkg}
8188de86 124.endfor
6ca9a59c 125
8398ca17
SW
126mklocatedb:
127 ( find -s ${ISOROOT} -path ${ISOROOT}/tmp -or \
128 -path ${ISOROOT}/usr/tmp -or -path ${ISOROOT}/var/tmp \
129 -prune -o -print | sed -e 's#^${ISOROOT}##g' | \
130 /usr/libexec/locate.mklocatedb \
131 -presort >${ISOROOT}/var/db/locate.database )
132
6ca9a59c
MD
133mkiso:
134 ( cd ${ISOROOT}; mkisofs -b boot/cdboot -no-emul-boot \
382f1ee3 135 -R -J -V DragonFly -o ${ISOFILE} . )
6ca9a59c
MD
136
137clean:
138 if [ -d ${ISOROOT} ]; then chflags -R noschg ${ISOROOT}; fi
8188de86 139 if [ -d ${ISOROOT} ]; then rm -rf ${ISOROOT}/*; fi
5b22b655 140 if [ -d ${NRLOBJDIR}/nrelease ]; then rm -rf ${NRLOBJDIR}/nrelease; fi
6ca9a59c
MD
141
142realclean: clean
3ebedc5e 143 rm -rf ${OBJSYS}/${KERNCONF}
6ca9a59c 144
cc224c64
JS
145fetch:
146 mkdir -p ${PKGSRC_PKG_PATH}
147 ${RSYNC_CMD} ${PKGSRC_RSYNC_SRC} ${PKGSRC_PKG_PATH}
148
149.PHONY: all release installer_release quickrel installer_quickrel realquickrel
150.PHONY: installer_realquickrel check buildworld1 buildworld2
151.PHONY: buildkernel1 buildkernel2 buildiso customizeiso mklocatedb mkiso
d5c58845 152.PHONY: clean realclean fetch
cc224c64 153
6ca9a59c 154.include <bsd.prog.mk>