SUBDIRS = $(SUBDIR)

bin_SCRIPTS = pslib-config psParseErrorCodes

bin_PROGRAMS = psTableParse

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA= pslib.pc

EXTRA_DIST = \
    Doxyfile.in \
    pslib-config.in \
    pslib.pc.in \
    share \
    psParseErrorCodes \
    psParsePrecessionTable \
    autogen.sh

psTableParse_SOURCES = psTableParse.c

if DOXYGEN
docs: Doxyfile $(prefix)/docs/pslib $(mandir)/man3
	doxygen Doxyfile
	mv -f $(prefix)/docs/pslib/man/man3/* $(mandir)/man3
	rm -rf $(prefix)/docs/pslib/man
endif

$(prefix)/docs/pslib:
	mkdir -p -m 744 $(prefix)/docs/pslib

$(mandir)/man3:
	mkdir -p -m 744 $(mandir)/man3

$(datadir)/pslib:
	if [ -d $(datadir) ] ; then chmod u+w $(datadir) ; fi
	mkdir -p -m 744 $(datadir)/pslib

$(sysconfdir)/pslib:
	if [ -d $(sysconfdir) ] ; then chmod u+w $(sysconfdir) ; fi
	mkdir -p -m 744 $(sysconfdir)/pslib

install-data-hook: $(datadir)/pslib $(sysconfdir)/pslib
	if [ `pwd`/share != $(datadir) ] ; then $(INSTALL_DATA) $(srcdir)/share/pslib/*.dat $(datadir)/pslib ; fi
	if [ `pwd`/etc != $(sysconfdir) ] ; then  $(INSTALL_DATA) $(srcdir)/etc/pslib/psTime.xml etc/pslib/pslib.config $(sysconfdir)/pslib ; fi

uninstall-hook:
	if [ `pwd`/share != $(datadir) ] ; then rm -rf $(datadir)/pslib ; fi
	if [ `pwd`/etc != $(sysconfdir) ] ; then  rm -rf $(sysconfdir)/pslib ; fi
	rm -rf $(prefix)/docs/pslib/*

CLEANFILES = $(prefix)/docs/pslib/*

test: check

distuninstallcheck_listfiles = \
	`find . -name .packlist -or -name perllocal.pod -or -name pslib.bs -or -name pslib.so -or -name pslib.pm`

distuninstallcheck:
	@:
