version 1.2, 2003/09/02 06:59:47 |
version 1.3, 2003/10/07 10:19:09 |
|
|
# |
# |
# SUBST_SED.<class> |
# SUBST_SED.<class> |
# sed(1) substitution expression to run on the specified files |
# sed(1) substitution expression to run on the specified files |
|
# |
|
# SUBST_FILTER_CMD.<class> |
|
# filter used to perform the actual substitution on the specified |
|
# files. Defaults to ${SED} ${SUBST_SED.<class>}. |
|
|
ECHO_SUBST_MSG?= ${ECHO} |
ECHO_SUBST_MSG?= ${ECHO} |
|
|
Line 29 _SUBST_IS_TEXT_FILE?= \ |
|
Line 33 _SUBST_IS_TEXT_FILE?= \ |
|
.for _class_ in ${SUBST_CLASSES} |
.for _class_ in ${SUBST_CLASSES} |
_SUBST_COOKIE.${_class_}= ${WRKDIR}/.subst_${_class_}_done |
_SUBST_COOKIE.${_class_}= ${WRKDIR}/.subst_${_class_}_done |
|
|
|
.if defined(SUBST_SED.${_class_}) && !empty(SUBST_SED.${_class_}) |
|
SUBST_FILTER_CMD.${_class_}?= ${SED} ${SUBST_SED.${_class_}} |
|
.else |
|
SUBST_FILTER_CMD.${_class_}?= # empty |
|
.endif |
|
|
SUBST_TARGETS+= subst-${_class_} |
SUBST_TARGETS+= subst-${_class_} |
_SUBST_TARGETS.${_class_}= subst-${_class_}-message |
_SUBST_TARGETS.${_class_}= subst-${_class_}-message |
_SUBST_TARGETS.${_class_}+= ${_SUBST_COOKIE.${_class_}} |
_SUBST_TARGETS.${_class_}+= ${_SUBST_COOKIE.${_class_}} |
Line 36 _SUBST_TARGETS.${_class_}+= subst-${_cla |
|
Line 46 _SUBST_TARGETS.${_class_}+= subst-${_cla |
|
|
|
.ORDER: ${_SUBST_TARGETS.${_class_}} |
.ORDER: ${_SUBST_TARGETS.${_class_}} |
|
|
.if defined(SUBST_STAGE.${_class_}) |
. if defined(SUBST_STAGE.${_class_}) |
${SUBST_STAGE.${_class_}}: subst-${_class_} |
${SUBST_STAGE.${_class_}}: subst-${_class_} |
.endif |
. endif |
|
|
.PHONY: subst-${_class_} |
.PHONY: subst-${_class_} |
subst-${_class_}: ${_SUBST_TARGETS.${_class_}} |
subst-${_class_}: ${_SUBST_TARGETS.${_class_}} |
Line 54 subst-${_class_}: ${_SUBST_TARGETS.${_cl |
|
Line 64 subst-${_class_}: ${_SUBST_TARGETS.${_cl |
|
${TOUCH} ${TOUCH_FLAGS} ${_SUBST_COOKIE.${_class_}} |
${TOUCH} ${TOUCH_FLAGS} ${_SUBST_COOKIE.${_class_}} |
|
|
${_SUBST_COOKIE.${_class_}}: |
${_SUBST_COOKIE.${_class_}}: |
. if !empty(SUBST_SED.${_class_}) |
. if !empty(SUBST_FILTER_CMD.${_class_}) |
${_PKG_SILENT}${_PKG_DEBUG} \ |
${_PKG_SILENT}${_PKG_DEBUG} \ |
cd ${WRKSRC}; \ |
cd ${WRKSRC}; \ |
files="${SUBST_FILES.${_class_}}"; \ |
files="${SUBST_FILES.${_class_}}"; \ |
Line 63 ${_SUBST_COOKIE.${_class_}}: |
|
Line 73 ${_SUBST_COOKIE.${_class_}}: |
|
*) for file in $${files}; do \ |
*) for file in $${files}; do \ |
if ${_SUBST_IS_TEXT_FILE}; then \ |
if ${_SUBST_IS_TEXT_FILE}; then \ |
${MV} -f $$file $$file.subst.sav; \ |
${MV} -f $$file $$file.subst.sav; \ |
${SED} ${SUBST_SED.${_class_}} \ |
${CAT} $$file.subst.sav \ |
$$file.subst.sav > $$file; \ |
| ${SUBST_FILTER_CMD.${_class_}} \ |
|
> $$file; \ |
if [ -x $$file.subst.sav ]; then \ |
if [ -x $$file.subst.sav ]; then \ |
${CHMOD} +x $$file; \ |
${CHMOD} +x $$file; \ |
fi; \ |
fi; \ |