xref: /freebsd/kerberos5/lib/libasn1/Makefile (revision ddd5b8e9b4d8957fce018c520657cdfa4ecffad3)
1# $FreeBSD$
2
3LIB=	asn1
4LDFLAGS=	-Wl,--no-undefined
5INCS=	asn1_err.h asn1-common.h heim_asn1.h der.h der-protos.h der-private.h
6LDADD=	-lcom_err -lroken
7DPADD=	${LIBCOM_ERR} ${LIBROKEN}
8VERSION_MAP=	${.CURDIR}/version.map
9
10SRCS=	asn1_err.c \
11	asn1_err.h \
12	der.c \
13	der_copy.c \
14	der_cmp.c \
15	der_free.c \
16	der_format.c \
17	der_get.c \
18	der_length.c \
19	der_put.c \
20	extra.c \
21	template.c \
22	timegm.c \
23	${GEN:S/.x$/.c/:S/.hx$/.h/}
24
25CFLAGS+=-I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken -I.
26
27GEN_RFC2459=	asn1_rfc2459_asn1.x rfc2459_asn1.hx rfc2459_asn1-priv.hx
28GEN_CMS= 	asn1_cms_asn1.x cms_asn1.hx cms_asn1-priv.hx
29GEN_K5=		asn1_krb5_asn1.x krb5_asn1.hx krb5_asn1-priv.hx
30GEN_PKINIT= 	asn1_pkinit_asn1.x pkinit_asn1.hx pkinit_asn1-priv.hx
31GEN_PKCS8=	asn1_pkcs8_asn1.x pkcs8_asn1.hx pkcs8_asn1-priv.hx
32GEN_PKCS9=	asn1_pkcs9_asn1.x pkcs9_asn1.hx pkcs9_asn1-priv.hx
33GEN_PKCS12=	asn1_pkcs12_asn1.x pkcs12_asn1.hx pkcs12_asn1-priv.hx
34GEN_DIGEST=	asn1_digest_asn1.x digest_asn1.hx digest_asn1-priv.hx
35GEN_KX509=	asn1_kx509_asn1.x kx509_asn1.hx kx509_asn1-priv.hx
36
37GEN+=	${GEN_RFC2459}
38GEN+=	${GEN_CMS}
39GEN+=	${GEN_K5}
40GEN+=	${GEN_PKINIT}
41GEN+=	${GEN_PKCS8}
42GEN+=	${GEN_PKCS9}
43GEN+=	${GEN_PKCS12}
44GEN+=	${GEN_DIGEST}
45GEN+=	${GEN_KX509}
46
47CLEANFILES= ${GEN} ${GEN:S/.x$/.c/:S/.hx$/.h/} *_asn1_files
48
49INCS+=	krb5_asn1.h \
50	pkinit_asn1.h \
51	cms_asn1.h \
52	rfc2459_asn1.h \
53	pkcs8_asn1.h \
54	pkcs9_asn1.h \
55	pkcs12_asn1.h \
56	digest_asn1.h \
57	kx509_asn1.h
58
59${GEN_CMS}: cms.asn1 cms.opt
60	${ASN1_COMPILE} --one-code-file \
61		--option-file=${.ALLSRC:M*.opt} ${.ALLSRC:M*.asn1} cms_asn1
62
63${GEN_RFC2459}: rfc2459.asn1
64	${ASN1_COMPILE} \
65		--one-code-file \
66		--preserve-binary=TBSCertificate \
67		--preserve-binary=TBSCRLCertList \
68		--preserve-binary=Name \
69		--sequence=GeneralNames \
70		--sequence=Extensions \
71		--sequence=CRLDistributionPoints ${.ALLSRC:M*.asn1} rfc2459_asn1
72
73${GEN_K5}: krb5.asn1 krb5.opt
74	${ASN1_COMPILE} \
75		--one-code-file \
76		--option-file=${.ALLSRC:M*.opt} \
77		${.ALLSRC:M*.asn1} krb5_asn1
78
79${GEN_PKINIT}: pkinit.asn1
80	${ASN1_COMPILE} --one-code-file \
81		${.ALLSRC:M*.asn1} pkinit_asn1
82
83${GEN_PKCS8}: pkcs8.asn1
84	${ASN1_COMPILE} --one-code-file \
85		${.ALLSRC:M*.asn1} pkcs8_asn1
86
87${GEN_PKCS9}: pkcs9.asn1
88	${ASN1_COMPILE} --one-code-file \
89		${.ALLSRC:M*.asn1} pkcs9_asn1
90
91${GEN_PKCS12}: pkcs12.asn1
92	${ASN1_COMPILE} --one-code-file \
93		${.ALLSRC:M*.asn1} pkcs12_asn1
94
95${GEN_DIGEST}: digest.asn1
96	${ASN1_COMPILE} --one-code-file \
97		${.ALLSRC:M*.asn1} digest_asn1
98
99${GEN_KX509}: kx509.asn1
100	${ASN1_COMPILE} --one-code-file \
101		${.ALLSRC:M*.asn1} kx509_asn1
102
103.SUFFIXES: .h .c .x .hx
104
105.x.c:
106	cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cp ${.IMPSRC} ${.TARGET}
107
108.hx.h:
109	cmp -s ${.IMPSRC} ${.TARGET} 2> /dev/null || cp ${.IMPSRC} ${.TARGET}
110
111.include <bsd.lib.mk>
112
113.SUFFIXES: .h .c .x .hx
114
115.PATH: ${KRB5DIR}/lib/asn1
116