Add documentation for the pfil interface. This is NetBSD's rev. 1.24
[dragonfly.git] / nrelease / Makefile
... / ...
CommitLineData
1# $DragonFly: src/nrelease/Makefile,v 1.46 2005/12/11 18:36:14 dillon Exp $
2#
3
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
13ISODIR ?= /usr/release
14ISOFILE ?= ${ISODIR}/dfly.iso
15ISOROOT = ${ISODIR}/root
16OBJSYS= ${.OBJDIR}/../sys
17KERNCONF ?= GENERIC
18
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
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
37ROOTSKELS?= ${REQ_ROOTSKELS}
38
39.if defined(WITH_INSTALLER)
40PKGSRC_PACKAGES+= dfuibe_installer dfuife_curses
41ROOTSKELS+= installer
42.endif
43
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
49WORLD_CCVER ?= ${CCVER}
50KERNEL_CCVER ?= ${CCVER}
51
52#########################################################################
53# BASE ISO TARGETS #
54#########################################################################
55
56release: check clean buildworld1 buildkernel1 \
57 buildiso customizeiso mklocatedb mkiso
58
59quickrel: check clean buildworld2 buildkernel2 \
60 buildiso customizeiso mklocatedb mkiso
61
62realquickrel: check clean buildiso customizeiso mklocatedb mkiso
63
64check:
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} ]
71
72buildworld1:
73 ( cd ${.CURDIR}/..; CCVER=${WORLD_CCVER} make buildworld )
74
75buildworld2:
76 ( cd ${.CURDIR}/..; CCVER=${WORLD_CCVER} make quickworld )
77
78buildkernel1:
79 ( cd ${.CURDIR}/..; CCVER=${KERNEL_CCVER} make buildkernel KERNCONF=${KERNCONF} )
80
81buildkernel2:
82 ( cd ${.CURDIR}/..; CCVER=${KERNEL_CCVER} make quickkernel KERNCONF=${KERNCONF} )
83
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#
89buildiso:
90 if [ ! -d ${ISOROOT} ]; then mkdir -p ${ISOROOT}; fi
91 if [ ! -d ${NRLOBJDIR}/nrelease ]; then mkdir -p ${NRLOBJDIR}/nrelease; fi
92 ( cd ${.CURDIR}/..; make DESTDIR=${ISOROOT} installworld )
93 ( cd ${.CURDIR}/../etc; MAKEOBJDIRPREFIX=${NRLOBJDIR}/nrelease \
94 make -m ${.CURDIR}/../share/mk DESTDIR=${ISOROOT} distribution )
95 cpdup ${ISOROOT}/etc ${ISOROOT}/etc.hdd
96 ( cd ${.CURDIR}/..; make DESTDIR=${ISOROOT} \
97 installkernel KERNCONF=${KERNCONF} )
98 ln -s kernel ${ISOROOT}/kernel.BOOTP
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
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`
108 rm -rf ${ISOROOT}/usr/local/share/pristine
109 pwd_mkdb -p -d ${ISOROOT}/etc ${ISOROOT}/etc/master.passwd
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
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}
124.endfor
125
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
133mkiso:
134 ( cd ${ISOROOT}; mkisofs -b boot/cdboot -no-emul-boot \
135 -R -J -V DragonFly -o ${ISOFILE} . )
136
137clean:
138 if [ -d ${ISOROOT} ]; then chflags -R noschg ${ISOROOT}; fi
139 if [ -d ${ISOROOT} ]; then rm -rf ${ISOROOT}/*; fi
140 if [ -d ${NRLOBJDIR}/nrelease ]; then rm -rf ${NRLOBJDIR}/nrelease; fi
141
142realclean: clean
143 rm -rf ${OBJSYS}/${KERNCONF}
144
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
152.PHONY: clean realclean fetch
153
154.include <bsd.prog.mk>