diff --git a/Makefile.in b/Makefile.in index a4c3cfeb..8d91511f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -41,7 +41,6 @@ bindir = @bindir@ docdir = @docdir@ srcdir = @srcdir@ -VPATH = @srcdir@ INSTALL = @INSTALL@ default: @@ -177,7 +176,7 @@ $(distdir): cp $(srcdir)/spec/*.tgz $(distdir)/spec cp $(srcdir)/spec/example/Makefile.in $(distdir)/spec/example cp $(srcdir)/spec/example/*.[ch] $(distdir)/spec/example - + rm -f $(distdir)/Makefile $(distdir)/src/Makefile $(distdir)/src/getdns/getdns.h $(distdir)/spec/example/Makefile $(distdir)/src/test/Makefile $(distdir)/doc/Makefile $(distdir)/src/config.h distcheck: $(distdir).tar.gz gzip -cd $(distdir).tar.gz | tar xvf - @@ -195,7 +194,7 @@ distcheck: $(distdir).tar.gz rm -rf $(distdir) @echo "*** Package $(distdir).tar.gz is ready for distribution" -Makefile: Makefile.in config.status +Makefile: $(srcdir)/Makefile.in config.status ./config.status $@ configure.status: configure diff --git a/spec/example/Makefile.in b/spec/example/Makefile.in index 4bf5935b..a117997b 100644 --- a/spec/example/Makefile.in +++ b/spec/example/Makefile.in @@ -37,18 +37,20 @@ bindir = @bindir@ LIBTOOL = ../../libtool srcdir = @srcdir@ -VPATH = @srcdir@ - -have_libevent = @have_libevent@ EXTENSION_LIBEVENT_EXT_LIBS=@EXTENSION_LIBEVENT_EXT_LIBS@ EXTENSION_LIBEVENT_LDFLAGS=@EXTENSION_LIBEVENT_LDFLAGS@ +EXTENSION_LIBEVENT_LIB=../../src/libgetdns_ext_event.la CC=@CC@ CFLAGS=@CFLAGS@ -Wall -I$(srcdir) -I$(srcdir)/../../src -I../../src -std=c99 LDFLAGS=@LDFLAGS@ -L../../src LDLIBS=-lgetdns @LIBS@ -PROGRAMS=example-all-functions example-simple-answers example-tree example-synchronous example-reverse + + +OBJS=example-all-functions.lo example-simple-answers.lo example-tree.lo example-synchronous.lo example-reverse.lo + +PROGRAMS=example-all-functions example-synchronous example-simple-answers example-tree example-reverse .SUFFIXES: .c .o .a .lo .h @@ -63,20 +65,33 @@ example: all all: $(PROGRAMS) +$(OBJS): + @: + $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $< -o $@ + example-all-functions: example-all-functions.lo $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ example-all-functions.lo -example-simple-answers: example-simple-answers.lo - $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -lgetdns_ext_event $(EXTENSION_LIBEVENT_LDFLAGS) $(EXTENSION_LIBEVENT_EXT_LIBS) $(LDLIBS) -o $@ example-simple-answers.lo - -example-tree: example-tree.lo - $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -lgetdns_ext_event $(EXTENSION_LIBEVENT_LDFLAGS) $(EXTENSION_LIBEVENT_EXT_LIBS) $(LDLIBS) -o $@ example-tree.lo - example-synchronous: example-synchronous.lo $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ example-synchronous.lo -example-reverse: example-reverse.lo - $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -lgetdns_ext_event $(EXTENSION_LIBEVENT_LDFLAGS) $(EXTENSION_LIBEVENT_EXT_LIBS) $(LDLIBS) -o $@ example-reverse.lo +$(EXTENSION_LIBEVENT_LIB): + @echo "***" + @echo "*** Three examples from the specification need libevent." + @echo "*** libevent was not found or usable at configure time." + @echo "*** To compile and run all examples from the spec, make sure" + @echo "*** libevent is available and usable during configuration." + @echo "***" + @false + +example-simple-answers: example-simple-answers.lo $(EXTENSION_LIBEVENT_LIB) + $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(EXTENSION_LIBEVENT_LIB) $(EXTENSION_LIBEVENT_LDFLAGS) $(EXTENSION_LIBEVENT_EXT_LIBS) $(LDLIBS) -o $@ example-simple-answers.lo + +example-tree: example-tree.lo $(EXTENSION_LIBEVENT_LIB) + $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(EXTENSION_LIBEVENT_LIB) $(EXTENSION_LIBEVENT_LDFLAGS) $(EXTENSION_LIBEVENT_EXT_LIBS) $(LDLIBS) -o $@ example-tree.lo + +example-reverse: example-reverse.lo $(EXTENSION_LIBEVENT_LIB) + $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(EXTENSION_LIBEVENT_LIB) $(EXTENSION_LIBEVENT_LDFLAGS) $(EXTENSION_LIBEVENT_EXT_LIBS) $(LDLIBS) -o $@ example-reverse.lo clean: rm -f *.o *.lo $(PROGRAMS) @@ -109,10 +124,40 @@ distcheck: $(distdir).tar.gz rm -rf $(distdir) @echo "*** Package $(distdir).tar.gz is ready for distribution" -Makefile: Makefile.in ../../config.status - cd ../.. && ./config.status $@ +Makefile: $(srcdir)/Makefile.in ../../config.status + cd ../.. && ./config.status spec/example/Makefile configure.status: configure cd ../.. && ./config.status --recheck .PHONY: clean + +depend: + (cd $(srcdir) ; awk 'BEGIN{P=1}{if(P)print}/^# Dependencies/{P=0}' Makefile.in > Makefile.in.new ) + (cd $(srcdir) ; gcc -MM -I. -I../../src *.c | \ + sed -e 's? \([a-z_-]*\)\.\([ch]\)? $$(srcdir)/\1.\2?g' \ + -e 's? \$$(srcdir)/config\.h? ../../src/config.h?g' \ + -e 's? \.\./\.\./src/getdns/getdns_extra\.h? $$(srcdir)/../../src/getdns/getdns_extra.h?g' \ + -e 's? \.\./\.\./src/getdns/getdns_ext_libevent\.h? $$(srcdir)/../../src/getdns/getdns_ext_libevent.h?g' \ + -e 's? \.\./\.\./src/getdns/getdns_ext_libev\.h? $$(srcdir)/../../src/getdns/getdns_ext_libev.h?g' \ + -e 's? \.\./\.\./src/getdns/getdns_ext_libuv\.h? $$(srcdir)/../../src/getdns/getdns_ext_libuv.h?g' \ + -e 's!\(.*\)\.o[ :]*!\1.lo \1.o: !g' >> Makefile.in.new ) + (cd $(srcdir) ; diff Makefile.in.new Makefile.in && rm Makefile.in.new \ + || mv Makefile.in.new Makefile.in ) + + +# Dependencies for the examples +example-all-functions.lo example-all-functions.o: $(srcdir)/example-all-functions.c $(srcdir)/getdns_libevent.h \ + ../../src/getdns/getdns.h $(srcdir)/../../src/getdns/getdns_ext_libevent.h \ + $(srcdir)/../../src/getdns/getdns_extra.h +example-reverse.lo example-reverse.o: $(srcdir)/example-reverse.c $(srcdir)/getdns_libevent.h \ + ../../src/getdns/getdns.h $(srcdir)/../../src/getdns/getdns_ext_libevent.h \ + $(srcdir)/../../src/getdns/getdns_extra.h +example-simple-answers.lo example-simple-answers.o: $(srcdir)/example-simple-answers.c $(srcdir)/getdns_libevent.h \ + ../../src/getdns/getdns.h $(srcdir)/../../src/getdns/getdns_ext_libevent.h \ + $(srcdir)/../../src/getdns/getdns_extra.h +example-synchronous.lo example-synchronous.o: $(srcdir)/example-synchronous.c $(srcdir)/getdns_core_only.h \ + ../../src/getdns/getdns.h +example-tree.lo example-tree.o: $(srcdir)/example-tree.c $(srcdir)/getdns_libevent.h \ + ../../src/getdns/getdns.h $(srcdir)/../../src/getdns/getdns_ext_libevent.h \ + $(srcdir)/../../src/getdns/getdns_extra.h diff --git a/src/Makefile.in b/src/Makefile.in index f404ee64..0f3645ea 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -58,11 +58,10 @@ datarootdir=@datarootdir@ INSTALL = @INSTALL@ srcdir = @srcdir@ -VPATH = @srcdir@ LIBTOOL = ../libtool CC=@CC@ -CFLAGS=-Wall -std=c99 -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -I$(srcdir) -I. @CFLAGS@ +CFLAGS=-Wall -std=c99 -I$(srcdir) -I. @CFLAGS@ LDFLAGS=@LDFLAGS@ @LIBS@ EXTENSION_LIBEVENT_LIB=@EXTENSION_LIBEVENT_LIB@ @@ -75,7 +74,7 @@ EXTENSION_LIBUV_LIB=@EXTENSION_LIBUV_LIB@ EXTENSION_LIBUV_EXT_LIBS=@EXTENSION_LIBUV_EXT_LIBS@ EXTENSION_LIBUV_LDFLAGS=@EXTENSION_LIBUV_LDFLAGS@ -GETDNS_OBJ=const-info.lo context.lo convert.lo dict.lo dnssec.lo general.lo \ +GETDNS_OBJ=const-info.lo convert.lo dict.lo dnssec.lo general.lo \ getdns_error.lo libmini_event.lo list.lo request-internal.lo \ rr-dict.lo stub.lo sync.lo util-internal.lo @@ -88,6 +87,10 @@ COMPAT_OBJ=$(LIBOBJS:.o=.lo) UTIL_OBJ=mini_event.lo rbtree.lo +EXTENSION_OBJ=libevent.lo libev.lo + +NON_C99_OBJS=context.lo libuv.lo + .SUFFIXES: .c .o .a .lo .h .c.o: @@ -100,10 +103,14 @@ default: all all: libgetdns.la $(EXTENSION_LIBEVENT_LIB) $(EXTENSION_LIBUV_LIB) $(EXTENSION_LIBEV_LIB) -$(GLDNS_OBJ) $(COMPAT_OBJ) $(UTIL_OBJ) libmini_event.lo: +$(GETDNS_OBJ) $(GLDNS_OBJ) $(COMPAT_OBJ) $(UTIL_OBJ) $(EXTENSION_OBJ): @: $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $< -o $@ +$(NON_C99_OBJS): + @: + $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -c $< -o $@ + install: libgetdns.la $(INSTALL) -m 755 -d $(DESTDIR)$(includedir) $(INSTALL) -m 755 -d $(DESTDIR)$(includedir)/getdns @@ -124,19 +131,19 @@ uninstall: if test $(have_libuv) = 1; then $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(EXTENSION_LIBUV_LIB) ; fi if test $(have_libev) = 1; then $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(EXTENSION_LIBEV_LIB) ; fi -libgetdns_ext_event.la: libgetdns.la extension/libevent.lo - $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ extension/libevent.lo libgetdns.la $(LDFLAGS) $(EXTENSION_LIBEVENT_LDFLAGS) $(EXTENSION_LIBEVENT_EXT_LIBS) -rpath $(libdir) -version-info $(libversion) -no-undefined -export-symbols $(srcdir)/extension/libevent.symbols +libgetdns_ext_event.la: libgetdns.la libevent.lo + $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ libevent.lo libgetdns.la $(LDFLAGS) $(EXTENSION_LIBEVENT_LDFLAGS) $(EXTENSION_LIBEVENT_EXT_LIBS) -rpath $(libdir) -version-info $(libversion) -no-undefined -export-symbols $(srcdir)/extension/libevent.symbols -libgetdns_ext_uv.la: libgetdns.la extension/libuv.lo - $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ extension/libuv.lo libgetdns.la $(LDFLAGS) $(EXTENSION_LIBUV_LDFLAGS) $(EXTENSION_LIBUV_EXT_LIBS) -rpath $(libdir) -version-info $(libversion) -no-undefined -export-symbols $(srcdir)/extension/libuv.symbols +libgetdns_ext_uv.la: libgetdns.la libuv.lo + $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ libuv.lo libgetdns.la $(LDFLAGS) $(EXTENSION_LIBUV_LDFLAGS) $(EXTENSION_LIBUV_EXT_LIBS) -rpath $(libdir) -version-info $(libversion) -no-undefined -export-symbols $(srcdir)/extension/libuv.symbols -libgetdns_ext_ev.la: libgetdns.la extension/libev.lo - $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ extension/libev.lo libgetdns.la $(LDFLAGS) $(EXTENSION_LIBEV_LDFLAGS) $(EXTENSION_LIBEV_EXT_LIBS) -rpath $(libdir) -version-info $(libversion) -no-undefined -export-symbols $(srcdir)/extension/libev.symbols +libgetdns_ext_ev.la: libgetdns.la libev.lo + $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ libev.lo libgetdns.la $(LDFLAGS) $(EXTENSION_LIBEV_LDFLAGS) $(EXTENSION_LIBEV_EXT_LIBS) -rpath $(libdir) -version-info $(libversion) -no-undefined -export-symbols $(srcdir)/extension/libev.symbols -libgetdns.la: $(GETDNS_OBJ) $(GLDNS_OBJ) $(COMPAT_OBJ) $(UTIL_OBJ) - $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ $(GETDNS_OBJ) $(GLDNS_OBJ) $(COMPAT_OBJ) $(UTIL_OBJ) $(LDFLAGS) -rpath $(libdir) -version-info $(libversion) -no-undefined -export-symbols $(srcdir)/libgetdns.symbols +libgetdns.la: $(GETDNS_OBJ) context.lo $(GLDNS_OBJ) $(COMPAT_OBJ) $(UTIL_OBJ) + $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) -o $@ $(GETDNS_OBJ) context.lo $(GLDNS_OBJ) $(COMPAT_OBJ) $(UTIL_OBJ) $(LDFLAGS) -rpath $(libdir) -version-info $(libversion) -no-undefined -export-symbols $(srcdir)/libgetdns.symbols test: FORCE @@ -178,15 +185,15 @@ distcheck: $(distdir).tar.gz rm -rf $(distdir) @echo "*** Package $(distdir).tar.gz is ready for distribution" -Makefile: Makefile.in ../config.status - cd .. && ./config.status $@ +Makefile: $(srcdir)/Makefile.in ../config.status + cd .. && ./config.status src/Makefile configure.status: configure cd .. && ./config.status --recheck depend: (cd $(srcdir) ; awk 'BEGIN{P=1}{if(P)print}/^# Dependencies/{P=0}' Makefile.in > Makefile.in.new ) - (cd $(srcdir) ; gcc -MM -I. *.c gldns/*.c compat/*.c util/*.c extension/libmini_event.c| \ + (cd $(srcdir) ; gcc -MM -I. *.c gldns/*.c compat/*.c util/*.c extension/*.c| \ sed -e 's?gldns/?$$(srcdir)/gldns/?g' \ -e 's?compat/?$$(srcdir)/compat/?g' \ -e 's?util/?$$(srcdir)/util/?g' \ @@ -194,6 +201,9 @@ depend: -e 's? \([a-z_-]*\)\.\([ch]\)? $$(srcdir)/\1.\2?g' \ -e 's? \$$(srcdir)/config\.h? config.h?g' \ -e 's? getdns/getdns_extra\.h? $$(srcdir)/getdns/getdns_extra.h?g' \ + -e 's? getdns/getdns_ext_libevent\.h? $$(srcdir)/getdns/getdns_ext_libevent.h?g' \ + -e 's? getdns/getdns_ext_libev\.h? $$(srcdir)/getdns/getdns_ext_libev.h?g' \ + -e 's? getdns/getdns_ext_libuv\.h? $$(srcdir)/getdns/getdns_ext_libuv.h?g' \ -e 's!\(.*\)\.o[ :]*!\1.lo \1.o: !g' >> Makefile.in.new ) (cd $(srcdir) ; diff Makefile.in.new Makefile.in && rm Makefile.in.new \ || mv Makefile.in.new Makefile.in ) @@ -201,54 +211,54 @@ depend: .PHONY: clean test FORCE: -# Dependencies for gldns, utils, the mini_event extension and compat functions +# Dependencies for gldns, utils, the extensions and compat functions const-info.lo const-info.o: $(srcdir)/const-info.c getdns/getdns.h $(srcdir)/const-info.h context.lo context.o: $(srcdir)/context.c config.h $(srcdir)/context.h getdns/getdns.h \ - $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/types-internal.h \ + $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h \ $(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ - $(srcdir)/types-internal.h $(srcdir)/util-internal.h $(srcdir)/dnssec.h + $(srcdir)/types-internal.h $(srcdir)/util-internal.h $(srcdir)/dnssec.h $(srcdir)/stub.h convert.lo convert.o: $(srcdir)/convert.c getdns/getdns.h $(srcdir)/util-internal.h $(srcdir)/context.h \ $(srcdir)/getdns/getdns_extra.h getdns/getdns.h config.h $(srcdir)/types-internal.h \ - $(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ - $(srcdir)/types-internal.h $(srcdir)/getdns_error.h + $(srcdir)/util/rbtree.h $(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h \ + $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/getdns_error.h dict.lo dict.o: $(srcdir)/dict.c $(srcdir)/types-internal.h getdns/getdns.h $(srcdir)/getdns/getdns_extra.h \ - getdns/getdns.h $(srcdir)/util-internal.h $(srcdir)/context.h config.h \ + getdns/getdns.h $(srcdir)/util/rbtree.h $(srcdir)/util-internal.h $(srcdir)/context.h config.h \ $(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ $(srcdir)/types-internal.h $(srcdir)/dict.h $(srcdir)/rr-dict.h $(srcdir)/const-info.h dnssec.lo dnssec.o: $(srcdir)/dnssec.c getdns/getdns.h config.h $(srcdir)/context.h \ - $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/types-internal.h \ + $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h \ $(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ $(srcdir)/types-internal.h $(srcdir)/util-internal.h $(srcdir)/dnssec.h $(srcdir)/rr-dict.h general.lo general.o: $(srcdir)/general.c config.h $(srcdir)/context.h getdns/getdns.h \ - $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/types-internal.h \ + $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h \ $(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ $(srcdir)/types-internal.h $(srcdir)/util-internal.h $(srcdir)/dnssec.h $(srcdir)/stub.h getdns_error.lo getdns_error.o: $(srcdir)/getdns_error.c getdns/getdns.h $(srcdir)/const-info.h list.lo list.o: $(srcdir)/list.c $(srcdir)/types-internal.h getdns/getdns.h $(srcdir)/getdns/getdns_extra.h \ - getdns/getdns.h $(srcdir)/util-internal.h $(srcdir)/context.h config.h \ + getdns/getdns.h $(srcdir)/util/rbtree.h $(srcdir)/util-internal.h $(srcdir)/context.h config.h \ $(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ $(srcdir)/types-internal.h $(srcdir)/list.h request-internal.lo request-internal.o: $(srcdir)/request-internal.c config.h $(srcdir)/types-internal.h \ - getdns/getdns.h $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/util-internal.h \ - $(srcdir)/context.h $(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h \ - $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/gldns/rrdef.h + getdns/getdns.h $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/util/rbtree.h \ + $(srcdir)/util-internal.h $(srcdir)/context.h $(srcdir)/extension/libmini_event.h config.h \ + $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/gldns/rrdef.h rr-dict.lo rr-dict.o: $(srcdir)/rr-dict.c $(srcdir)/rr-dict.h getdns/getdns.h $(srcdir)/types-internal.h \ - $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/context.h config.h \ + $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/util/rbtree.h $(srcdir)/context.h config.h \ $(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ $(srcdir)/types-internal.h $(srcdir)/dict.h stub.lo stub.o: $(srcdir)/stub.c config.h $(srcdir)/stub.h getdns/getdns.h $(srcdir)/types-internal.h \ - $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/str2wire.h \ - $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/context.h \ + $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/util/rbtree.h $(srcdir)/gldns/rrdef.h \ + $(srcdir)/gldns/str2wire.h $(srcdir)/gldns/rrdef.h $(srcdir)/gldns/gbuffer.h $(srcdir)/gldns/pkthdr.h $(srcdir)/context.h \ $(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ $(srcdir)/types-internal.h $(srcdir)/util-internal.h $(srcdir)/general.h sync.lo sync.o: $(srcdir)/sync.c getdns/getdns.h config.h $(srcdir)/context.h $(srcdir)/getdns/getdns_extra.h \ - getdns/getdns.h $(srcdir)/types-internal.h $(srcdir)/extension/libmini_event.h config.h \ - $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/general.h \ + getdns/getdns.h $(srcdir)/types-internal.h $(srcdir)/util/rbtree.h $(srcdir)/extension/libmini_event.h \ + config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/general.h \ $(srcdir)/util-internal.h $(srcdir)/dnssec.h $(srcdir)/stub.h $(srcdir)/gldns/wire2str.h -util-internal.lo util-internal.o: $(srcdir)/util-internal.c getdns/getdns.h $(srcdir)/dict.h $(srcdir)/types-internal.h \ - $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/list.h $(srcdir)/util-internal.h $(srcdir)/context.h \ - config.h $(srcdir)/extension/libmini_event.h config.h $(srcdir)/util/mini_event.h \ - $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/rr-dict.h +util-internal.lo util-internal.o: $(srcdir)/util-internal.c getdns/getdns.h $(srcdir)/dict.h $(srcdir)/util/rbtree.h \ + $(srcdir)/types-internal.h $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/list.h \ + $(srcdir)/util-internal.h $(srcdir)/context.h config.h $(srcdir)/extension/libmini_event.h config.h \ + $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h $(srcdir)/rr-dict.h gbuffer.lo gbuffer.o: $(srcdir)/gldns/gbuffer.c config.h $(srcdir)/gldns/gbuffer.h keyraw.lo keyraw.o: $(srcdir)/gldns/keyraw.c config.h $(srcdir)/gldns/keyraw.h $(srcdir)/gldns/rrdef.h parse.lo parse.o: $(srcdir)/gldns/parse.c config.h $(srcdir)/gldns/parse.h $(srcdir)/gldns/parseutil.h \ @@ -265,7 +275,19 @@ mini_event.lo mini_event.o: $(srcdir)/util/mini_event.c config.h $(srcdir)/util/ $(srcdir)/util/fptr_wlist.h rbtree.lo rbtree.o: $(srcdir)/util/rbtree.c config.h $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/rbtree.h +libev.lo libev.o: $(srcdir)/extension/libev.c $(srcdir)/getdns/getdns_ext_libev.h getdns/getdns.h \ + $(srcdir)/getdns/getdns_extra.h $(srcdir)/types-internal.h getdns/getdns.h \ + $(srcdir)/getdns/getdns_extra.h $(srcdir)/util/rbtree.h config.h +libevent.lo libevent.o: $(srcdir)/extension/libevent.c $(srcdir)/getdns/getdns_ext_libevent.h \ + getdns/getdns.h $(srcdir)/getdns/getdns_extra.h $(srcdir)/types-internal.h getdns/getdns.h \ + $(srcdir)/getdns/getdns_extra.h $(srcdir)/util/rbtree.h config.h libmini_event.lo libmini_event.o: $(srcdir)/extension/libmini_event.c $(srcdir)/extension/libmini_event.h \ config.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/types-internal.h \ - getdns/getdns.h $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/context.h config.h \ - $(srcdir)/types-internal.h $(srcdir)/extension/libmini_event.h + getdns/getdns.h $(srcdir)/getdns/getdns_extra.h getdns/getdns.h $(srcdir)/util/rbtree.h \ + $(srcdir)/context.h config.h $(srcdir)/types-internal.h $(srcdir)/extension/libmini_event.h \ + $(srcdir)/util-internal.h $(srcdir)/context.h +libuv.lo libuv.o: $(srcdir)/extension/libuv.c config.h $(srcdir)/getdns/getdns_ext_libuv.h \ + getdns/getdns.h $(srcdir)/getdns/getdns_extra.h $(srcdir)/util-internal.h $(srcdir)/context.h \ + getdns/getdns.h $(srcdir)/getdns/getdns_extra.h config.h $(srcdir)/types-internal.h \ + $(srcdir)/util/rbtree.h $(srcdir)/extension/libmini_event.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h \ + $(srcdir)/types-internal.h diff --git a/src/test/Makefile.in b/src/test/Makefile.in old mode 100755 new mode 100644 index 81773f11..b9f5de43 --- a/src/test/Makefile.in +++ b/src/test/Makefile.in @@ -38,7 +38,6 @@ INSTALL = @INSTALL@ LIBTOOL = ../../libtool srcdir = @srcdir@ -VPATH = @srcdir@ have_libevent = @have_libevent@ have_libuv = @have_libuv@ @@ -64,8 +63,19 @@ LDLIBS=../libgetdns.la CHECK_LIBS=@CHECK_LIBS@ CHECK_CFLAGS=@CHECK_CFLAGS@ +CHECK_OBJS=check_getdns_common.lo check_getdns_context_set_timeout.lo \ + check_getdns.lo check_getdns_transport.lo + +ALL_OBJS=$(CHECK_OBJS) check_getdns_libevent.lo check_getdns_libev.lo \ + check_getdns_selectloop.lo getdns_query.lo testmessages.lo \ + tests_dict.lo tests_list.lo tests_namespaces.lo \ + tests_stub_async.lo tests_stub_sync.lo + +NON_C99_OBJS=check_getdns_libuv.lo + PROGRAMS=tests_dict tests_list tests_namespaces tests_stub_async tests_stub_sync getdns_query $(CHECK_GETDNS) $(CHECK_EV_PROG) $(CHECK_EVENT_PROG) $(CHECK_UV_PROG) + .SUFFIXES: .c .o .a .lo .h .c.o: @@ -78,8 +88,13 @@ default: all all: $(PROGRAMS) -check_getdns_libuv.lo: check_getdns_libuv.c - $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -D_GNU_SOURCE -c $< -o $@ +$(ALL_OBJS): + @: + $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -c $< -o $@ + +$(NON_C99_OBJS): + @: + $(LIBTOOL) --quiet --tag=CC --mode=compile $(CC) $(CFLAGS) -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=600 -c $< -o $@ tests_dict: tests_dict.lo testmessages.lo $(LIBTOOL) --tag=CC --mode=link $(CC) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ tests_dict.lo testmessages.lo @@ -166,10 +181,77 @@ distcheck: $(distdir).tar.gz rm -rf $(distdir) @echo "*** Package $(distdir).tar.gz is ready for distribution" -Makefile: Makefile.in ../../config.status - cd ../.. && ./config.status $@ +Makefile: $(srcdir)/Makefile.in ../../config.status + cd ../.. && ./config.status src/test/Makefile configure.status: configure cd ../.. && ./config.status --recheck +depend: + (cd $(srcdir) ; awk 'BEGIN{P=1}{if(P)print}/^# Dependencies/{P=0}' Makefile.in > Makefile.in.new ) + (cd $(srcdir) ; gcc -MM -I. -I.. *.c | \ + sed -e 's? \([a-z_-]*\)\.\([ch]\)? $$(srcdir)/\1.\2?g' \ + -e 's? \$$(srcdir)/config\.h? ../config.h?g' \ + -e 's? \.\./getdns/getdns_extra\.h? $$(srcdir)/../getdns/getdns_extra.h?g' \ + -e 's? \.\./getdns/getdns_ext_libevent\.h? $$(srcdir)/../getdns/getdns_ext_libevent.h?g' \ + -e 's? \.\./getdns/getdns_ext_libev\.h? $$(srcdir)/../getdns/getdns_ext_libev.h?g' \ + -e 's? \.\./getdns/getdns_ext_libuv\.h? $$(srcdir)/../getdns/getdns_ext_libuv.h?g' \ + -e 's!\(.*\)\.o[ :]*!\1.lo \1.o: !g' >> Makefile.in.new ) + (cd $(srcdir) ; diff Makefile.in.new Makefile.in && rm Makefile.in.new \ + || mv Makefile.in.new Makefile.in ) + + + .PHONY: clean test + +# Dependencies for the unit tests +check_getdns.lo check_getdns.o: $(srcdir)/check_getdns.c ../getdns/getdns.h $(srcdir)/check_getdns_common.h \ + $(srcdir)/check_getdns_general.h $(srcdir)/check_getdns_general_sync.h \ + $(srcdir)/check_getdns_address.h $(srcdir)/check_getdns_address_sync.h \ + $(srcdir)/check_getdns_hostname.h $(srcdir)/check_getdns_hostname_sync.h \ + $(srcdir)/check_getdns_context_create.h $(srcdir)/check_getdns_context_destroy.h \ + $(srcdir)/check_getdns_cancel_callback.h $(srcdir)/check_getdns_list_get_length.h \ + $(srcdir)/check_getdns_list_get_data_type.h $(srcdir)/check_getdns_list_get_dict.h \ + $(srcdir)/check_getdns_list_get_list.h $(srcdir)/check_getdns_list_get_int.h \ + $(srcdir)/check_getdns_list_get_bindata.h $(srcdir)/check_getdns_dict_get_names.h \ + $(srcdir)/check_getdns_dict_get_data_type.h $(srcdir)/check_getdns_dict_get_dict.h \ + $(srcdir)/check_getdns_dict_get_list.h $(srcdir)/check_getdns_dict_get_bindata.h \ + $(srcdir)/check_getdns_dict_get_int.h $(srcdir)/check_getdns_dict_destroy.h \ + $(srcdir)/check_getdns_dict_set_dict.h $(srcdir)/check_getdns_dict_set_list.h \ + $(srcdir)/check_getdns_dict_set_bindata.h $(srcdir)/check_getdns_dict_set_int.h \ + $(srcdir)/check_getdns_convert_ulabel_to_alabel.h \ + $(srcdir)/check_getdns_convert_alabel_to_ulabel.h $(srcdir)/check_getdns_pretty_print_dict.h \ + $(srcdir)/check_getdns_display_ip_address.h \ + $(srcdir)/check_getdns_context_set_context_update_callback.h \ + $(srcdir)/check_getdns_context_set_timeout.h \ + $(srcdir)/check_getdns_context_set_upstream_recursive_servers.h \ + $(srcdir)/check_getdns_service.h $(srcdir)/check_getdns_service_sync.h \ + $(srcdir)/check_getdns_transport.h +check_getdns_common.lo check_getdns_common.o: $(srcdir)/check_getdns_common.c ../getdns/getdns.h \ + ../config.h $(srcdir)/check_getdns_common.h $(srcdir)/check_getdns_eventloop.h +check_getdns_context_set_timeout.lo check_getdns_context_set_timeout.o: $(srcdir)/check_getdns_context_set_timeout.c \ + $(srcdir)/check_getdns_context_set_timeout.h $(srcdir)/check_getdns_common.h \ + ../getdns/getdns.h +check_getdns_libev.lo check_getdns_libev.o: $(srcdir)/check_getdns_libev.c $(srcdir)/check_getdns_eventloop.h \ + ../config.h ../getdns/getdns.h $(srcdir)/../getdns/getdns_ext_libev.h \ + $(srcdir)/../getdns/getdns_extra.h $(srcdir)/check_getdns_common.h +check_getdns_libevent.lo check_getdns_libevent.o: $(srcdir)/check_getdns_libevent.c $(srcdir)/check_getdns_eventloop.h \ + ../config.h ../getdns/getdns.h $(srcdir)/../getdns/getdns_ext_libevent.h \ + $(srcdir)/../getdns/getdns_extra.h $(srcdir)/check_getdns_libevent.h $(srcdir)/check_getdns_common.h +check_getdns_libuv.lo check_getdns_libuv.o: $(srcdir)/check_getdns_libuv.c $(srcdir)/check_getdns_eventloop.h \ + ../config.h ../getdns/getdns.h $(srcdir)/../getdns/getdns_ext_libuv.h \ + $(srcdir)/../getdns/getdns_extra.h $(srcdir)/check_getdns_common.h +check_getdns_selectloop.lo check_getdns_selectloop.o: $(srcdir)/check_getdns_selectloop.c \ + $(srcdir)/check_getdns_eventloop.h ../config.h ../getdns/getdns.h \ + $(srcdir)/../getdns/getdns_extra.h +check_getdns_transport.lo check_getdns_transport.o: $(srcdir)/check_getdns_transport.c \ + $(srcdir)/check_getdns_transport.h $(srcdir)/check_getdns_common.h ../getdns/getdns.h +getdns_query.lo getdns_query.o: $(srcdir)/getdns_query.c ../config.h ../getdns/getdns.h \ + $(srcdir)/../getdns/getdns_extra.h +testmessages.lo testmessages.o: $(srcdir)/testmessages.c $(srcdir)/testmessages.h +tests_dict.lo tests_dict.o: $(srcdir)/tests_dict.c $(srcdir)/testmessages.h ../getdns/getdns.h +tests_list.lo tests_list.o: $(srcdir)/tests_list.c $(srcdir)/testmessages.h ../getdns/getdns.h +tests_namespaces.lo tests_namespaces.o: $(srcdir)/tests_namespaces.c $(srcdir)/testmessages.h ../getdns/getdns.h +tests_stub_async.lo tests_stub_async.o: $(srcdir)/tests_stub_async.c ../config.h $(srcdir)/testmessages.h \ + ../getdns/getdns.h $(srcdir)/../getdns/getdns_extra.h +tests_stub_sync.lo tests_stub_sync.o: $(srcdir)/tests_stub_sync.c $(srcdir)/testmessages.h ../getdns/getdns.h