# $Progeny$

SYSDEPS=		@SYSDEPS@

LT_CURRENT=		@LT_CURRENT@
LT_REVISION=		@LT_REVISION@
LT_AGE=			@LT_AGE@

all: libdiscover.la #libdiscover_pic.a

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

libdiscover_SOURCES=							\
	core.c								\
	conf.c								\
	busclass-xml.c device-xml.c vendor-xml.c			\
	curl.c 								\
	load-url.c 							\
	device.c 							\
	url-xml.c							\
	utils.c version-cmp.c stack.c sysdep.c
libdiscover_HEADERS=							\
	${top_builddir}/include/discover/discover.h 			\
	${top_builddir}/include/discover/discover-conf.h 		\
	${top_builddir}/include/discover/discover-xml.h			\
	${top_builddir}/include/discover/curl.h				\
	${top_builddir}/include/discover/load-url.h			\
	${top_builddir}/include/discover/device.h			\
	${top_builddir}/include/discover/url-xml.h			\
	${top_builddir}/include/discover/utils.h			\
	${top_builddir}/include/discover/stack.h			\
	${top_builddir}/include/discover/sysdep.h
libdiscover_OBJS=							\
	core.lo								\
	conf.lo								\
	busclass-xml.lo device-xml.lo vendor-xml.lo			\
	curl.lo								\
	load-url.lo							\
	device.lo							\
	url-xml.lo							\
	utils.lo version-cmp.lo stack.lo sysdep.lo

libdiscover_LIBS=	${libportability} ${LIBS}			\
			${top_builddir}/${SYSDEPS}/libsysdeps.la

libdiscover.la: ${libdiscover_OBJS} ${top_builddir}/${SYSDEPS}/libsysdeps.la ${libportability}
	${LTLINK} -rpath ${libdir}					\
		-version-info ${LT_CURRENT}:${LT_REVISION}:${LT_AGE}	\
		-o $@ ${libdiscover_OBJS} ${libdiscover_LIBS}

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

clean_FILES=		discover-config libdiscover.la ${libdiscover_OBJS} #libdiscover_pic.a
distclean_FILES=	Makefile

clean:
	${LTCLEAN} ${clean_FILES}

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

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

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

install: libdiscover.la #libdiscover_pic.a
	${INSTALL_DIR} ${DESTDIR}${libdir}
	${INSTALL_LIB} libdiscover.la ${DESTDIR}${libdir}/libdiscover.la
#	${INSTALL_LIB} libdiscover_pic.a ${DESTDIR}${libdir}/libdiscover_pic.a

uninstall:
	${UNINSTALL_LIB} ${DESTDIR}${libdir}/libdiscover.la
#	${UNINSTALL_LIB} ${DESTDIR}${libdir}/libdiscover_pic.a

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

DISTFILES=		Makefile.in ${libdiscover_SOURCES}

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