xref: /freebsd/share/i18n/csmapper/Makefile.part (revision 90aac0d83bc9645f51ef0c2aeae6f9c0540bb031)
1# $NetBSD: Makefile,v 1.13 2007/03/13 16:34:37 tnozaki Exp $
2
3ESUBDIR?= ${CODE}
4PARTFILE?= ${.CURDIR}/${CODE}.part
5.if exists(${PARTFILE})
6PART!=	sed '/^\#/d;/^$$/d;' ${PARTFILE}
7.endif
8TABLENAME?= ${CODE}-%%PART%%%UCS
9RTABLENAME?= UCS%${CODE}-%%PART%%
10
11ENCID?=	${CODE}%%PART%%
12ENCEXT?= .mps
13MAPPER?= mapper_std
14REVSYMBOL?=
15FILESDIR= ${CSMAPPERDIR}/${ESUBDIR}
16
17.SUFFIXES: .src .646 .mps
18
19.src.mps:
20	${MKCSMAPPER} -o ${.TARGET} ${.IMPSRC}
21
22.if !target(mapper.dir.${ESUBDIR})
23.if !exists(mapper.dir.${ESUBDIR}.src)
24mapper.dir.${ESUBDIR}: ${CODE}.part
25	echo "# ${ESUBDIR}" > ${.TARGET}
26.for i in ${PART}
27	printf "%-32s%-32s%s\n" ${ENCID:S@%%PART%%@${i}@}/UCS ${MAPPER} \
28		${ESUBDIR}/${TABLENAME:S@%%PART%%@${i}@:S/:/@/}${ENCEXT} >> ${.TARGET}
29	printf "%-32s%-32s%s\n" UCS/${ENCID:S@%%PART%%@${i}@} ${MAPPER} \
30		${REVSYMBOL}${ESUBDIR}/${RTABLENAME:S@%%PART%%@${i}@:S/:/@/}${ENCEXT} >> ${.TARGET}
31.endfor
32	echo >> ${.TARGET}
33.else
34mapper.dir.${ESUBDIR}: mapper.dir.${ESUBDIR}.src
35	(echo "# ${ESUBDIR}" ; cat ${.ALLSRC} ; echo ) > ${.TARGET}
36.endif
37.endif
38CLEANFILES+=	mapper.dir.${ESUBDIR}
39
40.if !target(charset.pivot.${ESUBDIR})
41.if !exists(charset.pivot.${ESUBDIR}.src)
42charset.pivot.${ESUBDIR}: ${CODE}.part
43	echo "# ${ESUBDIR}" > ${.TARGET}
44.for i in ${PART}
45	printf "%-32s%-32s%d\n" ${ENCID:S@%%PART%%@${i}@} UCS 1 >> ${.TARGET}
46	printf "%-32s%-32s%d\n" UCS ${ENCID:S@%%PART%%@${i}@} 1 >> ${.TARGET}
47.endfor
48	echo >> ${.TARGET}
49.else
50charset.pivot.${ESUBDIR}: charset.pivot.${ESUBDIR}.src
51	(echo "# ${ESUBDIR}" ; cat ${.ALLSRC} ; echo ) > ${.TARGET}
52.endif
53.endif
54CLEANFILES+= charset.pivot.${ESUBDIR}
55
56
57.if !defined(MAPS)
58.for i in ${PART}
59.if exists(${TABLENAME:S@%%PART%%@${i}@:S/:/@/}.src)
60FILES+=	${TABLENAME:S@%%PART%%@${i}@:S/:/@/}.mps
61CLEANFILES+= ${TABLENAME:S@%%PART%%@${i}@:S/:/@/}.mps
62.endif
63.if exists(${RTABLENAME:S@%%PART%%@${i}@:S/:/@/}.src)
64FILES+=	${RTABLENAME:S@%%PART%%@${i}@:S/:/@/}.mps
65CLEANFILES+= ${RTABLENAME:S@%%PART%%@${i}@:S/:/@/}.mps
66.endif
67.endfor
68.else
69FILES+=	${MAPS}
70CLEANFILES+= ${MAPS}
71.endif
72
73.include "./Makefile.inc"
74.include <bsd.prog.mk>
75
76.if !defined(_SKIP_BUILD)
77all: mapper.dir.${ESUBDIR} charset.pivot.${ESUBDIR}
78.endif
79