From e95152039ccd64a9880b8dcd84fc2a4b2d1d24a9 Mon Sep 17 00:00:00 2001 From: jlam Date: Thu, 8 Jun 2006 15:47:10 +0000 Subject: If the install cookie file exists, then we don't need to do anything. Also, move the interactive check into a separate target as a prelude to removing the recursive make for invoking "real-install". --- mk/install/install.mk | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'mk/install') diff --git a/mk/install/install.mk b/mk/install/install.mk index 98ecd828404..8b37216333c 100644 --- a/mk/install/install.mk +++ b/mk/install/install.mk @@ -1,4 +1,4 @@ -# $NetBSD: install.mk,v 1.4 2006/06/07 10:04:04 tron Exp $ +# $NetBSD: install.mk,v 1.5 2006/06/08 15:47:10 jlam Exp $ ###################################################################### ### install (PUBLIC) @@ -20,14 +20,12 @@ install: ${_INSTALL_TARGETS} acquire-install-lock: acquire-lock release-install-lock: release-lock -${_INSTALL_COOKIE}: -.if !empty(INTERACTIVE_STAGE:Minstall) && defined(BATCH) - @${ERROR_MSG} "The installation stage of this package requires user interaction" - @${ERROR_MSG} "Please install manually with \"cd ${.CURDIR} && ${MAKE} install\"" - @${TOUCH} ${_INTERACTIVE_COOKIE} - @${FALSE} -.else +.if !exists(${_INSTALL_COOKIE}) +${_INSTALL_COOKIE}: install-check-interactive ${_PKG_SILENT}${_PKG_DEBUG}cd ${.CURDIR} && ${MAKE} ${MAKEFLAGS} real-install PKG_PHASE=install +.else +${_INSTALL_COOKIE}: + @${DO_NADA} .endif ###################################################################### @@ -50,6 +48,23 @@ real-install: ${_REAL_INSTALL_TARGETS} install-message: @${PHASE_MSG} "Installing for ${PKGNAME}" +###################################################################### +### install-check-interactive (PRIVATE) +###################################################################### +### install-check-interactive checks whether we must do an interactive +### install or not. +### +install-check-interactive: +.if !empty(INTERACTIVE_STAGE:Minstall) && defined(BATCH) + @${ERROR_MSG} "The installation stage of this package requires user interaction" + @${ERROR_MSG} "Please install manually with:" + @${ERROR_MSG} " \"cd ${.CURDIR} && ${MAKE} install\"" + @${TOUCH} ${_INTERACTIVE_COOKIE} + @${FALSE} +.else + @${DO_NADA} +.endif + ###################################################################### ### unprivileged-install-hook (PRIVATE, override, hook) ###################################################################### -- cgit v1.2.3