xref: /freebsd/kerberos5/lib/libasn1/Makefile (revision 56b17de1e8360fe131d425de20b5e75ff3ea897c)
1PACKAGE=	kerberos-lib
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
6LIBADD=	com_err roken
7VERSION_MAP=	${.CURDIR}/version.map
8
9SRCS=	asn1_err.c \
10	asn1_err.h \
11	der.c \
12	der_copy.c \
13	der_cmp.c \
14	der_free.c \
15	der_format.c \
16	der_get.c \
17	der_length.c \
18	der_put.c \
19	extra.c \
20	template.c \
21	timegm.c \
22	${GEN:S/.x$/.c/:S/.hx$/.h/}
23
24CFLAGS+=-I${KRB5DIR}/lib/asn1 -I${KRB5DIR}/lib/roken \
25	-I${SRCTOP}/contrib/com_err -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.ORDER: ${GEN_CMS}
60${GEN_CMS:[2..-1]}: .NOMETA
61${GEN_CMS}: cms.asn1 cms.opt
62	${ASN1_COMPILE} --one-code-file \
63		--option-file=${.ALLSRC:M*.opt} ${.ALLSRC:M*.asn1} cms_asn1
64
65.ORDER: ${GEN_RFC2459}
66${GEN_RFC2459:[2..-1]}: .NOMETA
67${GEN_RFC2459}: rfc2459.asn1
68	${ASN1_COMPILE} \
69		--one-code-file \
70		--preserve-binary=TBSCertificate \
71		--preserve-binary=TBSCRLCertList \
72		--preserve-binary=Name \
73		--sequence=GeneralNames \
74		--sequence=Extensions \
75		--sequence=CRLDistributionPoints ${.ALLSRC:M*.asn1} rfc2459_asn1
76
77.ORDER: ${GEN_K5}
78${GEN_K5:[2..-1]}: .NOMETA
79${GEN_K5}: krb5.asn1 krb5.opt
80	${ASN1_COMPILE} \
81		--one-code-file \
82		--option-file=${.ALLSRC:M*.opt} \
83		${.ALLSRC:M*.asn1} krb5_asn1
84
85.ORDER: ${GEN_PKINIT}
86${GEN_PKINIT:[2..-1]}: .NOMETA
87${GEN_PKINIT}: pkinit.asn1
88	${ASN1_COMPILE} --one-code-file \
89		${.ALLSRC:M*.asn1} pkinit_asn1
90
91.ORDER: ${GEN_PKCS8}
92${GEN_PKCS8:[2..-1]}: .NOMETA
93${GEN_PKCS8}: pkcs8.asn1
94	${ASN1_COMPILE} --one-code-file \
95		${.ALLSRC:M*.asn1} pkcs8_asn1
96
97.ORDER: ${GEN_PKCS9}
98${GEN_PKCS9:[2..-1]}: .NOMETA
99${GEN_PKCS9}: pkcs9.asn1
100	${ASN1_COMPILE} --one-code-file \
101		${.ALLSRC:M*.asn1} pkcs9_asn1
102
103.ORDER: ${GEN_PKCS12}
104${GEN_PKCS12:[2..-1]}: .NOMETA
105${GEN_PKCS12}: pkcs12.asn1
106	${ASN1_COMPILE} --one-code-file \
107		${.ALLSRC:M*.asn1} pkcs12_asn1
108
109.ORDER: ${GEN_DIGEST}
110${GEN_DIGEST:[2..-1]}: .NOMETA
111${GEN_DIGEST}: digest.asn1
112	${ASN1_COMPILE} --one-code-file \
113		${.ALLSRC:M*.asn1} digest_asn1
114
115.ORDER: ${GEN_KX509}
116${GEN_KX509:[2..-1]}: .NOMETA
117${GEN_KX509}: kx509.asn1
118	${ASN1_COMPILE} --one-code-file \
119		${.ALLSRC:M*.asn1} kx509_asn1
120
121.SUFFIXES: .h .c .x .hx
122
123.x.c:
124	${CP} ${.IMPSRC} ${.TARGET}
125
126.hx.h:
127	${CP} ${.IMPSRC} ${.TARGET}
128
129.include <bsd.lib.mk>
130
131.SUFFIXES: .h .c .x .hx
132
133.PATH: ${KRB5DIR}/lib/asn1
134