# Copyright (C) 2014-2020 Free Software Foundation, Inc.
#
# This file is part of groff.
#
# groff is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# groff is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

indxbib_srcdir = $(top_srcdir)/src/utils/indxbib
prefixexecbin_PROGRAMS += indxbib
indxbib_SOURCES = \
  src/utils/indxbib/indxbib.cpp \
  src/utils/indxbib/signal.c
src/utils/indxbib/indxbib.$(OBJEXT): defs.h
indxbib_LDADD = libbib.a libgroff.a $(LIBM) lib/libgnu.a
PREFIXMAN1 += src/utils/indxbib/indxbib.1
EXTRA_DIST += \
  src/utils/indxbib/indxbib.1.man \
  src/utils/indxbib/eign

install-data-local: install_indxbib
install_indxbib: $(indxbib_srcdir)/eign
	-test -d $(DESTDIR)$(datadir) \
	  || $(mkinstalldirs) $(DESTDIR)$(datadir)
	-test -d $(DESTDIR)$(dataprogramdir) \
	  || $(mkinstalldirs) $(DESTDIR)$(dataprogramdir)
	-test -d $(DESTDIR)$(datasubdir) \
	  || $(mkinstalldirs) $(DESTDIR)$(datasubdir)
	if test -f /usr/lib/eign; then \
	  rm -f $(DESTDIR)$(common_words_file); \
	  ln -s /usr/lib/eign $(DESTDIR)$(common_words_file) 2>/dev/null \
	    || ln /usr/lib/eign $(DESTDIR)$(common_words_file) 2>/dev/null \
	    || cp /usr/lib/eign $(DESTDIR)$(common_words_file); \
	else \
	  rm -f $(DESTDIR)$(common_words_file); \
	  $(INSTALL_DATA) $(indxbib_srcdir)/eign $(DESTDIR)$(common_words_file); \
	fi

uninstall-local: uninstall_indxbib
uninstall_indxbib:
	rm -f $(DESTDIR)$(common_words_file)


# Local Variables:
# fill-column: 72
# mode: makefile-automake
# End:
# vim: set autoindent filetype=automake textwidth=72:
