-## -*-makefile-*-
-##
-## $Id: Makefile.am,v 1.11 2003/11/30 00:58:21 mdw Exp $
-##
-## Makefile for Anag
-##
-## (c) 2001 Mark Wooding
-##
-
-##----- Licensing notice ----------------------------------------------------
-##
-## This file is part of Anag: a simple wordgame helper.
-##
-## Anag 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 2 of the License, or
-## (at your option) any later version.
-##
-## Anag 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 Anag; if not, write to the Free Software Foundation,
-## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-##----- Revision history ----------------------------------------------------
-##
-## $Log: Makefile.am,v $
-## Revision 1.11 2003/11/30 00:58:21 mdw
-## Various fixes.
-##
-## Revision 1.10 2003/11/29 23:38:37 mdw
-## Debianization.
-##
-## Revision 1.9 2003/09/15 02:48:55 mdw
-## Monoalphabetic match filter.
-##
-## Revision 1.8 2002/08/11 12:59:00 mdw
-## New Tcl/Tk interface; regular expression support.
-##
-## Revision 1.7 2001/02/19 19:19:21 mdw
-## Minor build system fixes.
-##
-## Revision 1.6 2001/02/07 09:09:20 mdw
-## Install Java files in the right place.
-##
-## Revision 1.5 2001/02/06 10:06:25 mdw
-## Find a suitable Java compiler. If there isn't one, don't compile the
-## Java bits.
-##
-## Revision 1.4 2001/02/06 09:38:46 mdw
-## Remove redundant rule.
-##
-## Revision 1.3 2001/02/06 09:37:56 mdw
-## Clean the .jar file.
-##
-## Revision 1.2 2001/02/04 19:53:07 mdw
-## Simple GUI front-end in Java.
-##
-## Revision 1.1 2001/02/04 17:14:42 mdw
-## Initial checkin
-##
-
-AUTOMAKE_OPTIONS = foreign
-javadir = $(datadir)/java
+### -*-makefile-*-
+###
+### Build script for `anag'
+###
+### (c) 2001, 2016 Mark Wooding
+###
+
+###----- Licensing notice ---------------------------------------------------
+###
+### This file is part of Anag: a simple wordgame helper.
+###
+### Anag 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 2 of the License, or
+### (at your option) any later version.
+###
+### Anag 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 Anag; if not, write to the Free Software Foundation,
+### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+EXTRA_DIST =
+CLEANFILES =
+SUFFIXES =
+
+bin_PROGRAMS =
+bin_SCRIPTS =
+
+LDADD =
+if HAVE_PCRE2
+ LDADD += $(PCRE2_LIBS)
+else
+if HAVE_PCRE
+ LDADD += $(PCRE_LIBS)
+endif
+endif
+
+###--------------------------------------------------------------------------
+### Making substitutions.
+
+confsubst = $(top_srcdir)/config/confsubst
+V_SUBST = $(V_SUBST_$(V))
+V_SUBST_ = $(V_SUBST_$(AM_DEFAULT_VERBOSITY))
+V_SUBST_0 = @echo " SUBST $@";
+SUBST = $(V_SUBST)$(confsubst)
+SUBSTITUTIONS = \
+ PACKAGE=$(PACKAGE) VERSION=$(VERSION) \
+ DICTIONARY=$(DICTIONARY) \
+ WISH=$(WISH) \
+ ANAG=$(bindir)/anag
+
+EXTRA_DIST += config/confsubst
+
+###--------------------------------------------------------------------------
+### Main program.
+
+bin_PROGRAMS += anag
+anag_SOURCES = anag.c anag.h util.c
+anag_SOURCES += anagram.c
+anag_SOURCES += longest.c
+anag_SOURCES += mono.c
+if HAVE_PCRE2
+ anag_SOURCES += pcre.c
+else
+if HAVE_PCRE
+ anag_SOURCES += pcre.c
+endif
+endif
+if HAVE_REGCOMP
+ anag_SOURCES += regexp.c
+endif
+anag_SOURCES += trackword.c
+anag_SOURCES += wildcard.c
+
+###--------------------------------------------------------------------------
+### Java frontend.