-## Process this file with Automake to generate `Makefile.in'
-## -*-Makefile-*-
-##
-## Building the distribution
-##
-## (c) 1997 Mark Wooding
-##
-
-##----- Licensing notice ----------------------------------------------------
-##
-## This file is part of the Common Files Distribution (`common')
-##
-## `Common' 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.
-##
-## `Common' 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 `common'; if not, write to the Free Software Foundation,
-## Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-## --- What needs building ---
-
-bin_SCRIPTS = mklinks findlinks mdw-setup
-
-## --- Files to install in the repository ---
-
-pkgdata_DATA = \
- COPYING COPYING.LIB INSTALL \
- gpl.tex lgpl.tex gpl.texi lgpl.texi texinice.tex \
- mdwopt.c mdwopt.h \
- getdate.y getdate.h
-
-EXTRA_DIST = \
- aclocal.glob \
- $(pkgdata_DATA) $(pkgdata_SCRIPTS) mdw-setup \
- debian/control debian/copyright debian/rules debian/changelog
-
-pkgdata_SCRIPTS = \
- install-ac maninst
-
-dist-hook:
- echo $(VERSION) >$(distdir)/RELEASE
+### -*-makefile-*-
+###
+### Building the distribution
+###
+### (c) 1997 Mark Wooding
+###
+
+###----- Licensing notice ---------------------------------------------------
+###
+### This file is part of the Common Files Distribution (`common')
+###
+### `Common' 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.
+###
+### `Common' 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 `common'; if not, write to the Free Software Foundation,
+### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+bin_SCRIPTS =
+pkgdata_SCRIPTS =
+dist_pkgdata_SCRIPTS =
+pkgdata_DATA =
+dist_pkgdata_DATA =
+
+EXTRA_DIST =
+CLEANFILES =
+
+###--------------------------------------------------------------------------
+### Handy variables.
+
+confsubst = $(srcdir)/confsubst.in
+mkdir_p = $(srcdir)/config/install-sh -d
+
+V_SUBST = $(V_SUBST_$(V))
+V_SUBST_ = $(V_SUBST_$(AM_DEFAULT_VERBOSITY))
+V_SUBST_0 = @echo " SUBST $@";
+SUBST = $(V_SUBST)$(confsubst)
+
+###--------------------------------------------------------------------------
+### Main scripts.
+
+## mklinks
+bin_SCRIPTS += mklinks
+CLEANFILES += mklinks
+EXTRA_DIST += mklinks.in
+
+mklinks: mklinks.in Makefile
+ $(SUBST) $(srcdir)/mklinks.in >$@.new \
+ pkgdatadir=$(pkgdatadir) VERSION=$(VERSION)
+ $(AM_V_at)chmod +x $@.new
+ $(AM_V_at)mv $@.new $@
+
+## findlinks
+bin_SCRIPTS += findlinks
+CLEANFILES += findlinks
+EXTRA_DIST += findlinks.in
+
+findlinks: findlinks.in Makefile
+ $(SUBST) $(srcdir)/findlinks.in >$@.new \
+ pkgdatadir=$(pkgdatadir) VERSION=$(VERSION)
+ $(AM_V_at)chmod +x $@.new
+ $(AM_V_at)mv $@.new $@
+
+## mdw-setup
+bin_SCRIPTS += mdw-setup
+EXTRA_DIST += mdw-setup
+
+###--------------------------------------------------------------------------
+### Files to install.
+
+## Licences.
+dist_pkgdata_DATA += COPYING COPYING.LIB
+dist_pkgdata_DATA += gpl.tex lgpl.tex gpl.texi lgpl.texi
+
+## Documentation.
+dist_pkgdata_DATA += INSTALL
+dist_pkgdata_DATA += texinice.tex