1# $NetBSD: Makefile,v 1.3 2018/05/01 19:59:42 christos Exp $
2
3.include <bsd.hostinit.mk>
4.include <${.CURDIR}/../../../Makefile.inc>
5
6.PATH:	${HEIMDIST}/lib/asn1	\
7	${HEIMDIST}/lib/roken	\
8	${HEIMDIST}/lib/vers
9
10PROG=		asn1_compile
11
12.if ${USETOOLS} != "yes"
13LDADD+= -lutil
14DPADD+= ${LIBUTIL}
15.endif
16
17WARNS?=		1
18
19asn1_compile_SRCS = 				\
20	gen.c					\
21	gen_copy.c				\
22	gen_decode.c				\
23	gen_encode.c				\
24	gen_free.c				\
25	gen_glue.c				\
26	gen_length.c				\
27	gen_seq.c				\
28	gen_template.c				\
29	hash.c					\
30	lex.l					\
31	main.c					\
32	asn1parse.y				\
33	symbol.c
34
35roken_SRCS =					\
36	getarg.c				\
37	print_version.c				\
38	warnerr.c				\
39	strupr.c				\
40	get_window_size.c			\
41	ecalloc.c				\
42	emalloc.c				\
43	estrdup.c				\
44	rand.c
45
46SRCS=	$(asn1_compile_SRCS)			\
47	$(roken_SRCS)
48
49YHEADER=	# defined
50
51HOST_CPPFLAGS+= -I.			\
52	 -I${HEIMBASE}/include		\
53	 -I${HEIMBASE}/include/krb5	\
54	 -I${HEIMBASE}/lib/libkrb5	\
55	 -I${HEIMDIST}/lib/asn1		\
56	 -I${HEIMDIST}/lib/roken	\
57	 -DKRB5=1			\
58	 -DHAVE_CONFIG_H
59
60DPSRCS=		print_version.h
61
62make-print-version.lo: ${HEIMBASE}/include/version.h
63
64make-print-version: make-print-version.lo
65	${HOST_CC} ${HOST_LDFLAGS} -o ${.TARGET} ${.ALLSRC}
66
67print_version.h: make-print-version
68	./make-print-version print_version.h
69
70.NOPATH: print_version.h make-print-version
71
72CLEANFILES+=	print_version.h make-print-version make-print-version.lo
73
74beforedepend:
75	[ -h krb5 ] || ln -sf . krb5
76	ln -sf ${HEIMBASE}/include/der-protos.h
77	ln -sf ${HEIMBASE}/include/roken.h
78	ln -sf ${HEIMBASE}/include/krb5-types.h
79	ln -sf ${HEIMBASE}/dist/lib/asn1/der.h
80	ln -sf ${HEIMBASE}/dist/lib/roken/roken-common.h
81	ln -sf ${HEIMBASE}/dist/lib/roken/getarg.h
82	ln -sf ${HEIMBASE}/dist/lib/asn1/asn1-common.h
83
84CLEANFILES+=    krb5 der-protos.h roken.h krb5-types.h der.h	\
85		roken-common.h getarg.h asn1-common.h
86
87# HOSTPROG will be set already if this is a src/tools build.
88.ifndef HOSTPROG
89HOSTPROG=	${PROG}
90.include <bsd.hostprog.mk>
91.endif
92