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