NetBSD/share/i18n/esdb/Makefile.part

54 lines
1.5 KiB
Makefile

# $NetBSD: Makefile.part,v 1.3 2003/10/21 10:01:21 lukem Exp $
.for code in ${CODE} # XXX: immediately expand ${CODE}
PARTFILE_${code}?= ${.CURDIR}/${code}/${code}.part
ALIASFILE_${code}?= ${.CURDIR}/${code}/${code}.alias
SEP_${code}?= -
SUBDIR_${code}?= ${code}
${code}_PART!= sed '/^\#/d;/^ *$$/d' ${PARTFILE_${code}}
CODESETS_${code}?= ${${code}_PART:C/^/${code}${SEP_${code}}/}
ESDB_${code}?= ${CODESETS_${code}:C/$/.esdb/:S/:/@/}
FILES+= ${ESDB_${code}}
CLEANFILES+= ${ESDB_${code}}
.for i in ${ESDB_${code}}
FILESDIR_$i?= ${BINDIR}/${SUBDIR_${code}}
.endfor
# ----------------------------------------------------------------------
# esdb.dir
#
esdb.dir.${code}: ${PARTFILE_${code}}
${_MKTARGET_CREATE}
echo "# ${code}" > $@
.for i in ${${code}_PART}
printf "%-32s%s\n" "${code}${SEP_${code}}$i" \
"${SUBDIR_${code}}/${code}${SEP_${code}}${i:S/:/@/}.esdb" >> $@
.endfor
echo >> $@
SRC_esdb.dir+= esdb.dir.${code}
CLEANFILES+= esdb.dir.${code}
# ----------------------------------------------------------------------
# esdb.alias
#
.for i in ${${code}_PART:S/:/@/}
${code}_$i_aliases!= \
sed '/^\#/d;/^ *$$/d;/^${i:S/@/:/}[ ]/!d;;s/^[^ ]*[ ]*//' \
${ALIASFILE_${code}}
.endfor
esdb.alias.${code}: ${PARTFILE_${code}} ${ALIASFILE_${code}}
${_MKTARGET_CREATE}
echo "# ${code}" > $@
.for i in ${${code}_PART:S/:/@/}
.for j in ${${code}_$i_aliases}
printf "%-32s%s\n" "$j" "${code}${SEP_${code}}${i:S/@/:/}" >> $@
.endfor
.endfor
echo >> $@
SRC_esdb.alias+=esdb.alias.${code}
CLEANFILES+= esdb.alias.${code}
.endfor # code