]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - share/i18n/esdb/Makefile.part
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / share / i18n / esdb / Makefile.part
1 # $FreeBSD$
2 # $NetBSD: Makefile.part,v 1.6 2008/10/25 22:35:36 apb Exp $
3
4 MKESDB?= ${.OBJDIR}/../../../../usr.bin/mkesdb_static/mkesdb_static
5
6 PARTFILE?= ${.CURDIR}/${CODE}.part
7 ALIASFILE?= ${.CURDIR}/${CODE}.alias
8 .if !defined(NO_SEP)
9 SEP?=   -
10 .endif
11 .if exists(${PARTFILE})
12 PART!=  sed '/^\#/d;/^ *$$/d' ${PARTFILE}
13 .endif
14 .if !defined(NO_EPREFIX)
15 CODESETS?= ${PART:C/^/${CODE}${SEP}/}
16 EPREFIX?= ${CODE}${SEP}
17 .else
18 CODESETS?= ${PART}
19 EPREFIX?=       
20 .endif
21 ESUBDIR?= ${CODE}
22 ESDB?=  ${CODESETS:C/$/.esdb/:S/:/@/}
23
24 FILES+= ${ESDB}
25 FILESDIR= ${ESDBDIR}/${ESUBDIR}
26
27 .SUFFIXES: .src .esdb
28
29 .src.esdb:
30         ${MKESDB} -o $@ $>
31
32 CLEANFILES+= ${ESDB} esdb.dir.${ESUBDIR} esdb.alias.${ESUBDIR}
33
34 # ----------------------------------------------------------------------
35 # esdb.dir
36 #
37 esdb.dir.${ESUBDIR}: ${PARTFILE}
38         echo "# ${CODE}" >${.TARGET}
39 .for i in ${PART}
40         printf "%-32s%s\n" "${EPREFIX}$i" \
41                 "${ESUBDIR}/${EPREFIX}${i:S/:/@/}.esdb" >>${.TARGET}
42 .endfor
43         echo >>${.TARGET}
44
45 # ----------------------------------------------------------------------
46 # esdb.alias
47 #
48 .for i in ${PART:S/:/@/}
49 ${CODE}_$i_aliases!= echo \
50         `sed \
51             '/^\#/d;/^ *$$/d;/^${i:S/@/:/}[     ]/!d;s/^[^      ]*[     ]*//' \
52                 ${ALIASFILE}`
53 .endfor
54 esdb.alias.${ESUBDIR}: ${PARTFILE} ${ALIASFILE}
55         echo "# ${CODE}" >${.TARGET}
56 .for i in ${PART:S/:/@/}
57 .for j in ${${CODE}_$i_aliases}
58         printf "%-32s%s\n" "$j" "${EPREFIX}${i:S/@/:/}" >>${.TARGET}
59 .endfor
60 .endfor
61         echo >>${.TARGET}
62
63 all: realall
64 realall: esdb.dir.${ESUBDIR} esdb.alias.${ESUBDIR} codesets
65 codesets: ${ESDB}
66
67 .if !defined(NO_PREPROC)
68 .for i in ${PART}
69 .if !exists(${EPREFIX}${i:S/:/@/}.src)
70 ${EPREFIX}${i:S/:/@/}.src: ${CODE}.src
71         sed ${SED_EXP:S@%%PART%%@${i}@} ${.CURDIR}/${CODE}.src > ${EPREFIX}${i:S/:/@/}.src
72         @echo ${EPREFIX}${i:S/:/@/}.src >>.tmpfiles
73 .endif
74 .endfor
75 .endif
76
77 .if exists(.tmpfiles)
78 TMPFILES!= cat .tmpfiles
79 CLEANFILES+= ${TMPFILES} .tmpfiles
80 .endif
81
82 .include "./Makefile.inc"
83 .include <bsd.prog.mk>