1 # $NetBSD: Makefile.rules.inc,v 1.7 2012/09/05 19:31:04 christos Exp $
3 SRCS+= ${HEIMSRCS:N*.et:N*.in:N*.asn1}
5 .for et_src in ${HEIMSRCS:M*.et}
6 CLEANFILES+= ${et_src:.et=.c} ${et_src:.et=.h}
7 DPSRCS+= ${et_src:.et=.c} ${et_src:.et=.h}
8 COMPILE_ET_INCS+= ${et_src:.et=.h}
9 OBJS+= ${et_src:.et=.o}
11 ${et_src:.et=.c} ${et_src:.et=.h}: ${et_src} ${TOOL_COMPILE_ET}
12 ${TOOL_COMPILE_ET} ${.ALLSRC:[1]}
16 .for src in ${HEIMSRCS:M*.asn1}
17 ASN1_FILES.${src} ?= asn1_${src:.asn1=_asn1.x}
19 .if ${ASN1_FILES.${src}:[\#]} == 1
20 ASN1_OPTS.${src} ?= --one-code-file
24 ${src:.asn1=_asn1_files} \
25 ${src:.asn1=_asn1-template.c} \
26 ${ASN1_FILES.${src}} \
27 ${ASN1_FILES.${src}:.x=.c} \
28 ${src:.asn1=_asn1.h} \
29 ${src:.asn1=_asn1.hx} \
30 ${src:.asn1=_asn1-priv.h} \
31 ${src:.asn1=_asn1-priv.hx} \
34 ASN1_INCS += ${src:.asn1=_asn1.h}
36 DPSRCS += ${src:.asn1=_asn1.h} ${src:.asn1=_asn1-priv.h}
37 OBJS += ${ASN1_FILES.${src}:.x=.o}
39 ${ASN1_FILES.${src}} ${src:.asn1=_asn1.h} ${src:.asn1=_asn1-priv.h}: \
42 .if exists(${src:.asn1=.opt})
43 ${src:.asn1=.ts}: ${src} ${src:.asn1=.opt} ${TOOL_ASN1_COMPILE}
45 ${TOOL_ASN1_COMPILE} \
47 --option-file=${.ALLSRC:[2]} \
48 ${.ALLSRC:[1]} ${src:.asn1=_asn1}
50 -e 's,#include <(.*)_asn1\.h>,#include <krb5/\1_asn1.h>,' \
51 2> /dev/null < ${src:.asn1=_asn1.hx} > ${src:.asn1=_asn1.h}
52 @cmp -s ${src:.asn1=_asn1-priv.hx} ${src:.asn1=_asn1-priv.h} \
54 cp ${src:.asn1=_asn1-priv.hx} ${src:.asn1=_asn1-priv.h}
56 ${src:.asn1=.ts}: ${src} ${TOOL_ASN1_COMPILE}
58 ${TOOL_ASN1_COMPILE} \
60 ${.ALLSRC:[1]} ${src:.asn1=_asn1}
62 -e 's,#include <(.*)_asn1\.h>,#include <krb5/\1_asn1.h>,' \
63 2> /dev/null < ${src:.asn1=_asn1.hx} > ${src:.asn1=_asn1.h}
64 @cmp -s ${src:.asn1=_asn1-priv.hx} ${src:.asn1=_asn1-priv.h} \
66 cp ${src:.asn1=_asn1-priv.hx} ${src:.asn1=_asn1-priv.h}
69 .if ${MKREPRO:Uno} == "yes"
70 NORMALIZE_SRC=-e "s@${NETBSDSRCDIR}@/usr/src@g"
73 .for x2c in ${ASN1_FILES.${src}}
75 @${TOOL_SED} ${NORMALIZE_SRC} < ${x2c} > ${x2c}.r
76 @cmp -s ${x2c}.r ${x2c:.x=.c} 2> /dev/null || cp ${x2c}.r ${x2c:.x=.c}
85 .for slc_src in ${HEIMSRCS:M*.in}
86 CLEANFILES+= ${slc_src:.in=.c} ${slc_src:.in=.h}
87 DPSRCS+= ${slc_src:.in=.c} ${slc_src:.in=.h}
88 OBJS+= ${slc_src:.in=.o}
89 SLC_INCS+= ${slc_src:.in=.h}
91 ${slc_src:.in=.c} ${slc_src:.in=.h}: ${slc_src}
92 ${TOOL_SLC} ${.ALLSRC}
97 # And a tiny bit of logic for bsd.prog.mk:
99 .if defined(PROG) && defined(OBJS)
100 OBJS.${PROG} += ${OBJS}
103 .if defined(LIB) && exists(version-script.map) && !defined(NO_VERSION_SCRIPT)
106 LDFLAGS.lib${LIB} += -Wl,--version-script=${version-script.map:P}