* Add new user-visible "syspkgs" target, and internal "makesyspkgs" and
"makesyspkgsums" targets for it to use internally. * Add internal "sanitize_METALOG" target that uses "${TOOL_MTREE} -C ..." to sanitise the METALOG file before invoking anything that will want to parse the METALOG (checkflist, regpkgset, maketars, or installsets). Previously, maketars used to do this itself, but its better to do it only once. * Add internal "checkflist_if_DESTDIR" target, which invokes checkflist iff DESTDIR is set and not empty. Use it where appropriate. * Add a few more host tools to SETSENV. * A few minor related changes. Reviewed by agc
This commit is contained in:
parent
2f132c6998
commit
5b62001b7b
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile,v 1.48 2005/10/07 20:00:54 jmc Exp $
|
||||
# $NetBSD: Makefile,v 1.49 2006/01/04 14:58:58 apb Exp $
|
||||
|
||||
# The `all' target must appear before bsd.own.mk is pulled in.
|
||||
all:
|
||||
@ -11,8 +11,14 @@ all:
|
||||
SETSCMD= cd ${.CURDIR} && \
|
||||
DESTDIR=${DESTDIR:Q} \
|
||||
MACHINE=${MACHINE:Q} MACHINE_ARCH=${MACHINE_ARCH:Q} \
|
||||
CKSUM=${TOOL_CKSUM:Q} MAKE=${MAKE:Q} MTREE=${TOOL_MTREE:Q} \
|
||||
MKTEMP=${TOOL_MKTEMP:Q} PAX=${TOOL_PAX:Q} HOST_SH=${HOST_SH:Q} \
|
||||
CKSUM=${TOOL_CKSUM:Q} \
|
||||
DB=${TOOL_DB:Q} \
|
||||
HOST_SH=${HOST_SH:Q} \
|
||||
MAKE=${MAKE:Q} \
|
||||
MKTEMP=${TOOL_MKTEMP:Q} \
|
||||
MTREE=${TOOL_MTREE:Q} \
|
||||
PAX=${TOOL_PAX:Q} \
|
||||
TSORT=${TSORT:Q} \
|
||||
${HOST_SH}
|
||||
|
||||
.if ${MKX11} != "no"
|
||||
@ -64,20 +70,38 @@ SOURCETARDIR= ${RELEASEDIR}/source/sets
|
||||
|
||||
.if ${MKUNPRIVED} == "no"
|
||||
METALOG.unpriv=
|
||||
METALOG.sanitised.unpriv=
|
||||
.else
|
||||
METALOG.unpriv= -M ${METALOG}
|
||||
METALOG.sanitised= ${METALOG}.sanitised
|
||||
METALOG.sanitised.unpriv= -M ${METALOG.sanitised}
|
||||
.endif
|
||||
|
||||
.if ${MKUNPRIVED} == "no"
|
||||
sanitise_METALOG: .PHONY
|
||||
@true
|
||||
.else
|
||||
sanitise_METALOG: .PHONY ${METALOG.sanitised}
|
||||
${METALOG.sanitised}: ${METALOG}
|
||||
${TOOL_MTREE} -C -k all -N ${NETBSDSRCDIR}/etc <${METALOG} >${.TARGET}
|
||||
.endif
|
||||
|
||||
checkflist: .PRECIOUS .PHONY check_DESTDIR
|
||||
${SETSCMD} ./checkflist \
|
||||
${MAKEFLIST_FLAGS} ${CHECKFLIST_FLAGS} ${METALOG.unpriv}
|
||||
.if defined(DESTDIR) && ${DESTDIR} != ""
|
||||
checkflist_if_DESTDIR: checkflist
|
||||
.else
|
||||
checkflist_if_DESTDIR:
|
||||
.endif
|
||||
|
||||
checkflist: .PRECIOUS .PHONY check_DESTDIR sanitise_METALOG
|
||||
${SETSCMD} ${.CURDIR}/checkflist \
|
||||
${MAKEFLIST_FLAGS} ${CHECKFLIST_FLAGS} ${METALOG.sanitised.unpriv}
|
||||
|
||||
checkflist-x11: .PHONY check_DESTDIR
|
||||
${SETSCMD} ./checkflist -x ${CHECKFLIST_FLAGS}
|
||||
|
||||
|
||||
maketars: .PRECIOUS .PHONY check_DESTDIR check_RELEASEDIR .WAIT \
|
||||
maketars: .PRECIOUS .PHONY check_DESTDIR check_RELEASEDIR \
|
||||
sanitise_METALOG checkflist_if_DESTDIR .WAIT \
|
||||
maketarsetup .WAIT ${MAKETARSETS:@.TARS.@do-${.TARS.}@}
|
||||
@true
|
||||
|
||||
@ -98,7 +122,8 @@ makesetfiles: .PHONY
|
||||
|
||||
.for tar in ${MAKETARSETS}
|
||||
do-${tar}: .PHONY
|
||||
${SETSCMD} ./maketars -d ${DESTDIR:S,^$,/,} ${METALOG.unpriv} \
|
||||
${SETSCMD} ./maketars -d ${DESTDIR:S,^$,/,} \
|
||||
${METALOG.sanitised.unpriv} \
|
||||
-N ${NETBSDSRCDIR}/etc -t ${TARDIR} ${tar} \
|
||||
|| rm -f ${TARDIR}/${tar}.tgz
|
||||
.endfor
|
||||
@ -126,20 +151,53 @@ do-sum-${tar}: .PHONY do-${tar}
|
||||
.ORDER: ${MAKETARSETS:@.TARS.@do-sum-${.TARS.}@}
|
||||
|
||||
|
||||
installsets: .PHONY check_DESTDIR
|
||||
installsets: .PHONY check_DESTDIR sanitise_METALOG
|
||||
.if !defined(INSTALLDIR)
|
||||
@echo "setenv INSTALLDIR before doing that!"
|
||||
@false
|
||||
.endif
|
||||
${SETSCMD} ./maketars -d ${DESTDIR:S,^$,/,} \
|
||||
${METALOG.unpriv} -N ${NETBSDSRCDIR}/etc ${MAKEFLIST_FLAGS} \
|
||||
-i ${INSTALLDIR} ${INSTALLSETS}
|
||||
${METALOG.sanitised.unpriv} -N ${NETBSDSRCDIR}/etc \
|
||||
${MAKEFLIST_FLAGS} -i ${INSTALLDIR} ${INSTALLSETS}
|
||||
|
||||
# Should we ignore errors like extra or missing files in the flists?
|
||||
SLOPPY_FLIST?= NO
|
||||
.if !empty(SLOPPY_FLIST:M[Yy][Ee][Ss])
|
||||
CHECKFLIST_FLAGS+= -e -m
|
||||
REGPKG.sloppy= -m
|
||||
.endif
|
||||
|
||||
.if ${MAKEVERBOSE} == 0
|
||||
REGPKG.verbose?= -q
|
||||
.elif ${MAKEVERBOSE} == 1
|
||||
REGPKG.verbose?=
|
||||
.else # MAKEVERBOSE == 2
|
||||
REGPKG.verbose?= -v
|
||||
.endif
|
||||
REGPKG.force?= # -f, or empty
|
||||
REGPKG.cache?= -c # -c, or empty
|
||||
REGPKG.update:= ${MKUPDATE:tl:Nno:C/..*/-u/}
|
||||
SYSPKGSETS?= all
|
||||
makesyspkgs: .PHONY check_DESTDIR check_RELEASEDIR \
|
||||
sanitise_METALOG checkflist_if_DESTDIR
|
||||
mkdir -p ${RELEASEDIR}/${MACHINE}/binary/syspkgs
|
||||
${SETSCMD} ${.CURDIR}/regpkgset \
|
||||
${REGPKG.verbose} ${REGPKG.force} ${REGPKG.sloppy} \
|
||||
${REGPKG.cache} ${REGPKG.update} \
|
||||
-d ${DESTDIR:S,^$,/,} ${METALOG.sanitised.unpriv} \
|
||||
-N ${NETBSDSRCDIR}/etc \
|
||||
-t ${RELEASEDIR}/${MACHINE}/binary/syspkgs ${SYSPKGSETS}
|
||||
|
||||
makesyspkgsums: .PHONY check_RELEASEDIR
|
||||
${MAKESUMS} -t ${RELEASEDIR}/${MACHINE}/binary/syspkgs
|
||||
|
||||
#
|
||||
# MAIN ENTRY POINTS
|
||||
#
|
||||
|
||||
syspkgs: .PHONY makesyspkgs .WAIT makesyspkgsums
|
||||
@true
|
||||
|
||||
sets: .PHONY maketars .WAIT makesums
|
||||
@true
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user