xref: /freebsd/kerberos5/lib/libasn1/Makefile (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1
2PACKAGE=	kerberos-lib
3
4LIB=	asn1
5LDFLAGS=	-Wl,--no-undefined
6INCS=	asn1_err.h asn1-common.h heim_asn1.h der.h der-protos.h der-private.h
7LIBADD=	com_err roken
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 \
26	-I${SRCTOP}/contrib/com_err -I.
27
28GEN_RFC2459=	asn1_rfc2459_asn1.x rfc2459_asn1.hx rfc2459_asn1-priv.hx
29GEN_CMS= 	asn1_cms_asn1.x cms_asn1.hx cms_asn1-priv.hx
30GEN_K5=		asn1_krb5_asn1.x krb5_asn1.hx krb5_asn1-priv.hx
31GEN_PKINIT= 	asn1_pkinit_asn1.x pkinit_asn1.hx pkinit_asn1-priv.hx
32GEN_PKCS8=	asn1_pkcs8_asn1.x pkcs8_asn1.hx pkcs8_asn1-priv.hx
33GEN_PKCS9=	asn1_pkcs9_asn1.x pkcs9_asn1.hx pkcs9_asn1-priv.hx
34GEN_PKCS12=	asn1_pkcs12_asn1.x pkcs12_asn1.hx pkcs12_asn1-priv.hx
35GEN_DIGEST=	asn1_digest_asn1.x digest_asn1.hx digest_asn1-priv.hx
36GEN_KX509=	asn1_kx509_asn1.x kx509_asn1.hx kx509_asn1-priv.hx
37
38GEN+=	${GEN_RFC2459}
39GEN+=	${GEN_CMS}
40GEN+=	${GEN_K5}
41GEN+=	${GEN_PKINIT}
42GEN+=	${GEN_PKCS8}
43GEN+=	${GEN_PKCS9}
44GEN+=	${GEN_PKCS12}
45GEN+=	${GEN_DIGEST}
46GEN+=	${GEN_KX509}
47
48CLEANFILES= ${GEN} ${GEN:S/.x$/.c/:S/.hx$/.h/} *_asn1_files
49
50INCS+=	krb5_asn1.h \
51	pkinit_asn1.h \
52	cms_asn1.h \
53	rfc2459_asn1.h \
54	pkcs8_asn1.h \
55	pkcs9_asn1.h \
56	pkcs12_asn1.h \
57	digest_asn1.h \
58	kx509_asn1.h
59
60.ORDER: ${GEN_CMS}
61${GEN_CMS:[2..-1]}: .NOMETA
62${GEN_CMS}: cms.asn1 cms.opt
63	${ASN1_COMPILE} --one-code-file \
64		--option-file=${.ALLSRC:M*.opt} ${.ALLSRC:M*.asn1} cms_asn1
65
66.ORDER: ${GEN_RFC2459}
67${GEN_RFC2459:[2..-1]}: .NOMETA
68${GEN_RFC2459}: rfc2459.asn1
69	${ASN1_COMPILE} \
70		--one-code-file \
71		--preserve-binary=TBSCertificate \
72		--preserve-binary=TBSCRLCertList \
73		--preserve-binary=Name \
74		--sequence=GeneralNames \
75		--sequence=Extensions \
76		--sequence=CRLDistributionPoints ${.ALLSRC:M*.asn1} rfc2459_asn1
77
78.ORDER: ${GEN_K5}
79${GEN_K5:[2..-1]}: .NOMETA
80${GEN_K5}: krb5.asn1 krb5.opt
81	${ASN1_COMPILE} \
82		--one-code-file \
83		--option-file=${.ALLSRC:M*.opt} \
84		${.ALLSRC:M*.asn1} krb5_asn1
85
86.ORDER: ${GEN_PKINIT}
87${GEN_PKINIT:[2..-1]}: .NOMETA
88${GEN_PKINIT}: pkinit.asn1
89	${ASN1_COMPILE} --one-code-file \
90		${.ALLSRC:M*.asn1} pkinit_asn1
91
92.ORDER: ${GEN_PKCS8}
93${GEN_PKCS8:[2..-1]}: .NOMETA
94${GEN_PKCS8}: pkcs8.asn1
95	${ASN1_COMPILE} --one-code-file \
96		${.ALLSRC:M*.asn1} pkcs8_asn1
97
98.ORDER: ${GEN_PKCS9}
99${GEN_PKCS9:[2..-1]}: .NOMETA
100${GEN_PKCS9}: pkcs9.asn1
101	${ASN1_COMPILE} --one-code-file \
102		${.ALLSRC:M*.asn1} pkcs9_asn1
103
104.ORDER: ${GEN_PKCS12}
105${GEN_PKCS12:[2..-1]}: .NOMETA
106${GEN_PKCS12}: pkcs12.asn1
107	${ASN1_COMPILE} --one-code-file \
108		${.ALLSRC:M*.asn1} pkcs12_asn1
109
110.ORDER: ${GEN_DIGEST}
111${GEN_DIGEST:[2..-1]}: .NOMETA
112${GEN_DIGEST}: digest.asn1
113	${ASN1_COMPILE} --one-code-file \
114		${.ALLSRC:M*.asn1} digest_asn1
115
116.ORDER: ${GEN_KX509}
117${GEN_KX509:[2..-1]}: .NOMETA
118${GEN_KX509}: kx509.asn1
119	${ASN1_COMPILE} --one-code-file \
120		${.ALLSRC:M*.asn1} kx509_asn1
121
122.SUFFIXES: .h .c .x .hx
123
124.x.c:
125	${CP} ${.IMPSRC} ${.TARGET}
126
127.hx.h:
128	${CP} ${.IMPSRC} ${.TARGET}
129
130.include <bsd.lib.mk>
131
132.SUFFIXES: .h .c .x .hx
133
134.PATH: ${KRB5DIR}/lib/asn1
135