# $Progeny$

all: discover discover-static

###############################################################################
# Build

discover_SOURCES=	discover.c
discover_OBJS=		discover.lo
discover_LIBS=		${libportability} ${LIBS}

discover: ${discover_OBJS} ${top_builddir}/lib/libdiscover.la ${libportability}
	${LTLINK} -o $@ ${discover_OBJS} ${discover_LIBS}		\
		${top_builddir}/lib/libdiscover.la ${libportability}

discover-static: ${discover_OBJS} ${top_builddir}/lib/libdiscover.la ${libportability}
	${LTLINK} -o $@ -all-static ${discover_OBJS} ${discover_LIBS}	\
		${top_builddir}/lib/libdiscover.la ${libportability}

###############################################################################
# Clean

clean_FILES=		discover discover-static ${discover_OBJS}
distclean_FILES=	Makefile

clean:
	${LTCLEAN} ${clean_FILES}

distclean:
	${LTCLEAN} ${clean_FILES} ${distclean_FILES}

maintainer-clean:
	${LTCLEAN} ${clean_FILES} ${distclean_FILES}

###############################################################################
# Installation

install: discover
	${INSTALL_DIR} ${DESTDIR}${bindir}
	${INSTALL_PROGRAM} discover ${DESTDIR}${bindir}/discover
	${INSTALL_PROGRAM} discover-static ${DESTDIR}${bindir}/discover-static

uninstall:
	rm -f ${DESTDIR}${bindir}/discover ${DESTDIR}${bindir}/discover-static

###############################################################################
# Distribution

DISTFILES=		Makefile.in ${discover_SOURCES}

distdir: ${DISTFILES}
	${top_srcdir}/buildtools/distdir ${distdir}/${_THISDIR_} ${DISTFILES}
