xref: /freebsd/kerberos5/lib/libasn1/Makefile (revision 39ee7a7a6bdd1557b1c3532abf60d139798ac88b)
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}: cms.asn1 cms.opt
60	${ASN1_COMPILE} --one-code-file \
61		--option-file=${.ALLSRC:M*.opt} ${.ALLSRC:M*.asn1} cms_asn1
62
63.ORDER: ${GEN_RFC2459}
64${GEN_RFC2459}: rfc2459.asn1
65	${ASN1_COMPILE} \
66		--one-code-file \
67		--preserve-binary=TBSCertificate \
68		--preserve-binary=TBSCRLCertList \
69		--preserve-binary=Name \
70		--sequence=GeneralNames \
71		--sequence=Extensions \
72		--sequence=CRLDistributionPoints ${.ALLSRC:M*.asn1} rfc2459_asn1
73
74.ORDER: ${GEN_K5}
75${GEN_K5}: krb5.asn1 krb5.opt
76	${ASN1_COMPILE} \
77		--one-code-file \
78		--option-file=${.ALLSRC:M*.opt} \
79		${.ALLSRC:M*.asn1} krb5_asn1
80
81.ORDER: ${GEN_PKINIT}
82${GEN_PKINIT}: pkinit.asn1
83	${ASN1_COMPILE} --one-code-file \
84		${.ALLSRC:M*.asn1} pkinit_asn1
85
86.ORDER: ${GEN_PKCS8}
87${GEN_PKCS8}: pkcs8.asn1
88	${ASN1_COMPILE} --one-code-file \
89		${.ALLSRC:M*.asn1} pkcs8_asn1
90
91.ORDER: ${GEN_PKCS9}
92${GEN_PKCS9}: pkcs9.asn1
93	${ASN1_COMPILE} --one-code-file \
94		${.ALLSRC:M*.asn1} pkcs9_asn1
95
96.ORDER: ${GEN_PKCS12}
97${GEN_PKCS12}: pkcs12.asn1
98	${ASN1_COMPILE} --one-code-file \
99		${.ALLSRC:M*.asn1} pkcs12_asn1
100
101.ORDER: ${GEN_DIGEST}
102${GEN_DIGEST}: digest.asn1
103	${ASN1_COMPILE} --one-code-file \
104		${.ALLSRC:M*.asn1} digest_asn1
105
106.ORDER: ${GEN_KX509}
107${GEN_KX509}: kx509.asn1
108	${ASN1_COMPILE} --one-code-file \
109		${.ALLSRC:M*.asn1} kx509_asn1
110
111.SUFFIXES: .h .c .x .hx
112
113.x.c:
114	${CP} ${.IMPSRC} ${.TARGET}
115
116.hx.h:
117	${CP} ${.IMPSRC} ${.TARGET}
118
119# This makefile generates a lot of its headers
120# so tell bsd.sys.mk not to try and stage them before they are built.
121# Note: this is rare
122NO_BEFOREBUILD_INCLUDES=
123
124.include <bsd.lib.mk>
125
126.SUFFIXES: .h .c .x .hx
127
128.PATH: ${KRB5DIR}/lib/asn1
129