1219019Sgabor# $FreeBSD: releng/10.2/share/i18n/esdb/Makefile.part 219019 2011-02-25 00:04:39Z gabor $
2219019Sgabor# $NetBSD: Makefile.part,v 1.6 2008/10/25 22:35:36 apb Exp $
3219019Sgabor
4219019SgaborMKESDB?= ${.OBJDIR}/../../../../usr.bin/mkesdb_static/mkesdb_static
5219019Sgabor
6219019SgaborPARTFILE?= ${.CURDIR}/${CODE}.part
7219019SgaborALIASFILE?= ${.CURDIR}/${CODE}.alias
8219019Sgabor.if !defined(NO_SEP)
9219019SgaborSEP?=	-
10219019Sgabor.endif
11219019Sgabor.if exists(${PARTFILE})
12219019SgaborPART!=	sed '/^\#/d;/^ *$$/d' ${PARTFILE}
13219019Sgabor.endif
14219019Sgabor.if !defined(NO_EPREFIX)
15219019SgaborCODESETS?= ${PART:C/^/${CODE}${SEP}/}
16219019SgaborEPREFIX?= ${CODE}${SEP}
17219019Sgabor.else
18219019SgaborCODESETS?= ${PART}
19219019SgaborEPREFIX?=	
20219019Sgabor.endif
21219019SgaborESUBDIR?= ${CODE}
22219019SgaborESDB?=	${CODESETS:C/$/.esdb/:S/:/@/}
23219019Sgabor
24219019SgaborFILES+=	${ESDB}
25219019SgaborFILESDIR= ${ESDBDIR}/${ESUBDIR}
26219019Sgabor
27219019Sgabor.SUFFIXES: .src .esdb
28219019Sgabor
29219019Sgabor.src.esdb:
30219019Sgabor	${MKESDB} -o $@ $>
31219019Sgabor
32219019SgaborCLEANFILES+= ${ESDB} esdb.dir.${ESUBDIR} esdb.alias.${ESUBDIR}
33219019Sgabor
34219019Sgabor# ----------------------------------------------------------------------
35219019Sgabor# esdb.dir
36219019Sgabor#
37219019Sgaboresdb.dir.${ESUBDIR}: ${PARTFILE}
38219019Sgabor	echo "# ${CODE}" >${.TARGET}
39219019Sgabor.for i in ${PART}
40219019Sgabor	printf "%-32s%s\n" "${EPREFIX}$i" \
41219019Sgabor		"${ESUBDIR}/${EPREFIX}${i:S/:/@/}.esdb" >>${.TARGET}
42219019Sgabor.endfor
43219019Sgabor	echo >>${.TARGET}
44219019Sgabor
45219019Sgabor# ----------------------------------------------------------------------
46219019Sgabor# esdb.alias
47219019Sgabor#
48219019Sgabor.for i in ${PART:S/:/@/}
49219019Sgabor${CODE}_$i_aliases!= echo \
50219019Sgabor	`sed \
51219019Sgabor	    '/^\#/d;/^ *$$/d;/^${i:S/@/:/}[ 	]/!d;s/^[^ 	]*[ 	]*//' \
52219019Sgabor		${ALIASFILE}`
53219019Sgabor.endfor
54219019Sgaboresdb.alias.${ESUBDIR}: ${PARTFILE} ${ALIASFILE}
55219019Sgabor	echo "# ${CODE}" >${.TARGET}
56219019Sgabor.for i in ${PART:S/:/@/}
57219019Sgabor.for j in ${${CODE}_$i_aliases}
58219019Sgabor	printf "%-32s%s\n" "$j" "${EPREFIX}${i:S/@/:/}" >>${.TARGET}
59219019Sgabor.endfor
60219019Sgabor.endfor
61219019Sgabor	echo >>${.TARGET}
62219019Sgabor
63219019Sgaborall: realall
64219019Sgaborrealall: esdb.dir.${ESUBDIR} esdb.alias.${ESUBDIR} codesets
65219019Sgaborcodesets: ${ESDB}
66219019Sgabor
67219019Sgabor.if !defined(NO_PREPROC)
68219019Sgabor.for i in ${PART}
69219019Sgabor.if !exists(${EPREFIX}${i:S/:/@/}.src)
70219019Sgabor${EPREFIX}${i:S/:/@/}.src: ${CODE}.src
71219019Sgabor	sed ${SED_EXP:S@%%PART%%@${i}@} ${.CURDIR}/${CODE}.src > ${EPREFIX}${i:S/:/@/}.src
72219019Sgabor	@echo ${EPREFIX}${i:S/:/@/}.src >>.tmpfiles
73219019Sgabor.endif
74219019Sgabor.endfor
75219019Sgabor.endif
76219019Sgabor
77219019Sgabor.if exists(.tmpfiles)
78219019SgaborTMPFILES!= cat .tmpfiles
79219019SgaborCLEANFILES+= ${TMPFILES} .tmpfiles
80219019Sgabor.endif
81219019Sgabor
82219019Sgabor.include "./Makefile.inc"
83219019Sgabor.include <bsd.prog.mk>
84