84d9c625bf
- Fix for possible unset uid/gid in toproto - Fix for default mtree style - Update libelf - Importing libexecinfo - Resynchronize GCC, mpc, gmp, mpfr - build.sh: Replace params with show-params. This has been done as the make target has been renamed in the same way, while a new target named params has been added. This new target generates a file containing all the parameters, instead of printing it on the console. - Update test48 with new etc/services (Fix by Ben Gras <ben@minix3.org) get getservbyport() out of the inner loop Change-Id: Ie6ad5226fa2621ff9f0dee8782ea48f9443d2091
56 lines
1.9 KiB
Text
56 lines
1.9 KiB
Text
# $NetBSD: Makefile.minirootkmod,v 1.1 2012/10/16 08:19:36 apb Exp $
|
|
#
|
|
# Makefile snippet to build a miniroot kernel module (e.g. miniroot.kmod)
|
|
#
|
|
# Required variables:
|
|
# NETBSDSRCDIR top level of src tree (set by <bsd.own.mk>)
|
|
#
|
|
# Optional variables:
|
|
# MINIROOT Basename of the kernel module to be created.
|
|
# ".kmod" will be appended to get the file name.
|
|
# [default: miniroot]
|
|
# RAMDISK Basename of the ramdisk to be embedded in the
|
|
# kernel module. This is used as both a directory
|
|
# name (${.CURDIR}/../ramdisks/${RAMDISK}) and
|
|
# as a file name within the .OBJDIR of that
|
|
# directory (${RAMDISK}.fs). [default: ramdisk]
|
|
#
|
|
|
|
MINIROOT?= miniroot
|
|
RAMDISK?= ramdisk
|
|
|
|
.include <bsd.own.mk>
|
|
.include "${.PARSEDIR}/Makefile.distrib"
|
|
|
|
MKMAN= no
|
|
PROG= ${MINIROOT}.kmod
|
|
|
|
# SRCMOD is a skeleton version of miniroot.kmod, without an embedded ramdisk.
|
|
# It should already have been created by "make install" in
|
|
# .../sys/modules/miniroot, and its name includes literal "miniroot",
|
|
# not variable ${MINIROOT}.
|
|
#
|
|
# DSTMOD is a copy of SRCMOD that is modified to include an embedded ramdisk.
|
|
# It will be created by rules in this Makefile.
|
|
#
|
|
# RAMDISKFS is the ramdisk image to be included inside DSTMOD. It should
|
|
# already have been created by the Makefile in RAMDISKSRCDIR.
|
|
#
|
|
SRCMOD= ${DESTDIR}/stand/${MACHINE}/${MODULEVER}/modules/miniroot/miniroot.kmod
|
|
DSTMOD= ${.OBJDIR}/${MINIROOT}.kmod
|
|
RAMDISKSRCDIR= ${.CURDIR}/../ramdisks/${RAMDISK}
|
|
RAMDISKOBJDIR!= cd ${RAMDISKSRCDIR} && ${PRINTOBJDIR}
|
|
RAMDISKFS= ${RAMDISKOBJDIR}/${RAMDISK}.fs
|
|
|
|
${MINIROOT}.kmod: ${RAMDISKFS} ${SRCMOD}
|
|
${OBJCOPY} --add-section miniroot=${RAMDISKFS} \
|
|
--set-section-flags miniroot=alloc,contents,load,data \
|
|
${SRCMOD} ${DSTMOD}.tmp
|
|
gzip -9nc < ${DSTMOD}.tmp > ${DSTMOD}
|
|
rm -f ${DSTMOD}.tmp
|
|
|
|
.include <bsd.prog.mk>
|
|
|
|
release: ${PROG}
|
|
${HOST_INSTALL_FILE} -m ${BINMODE} ${PROG} \
|
|
${RELEASEDIR}/${RELEASEMACHINEDIR}/installation/miniroot/
|