From 560987a2c516af0ca7f283e4d64dd22bcedacce0 Mon Sep 17 00:00:00 2001 From: uebayasi Date: Mon, 1 Mar 2004 09:57:10 +0000 Subject: * Document SUBST_CLASSES. * Indent conditionals. Reviewed By: wiz --- mk/subst.mk | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'mk/subst.mk') diff --git a/mk/subst.mk b/mk/subst.mk index 16072e134c8..8c4a348524d 100644 --- a/mk/subst.mk +++ b/mk/subst.mk @@ -1,11 +1,15 @@ -# $NetBSD: subst.mk,v 1.9 2003/12/29 02:55:22 kim Exp $ +# $NetBSD: subst.mk,v 1.10 2004/03/01 09:57:10 uebayasi Exp $ # -# This Makefile fragment implements a general text replacement facility -# for different classes of files in ${WRKSRC}. For each class of files, -# a target subst- is created to perform the text replacement. +# This Makefile fragment implements a general text replacement facility. +# Package makefiles define a ``class'', for each of which a paricular +# substitution description can be defined. For each class of files, a +# target subst- is created to perform the text replacement. # # The following variables are used: # +# SUBST_CLASSES +# A list of class names. A new class name must be appended (+=). +# # SUBST_STAGE. # "stage" at which we do the text replacement, e.g. pre-configure, # post-build, etc. @@ -33,11 +37,11 @@ _SUBST_IS_TEXT_FILE?= \ .for _class_ in ${SUBST_CLASSES} _SUBST_COOKIE.${_class_}= ${WRKDIR}/.subst_${_class_}_done -.if defined(SUBST_SED.${_class_}) && !empty(SUBST_SED.${_class_}) +. if defined(SUBST_SED.${_class_}) && !empty(SUBST_SED.${_class_}) SUBST_FILTER_CMD.${_class_}?= ${SED} ${SUBST_SED.${_class_}} -.else +. else SUBST_FILTER_CMD.${_class_}?= # empty -.endif +. endif SUBST_TARGETS+= subst-${_class_} _SUBST_TARGETS.${_class_}= subst-${_class_}-message @@ -55,10 +59,10 @@ subst-${_class_}: ${_SUBST_TARGETS.${_class_}} .PHONY: subst-${_class_}-message subst-${_class_}-message: -.if defined(SUBST_MESSAGE.${_class_}) +. if defined(SUBST_MESSAGE.${_class_}) ${_PKG_SILENT}${_PKG_DEBUG} \ ${ECHO_SUBST_MSG} "=> ${SUBST_MESSAGE.${_class_}}" -.endif +. endif .PHONY: subst-${_class_}-cookie subst-${_class_}-cookie: -- cgit v1.2.3