#
# Makefile for Zmailer's libs/
#
@SET_MAKE@

srcdir=         @srcdir@
VPATH=          @srcdir@

LIBRESOLVA= @LIBRESOLVA@
LIBMALLOC=  @LIBMALLOC@

ALL =	libsfio.a libident.a libzmdb.a libsh.a libta.a libzm.a libzc.a \
	$(LIBRESOLVA) lib@MALLOC@.a


all: libtag

libtag: ${ALL}
	touch libtag

depend:  # Eh ?

clean:
	rm -f *.a *~ *.o libtag

distclean clean-recursive: clean
	rm -f Makefile

libident.a:
	cd ../libident; $(MAKE) $(MFLAGS) $@

libzmdb.a: ../include/sfio.h
	cd ../router/libdb;  $(MAKE) $(MFLAGS) $@

libsh.a: ../include/sfio.h
	cd ../libsh; $(MAKE) $(MFLAGS) $@

libta.a: ../include/sfio.h
	cd ../transports/libta; $(MAKE) $(MFLAGS) $@

libzm.a: ../include/sfio.h
	cd ../lib; $(MAKE) $(MFLAGS) $@

libzc.a: ../include/sfio.h
	cd ../libc; $(MAKE) $(MFLAGS) $@

libmalloc.a:: MALLOC
libmalloc_d.a:: MALLOC

MALLOC:
	if [ "x$(LIBMALLOC)" != "x" ] ; then	  \
	  cd ../libmalloc; $(MAKE) $(MFLAGS) $@ ; \
	fi

libsystem.a:
	touch libsystem.a

../include/sfio.h:
	cd ../sfio; $(MAKE) $(MFLAGS) all
libsfio.a:
	cd ../sfio; $(MAKE) $(MFLAGS) all

#
#  Usage of this resolver depends on if the configurer
#  has issued configuration option:  --with-bundled-libresolv
#
libresolv.a:
	if [ "x$(LIBRESOLVA)" != "x" ] ; then	   \
	  cd ../libresolv; $(MAKE) $(MFLAGS) $@	;  \
	fi
