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