summaryrefslogtreecommitdiff
path: root/mk/subst.mk
diff options
context:
space:
mode:
authoruebayasi <uebayasi@pkgsrc.org>2004-03-01 09:57:10 +0000
committeruebayasi <uebayasi@pkgsrc.org>2004-03-01 09:57:10 +0000
commit560987a2c516af0ca7f283e4d64dd22bcedacce0 (patch)
tree26c66374823f5e37e922899332bddd77e4533ca7 /mk/subst.mk
parenta2711fedacda22db07ff43708ce1ee8121cd2ae2 (diff)
downloadpkgsrc-560987a2c516af0ca7f283e4d64dd22bcedacce0.tar.gz
* Document SUBST_CLASSES.
* Indent conditionals. Reviewed By: wiz
Diffstat (limited to 'mk/subst.mk')
-rw-r--r--mk/subst.mk22
1 files changed, 13 insertions, 9 deletions
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-<class> 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-<class> 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.<class>
# "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: