# 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/>.

prefixexecbin_PROGRAMS += troff
PREFIXMAN1 += src/roff/troff/troff.1
EXTRA_DIST += \
  src/roff/troff/column.cpp \
  src/roff/troff/troff.1.man \
  src/roff/troff/TODO
troff_LDADD = libgroff.a lib/libgnu.a $(LIBM)
troff_SOURCES = \
  src/roff/troff/dictionary.cpp \
  src/roff/troff/div.cpp \
  src/roff/troff/env.cpp \
  src/roff/troff/input.cpp \
  src/roff/troff/mtsm.cpp \
  src/roff/troff/node.cpp \
  src/roff/troff/number.cpp \
  src/roff/troff/reg.cpp \
  src/roff/troff/env.h \
  src/roff/troff/node.h \
  src/roff/troff/troff.h \
  src/roff/troff/div.h \
  src/roff/troff/reg.h \
  src/roff/troff/dictionary.h \
  src/roff/troff/input.h \
  src/roff/troff/mtsm.h \
  src/roff/troff/token.h \
  src/roff/troff/charinfo.h \
  src/roff/troff/request.h \
  src/roff/troff/hvunits.h

nodist_troff_SOURCES = src/roff/troff/majorminor.cpp

src/roff/troff/input.$(OBJEXT): defs.h
CLEANFILES += src/roff/troff/majorminor.cpp

src/roff/troff/majorminor.cpp: $(top_srcdir)/.version
	$(AM_V_at)printf 'const char *major_version = "%s";\n' \
	  $(MAJOR_VERSION) > $@.tmp
	$(AM_V_at)printf 'const char *minor_version = "%s";\n' \
	  $(MINOR_VERSION) >> $@.tmp
	$(AM_V_at)printf 'const char *revision = "%s";\n' \
	  $(REVISION) >> $@.tmp
	$(AM_V_GEN)mv $@.tmp $@


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