2002-04-26 19:50:21 +04:00
|
|
|
# $NetBSD: Makefile.mdset,v 1.10 2002/04/26 15:50:27 lukem Exp $
|
2002-04-11 19:28:14 +04:00
|
|
|
#
|
|
|
|
# Makefile snippet to ${MDSETIMAGE} file system images into kernels
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Required variables:
|
2002-04-26 19:50:21 +04:00
|
|
|
# NETBSDSRCDIR Top level of src tree (set by <bsd.own.mk>)
|
2002-04-14 08:22:38 +04:00
|
|
|
# MDSETTARGETS List of images to ${MDSETIMAGE} into kernels,
|
|
|
|
# containing one or more tuples of the form:
|
2002-04-12 17:39:43 +04:00
|
|
|
# KERNEL IMAGE FILENAME
|
2002-04-14 08:22:38 +04:00
|
|
|
#
|
|
|
|
# The kernel is ${MDSETIMAGE} with ${IMAGE},
|
|
|
|
# ${STRIP}ped (with the symbols are stored in
|
|
|
|
# ${FILENAME}.symbols.gz), and gzipped into
|
|
|
|
# ${FILENAME}.gz.
|
|
|
|
#
|
2002-04-14 05:41:24 +04:00
|
|
|
# If FILENAME is "-", use "netbsd.${KERNEL}" as
|
|
|
|
# the target name.
|
2002-04-11 19:28:14 +04:00
|
|
|
#
|
|
|
|
# Optional variables:
|
2002-04-14 05:41:24 +04:00
|
|
|
# MDSETDIR Where to install release kernels.
|
2002-04-14 08:22:38 +04:00
|
|
|
#
|
2002-04-14 05:41:24 +04:00
|
|
|
# MDSET.${FILENAME}.post For each kernel named ${FILENAME},
|
|
|
|
# execute this after ${NM} / ${STRIP}.
|
|
|
|
# Kernel is available as netbsd.tmp.
|
|
|
|
# If MDSET.${FILENAME}.suffixes uses
|
|
|
|
# this to build extra kernels, the
|
|
|
|
# resultant file must be gzipped as
|
|
|
|
# "netbsd.${suffix}.gz"
|
2002-04-14 08:22:38 +04:00
|
|
|
#
|
2002-04-14 05:41:24 +04:00
|
|
|
# MDSET.${FILENAME}.suffixes List of extra install kernel suffixes.
|
|
|
|
# The extra kernels are usually created
|
|
|
|
# by MDSET.${FILENAME}.post.
|
2002-04-11 19:28:14 +04:00
|
|
|
#
|
2002-04-12 09:50:19 +04:00
|
|
|
# Variables modified by this:
|
2002-04-12 17:39:43 +04:00
|
|
|
# KERNELS List of kernel .gz files to build
|
2002-04-14 10:18:12 +04:00
|
|
|
# KERNELDEPS Dependency version of ${KERNELS} (with .WAIT)
|
2002-04-12 17:39:43 +04:00
|
|
|
# KERNELSYMS List of kernel .symbol files to build
|
|
|
|
# _KERNEL.${KERNEL} Target filename for ${KERNEL}
|
2002-04-12 09:50:19 +04:00
|
|
|
#
|
2002-04-11 19:28:14 +04:00
|
|
|
|
|
|
|
.include <bsd.kernobj.mk>
|
|
|
|
|
2002-04-14 05:41:24 +04:00
|
|
|
.for _K _I _F in ${MDSETTARGETS} # {
|
|
|
|
_FILENAME:=${_F} # work around obscure issue in make(1)
|
|
|
|
.if ${_FILENAME} == "-"
|
2002-04-12 17:39:43 +04:00
|
|
|
_KERNEL.${_K}:= netbsd.${_K}
|
|
|
|
.else
|
|
|
|
_KERNEL.${_K}:= ${_F}
|
|
|
|
.endif
|
2002-04-11 19:28:14 +04:00
|
|
|
|
2002-04-14 10:18:12 +04:00
|
|
|
KERNELS+= ${_KERNEL.${_K}}.gz
|
|
|
|
KERNELDEPS+= ${_KERNEL.${_K}}.gz .WAIT
|
2002-04-14 05:41:24 +04:00
|
|
|
.for suf in ${MDSET.${_FILENAME}.suffixes}
|
2002-04-25 01:03:42 +04:00
|
|
|
KERNELS+= ${_KERNEL.${_K}}.${suf}.gz
|
|
|
|
KERNELDEPS+= ${_KERNEL.${_K}}.${suf}.gz .WAIT
|
2002-04-14 05:41:24 +04:00
|
|
|
CLEANFILES+= netbsd.${suf} netbsd.${suf}.gz
|
2002-04-13 21:27:07 +04:00
|
|
|
.endfor
|
2002-04-12 17:39:43 +04:00
|
|
|
KERNELSYMS+= ${_KERNEL.${_K}}.symbols.gz
|
2002-04-11 19:28:14 +04:00
|
|
|
|
2002-04-14 05:41:24 +04:00
|
|
|
.if defined(MDSET.${_FILENAME}.post)
|
|
|
|
_POST.${_KERNEL.${_K}}:= ${MDSET.${_FILENAME}.post}
|
|
|
|
.endif
|
|
|
|
|
2002-04-12 17:39:43 +04:00
|
|
|
${_KERNEL.${_K}}.gz: .NOTMAIN ${KERNOBJDIR}/${_K}/netbsd ${_I}
|
2002-04-14 08:22:38 +04:00
|
|
|
@echo "mdsetimage: ${KERNOBJDIR}/${_K}/netbsd"
|
|
|
|
@echo " with: ${_I}"
|
|
|
|
@echo " into: ${.TARGET}"
|
2002-04-14 05:41:24 +04:00
|
|
|
@rm -f netbsd.tmp ${_KERNEL.${_K}}.symbols.gz
|
|
|
|
@cp ${KERNOBJDIR}/${_K}/netbsd netbsd.tmp
|
2002-04-12 17:39:43 +04:00
|
|
|
${MDSETIMAGE} -v netbsd.tmp ${_I}
|
|
|
|
${NM} netbsd.tmp | gzip -9 > ${_KERNEL.${_K}}.symbols.gz
|
2002-04-11 19:28:14 +04:00
|
|
|
${STRIP} netbsd.tmp
|
2002-04-14 05:41:24 +04:00
|
|
|
.if defined(_POST.${_KERNEL.${_K}})
|
|
|
|
${_POST.${_KERNEL.${_K}}}
|
2002-04-11 19:28:14 +04:00
|
|
|
.endif
|
2002-04-14 05:41:24 +04:00
|
|
|
@gzip -9f netbsd.tmp
|
2002-04-11 19:28:14 +04:00
|
|
|
mv netbsd.tmp.gz ${.TARGET}
|
|
|
|
|
2002-04-14 05:41:24 +04:00
|
|
|
.for suf in ${MDSET.${_FILENAME}.suffixes}
|
2002-04-13 21:27:07 +04:00
|
|
|
${_KERNEL.${_K}}.${suf}.gz: .NOTMAIN ${_KERNEL.${_K}}.gz
|
|
|
|
mv netbsd.${suf}.gz ${.TARGET}
|
|
|
|
.endfor
|
|
|
|
|
2002-04-11 19:28:14 +04:00
|
|
|
.endfor # }
|
|
|
|
|
|
|
|
CLEANFILES+= netbsd.tmp netbsd.tmp.gz ${KERNELS} ${KERNELSYMS}
|
|
|
|
|
2002-04-14 10:18:12 +04:00
|
|
|
realall: ${KERNELDEPS}
|
2002-04-11 19:28:14 +04:00
|
|
|
|
|
|
|
.if defined(MDSETDIR)
|
2002-04-14 10:18:12 +04:00
|
|
|
release: check_RELEASEDIR .WAIT ${KERNELDEPS}
|
2002-04-11 19:28:14 +04:00
|
|
|
-mkdir -p ${RELEASEDIR}/${MDSETDIR}
|
|
|
|
${RELINSTALL} ${KERNELS} ${KERNELSYMS} ${RELEASEDIR}/${MDSETDIR}
|
|
|
|
.endif
|