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