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