1# Copyright (C) 2004-2012  Internet Systems Consortium, Inc. ("ISC")
2# Copyright (C) 1998-2003  Internet Software Consortium.
3#
4# Permission to use, copy, modify, and/or distribute this software for any
5# purpose with or without fee is hereby granted, provided that the above
6# copyright notice and this permission notice appear in all copies.
7#
8# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
11# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
13# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14# PERFORMANCE OF THIS SOFTWARE.
15
16# $Id$
17
18srcdir =	@srcdir@
19VPATH =		@srcdir@
20top_srcdir =	@top_srcdir@
21
22# Attempt to disable parallel processing.
23.NOTPARALLEL:
24.NO_PARALLEL:
25
26@BIND9_VERSION@
27
28@LIBDNS_API@
29
30@BIND9_MAKE_INCLUDES@
31
32USE_ISC_SPNEGO = @USE_ISC_SPNEGO@
33
34CINCLUDES =	-I. -Iinclude ${DNS_INCLUDES} \
35		${ISC_INCLUDES} @DST_OPENSSL_INC@ @DST_GSSAPI_INC@
36
37CDEFINES =	-DUSE_MD5 @USE_OPENSSL@ @USE_GSSAPI@ ${USE_ISC_SPNEGO}
38
39CWARNINGS =
40
41ISCLIBS =	../../lib/isc/libisc.@A@
42
43ISCDEPLIBS =	../../lib/isc/libisc.@A@
44
45LIBS =		@LIBS@
46
47# Alphabetically
48
49OPENSSLLINKOBJS = openssl_link.@O@ openssldh_link.@O@ openssldsa_link.@O@ \
50		  opensslgost_link.@O@ opensslrsa_link.@O@
51
52DSTOBJS =	@DST_EXTRA_OBJS@ @OPENSSLLINKOBJS@ \
53		dst_api.@O@ dst_lib.@O@ dst_parse.@O@ dst_result.@O@ \
54		gssapi_link.@O@ gssapictx.@O@ hmac_link.@O@ key.@O@ 
55
56# Alphabetically
57DNSOBJS =	acache.@O@ acl.@O@ adb.@O@ byaddr.@O@ \
58		cache.@O@ callbacks.@O@ compress.@O@ \
59		db.@O@ dbiterator.@O@ dbtable.@O@ diff.@O@ dispatch.@O@ \
60		dlz.@O@ dns64.@O@ dnssec.@O@ ds.@O@ forward.@O@ iptable.@O@ \
61		journal.@O@ keydata.@O@ keytable.@O@ \
62		lib.@O@ log.@O@ lookup.@O@ \
63		master.@O@ masterdump.@O@ message.@O@ \
64		name.@O@ ncache.@O@ nsec.@O@ nsec3.@O@ order.@O@ peer.@O@ \
65		portlist.@O@ private.@O@ \
66		rbt.@O@ rbtdb.@O@ rbtdb64.@O@ rcode.@O@ rdata.@O@ \
67		rdatalist.@O@ rdataset.@O@ rdatasetiter.@O@ rdataslab.@O@ \
68		request.@O@ resolver.@O@ result.@O@ rootns.@O@ rpz.@O@ \
69		rriterator.@O@ sdb.@O@ \
70		sdlz.@O@ soa.@O@ ssu.@O@ ssu_external.@O@ \
71		stats.@O@ tcpmsg.@O@ time.@O@ timer.@O@ tkey.@O@ \
72		tsec.@O@ tsig.@O@ ttl.@O@ validator.@O@ \
73		version.@O@ view.@O@ xfrin.@O@ zone.@O@ zonekey.@O@ zt.@O@
74
75OBJS=		${DNSOBJS} ${OTHEROBJS} ${DSTOBJS}
76
77# Alphabetically
78OPENSSLLINKSRCS = openssl_link.c openssldh_link.c openssldsa_link.c \
79		  opensslgost_link.c opensslrsa_link.c
80
81DSTSRCS =	@DST_EXTRA_SRCS@ @OPENSSLLINKSRCS@ \
82		dst_api.c dst_lib.c dst_parse.c \
83		dst_result.c gssapi_link.c gssapictx.c \
84		hmac_link.c key.c
85
86DNSSRCS =	acache.c acl.c adb.c byaddr.c \
87		cache.c callbacks.c compress.c \
88		db.c dbiterator.c dbtable.c diff.c dispatch.c \
89		dlz.c dns64.c dnssec.c ds.c forward.c iptable.c journal.c \
90		keydata.c keytable.c lib.c log.c lookup.c \
91		master.c masterdump.c message.c \
92		name.c ncache.c nsec.c nsec3.c order.c peer.c portlist.c \
93		rbt.c rbtdb.c rbtdb64.c rcode.c rdata.c rdatalist.c \
94		rdataset.c rdatasetiter.c rdataslab.c request.c \
95		resolver.c result.c rootns.c rpz.c rriterator.c \
96		sdb.c sdlz.c soa.c ssu.c ssu_external.c \
97		stats.c tcpmsg.c time.c timer.c tkey.c \
98		tsec.c tsig.c ttl.c validator.c \
99		version.c view.c xfrin.c zone.c zonekey.c zt.c ${OTHERSRCS}
100
101SRCS = ${DSTSRCS} ${DNSSRCS}
102
103SUBDIRS =	include
104TARGETS =	include/dns/enumtype.h include/dns/enumclass.h \
105		include/dns/rdatastruct.h timestamp
106TESTDIRS =	@UNITTESTS@
107
108DEPENDEXTRA =	./gen -F include/dns/rdatastruct.h \
109		-s ${srcdir} -d >> Makefile ;
110
111@BIND9_MAKE_RULES@
112
113version.@O@: version.c
114	${LIBTOOL_MODE_COMPILE} ${CC} ${ALL_CFLAGS} \
115		-DVERSION=\"${VERSION}\" \
116		-DLIBINTERFACE=${LIBINTERFACE} \
117		-DLIBREVISION=${LIBREVISION} \
118		-DLIBAGE=${LIBAGE} \
119		-c ${srcdir}/version.c
120
121libdns.@SA@: ${OBJS}
122	${AR} ${ARFLAGS} $@ ${OBJS}
123	${RANLIB} $@
124
125libdns.la: ${OBJS}
126	${LIBTOOL_MODE_LINK} \
127		${CC} ${ALL_CFLAGS} ${LDFLAGS} -o libdns.la -rpath ${libdir} \
128		-version-info ${LIBINTERFACE}:${LIBREVISION}:${LIBAGE} \
129		${OBJS} ${ISCLIBS} @DNS_CRYPTO_LIBS@ ${LIBS}
130
131timestamp: libdns.@A@
132	touch timestamp
133
134installdirs:
135	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${libdir}
136
137install:: timestamp installdirs
138	${LIBTOOL_MODE_INSTALL} ${INSTALL_DATA} libdns.@A@ ${DESTDIR}${libdir}
139
140clean distclean::
141	rm -f libdns.@A@ timestamp
142	rm -f gen code.h include/dns/enumtype.h include/dns/enumclass.h
143	rm -f include/dns/rdatastruct.h
144
145newrr::
146	rm -f code.h include/dns/enumtype.h include/dns/enumclass.h
147	rm -f include/dns/rdatastruct.h
148
149include: include/dns/enumtype.h include/dns/enumclass.h \
150	include/dns/rdatastruct.h
151
152rdata.@O@: code.h
153
154include/dns/enumtype.h: gen
155	./gen -s ${srcdir} -t > $@
156
157include/dns/enumclass.h: gen
158	./gen -s ${srcdir} -c > $@
159
160include/dns/rdatastruct.h: gen \
161		${srcdir}/rdata/rdatastructpre.h \
162		${srcdir}/rdata/rdatastructsuf.h
163	./gen -s ${srcdir} -i \
164		-P ${srcdir}/rdata/rdatastructpre.h \
165		-S ${srcdir}/rdata/rdatastructsuf.h > $@
166
167code.h:	gen
168	./gen -s ${srcdir} > code.h
169
170gen: gen.c
171	${BUILD_CC} ${BUILD_CFLAGS} -I${top_srcdir}/lib/isc/include \
172	${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} -o $@ ${srcdir}/gen.c ${BUILD_LIBS}
173
174rbtdb64.@O@: rbtdb.c
175
176depend: include/dns/enumtype.h include/dns/enumclass.h \
177	include/dns/rdatastruct.h code.h
178subdirs: include/dns/enumtype.h include/dns/enumclass.h \
179	include/dns/rdatastruct.h code.h
180${OBJS}: include/dns/enumtype.h include/dns/enumclass.h \
181	include/dns/rdatastruct.h
182
183spnego.@O@: spnego_asn1.c spnego.h
184