1 ## Process this file with automake to create Makefile.in
3 ## Makefile for Automake.
5 ## Copyright 1995, 1996, 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
7 ## This program is free software; you can redistribute it and/or modify
8 ## it under the terms of the GNU General Public License as published by
9 ## the Free Software Foundation; either version 2, or (at your option)
12 ## This program is distributed in the hope that it will be useful,
13 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ## GNU General Public License for more details.
17 ## You should have received a copy of the GNU General Public License
18 ## along with this program; if not, write to the Free Software
19 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 AUTOMAKE_OPTIONS = 1.4 dist-bzip2
24 ## We need `.' in SUBDIRS because we want `check' to build `.' before
26 SUBDIRS = . m4 lib tests
28 bin_SCRIPTS = automake aclocal
29 info_TEXINFOS = automake.texi
32 TAGS_FILES = automake.in aclocal.in
34 # The following requires a fixed version of the Emacs 19.30 etags.
35 ETAGS_ARGS = --lang=none \
36 --regex='/^@node[ \t]+\([^,]+\)/\1/' $(srcdir)/automake.texi
37 TAGS_DEPENDENCIES = automake.texi
39 EXTRA_DIST = ChangeLog.1996 ChangeLog.1998 ChangeLog.2000
41 ################################################################
43 ## Everything past here is useful to the maintainer, but probably not
47 # Some simple checks, and then ordinary check. These are only really
48 # guaranteed to work on my machine.
49 maintainer-check: automake aclocal
50 ## This check avoids accidental configure substitutions in the source.
51 ## There are exactly 7 lines that should be modified. This works out
52 ## to 22 lines of diffs.
53 @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 28; then \
54 echo "found too many diffs between automake.in and automake"; 1>&2; \
55 diff -c $(srcdir)/automake.in automake; \
58 ## Syntax check with default Perl (on my machine, Perl 5).
59 perllibdir=$(srcdir)/lib $(PERL) -c -w automake
60 perllibdir=$(srcdir)/lib $(PERL) -c -w aclocal
61 ## expect no instances of '${...}'. However, $${...} is ok, since that
62 ## is a shell construct, not a Makefile construct.
63 ## The backslash in `$${' is needed for some versions of bash.
64 @if fgrep '\$${' $(srcdir)/lib/am/[a-z]*.am | \
65 fgrep -v '$$$$'; then \
66 echo "Found too many uses of '\$${' in the lines above." 1>&2; \
69 ## Make sure `rm' is called with `-f'.
70 @if egrep '\<rm ([^-]|\-[^f ]*\>)' \
71 $(srcdir)/lib/am/[a-z]*.am $(srcdir)/tests/*.test | \
73 echo "Suspicious 'rm' invocation." 1>&2; \
76 ## Make sure all invocations of mkinstalldirs are correct.
77 @if fgrep -n 'mkinstalldirs' $(srcdir)/lib/am/[a-z]*.am | \
78 fgrep -v '$$(mkinstalldirs)'; then \
79 echo "Found incorrect use of mkinstalldirs in the lines above" 1>&2; \
82 ## We never want to use "undef", only "delete", but for $/.
83 @if grep -n -w 'undef ' $(srcdir)/automake.in | \
84 fgrep -v 'undef $$/'; then \
85 echo "Found undef in automake.in; use delete instead" 1>&2; \
88 ## We never want split (/ /,...), only split (' ', ...).
89 @if fgrep -n 'split (/ /' $(srcdir)/automake.in; then \
90 echo "Found bad split in the lines above." 1>&2; \
93 ## Look for cd within backquotes without CDPATH=:
94 @if grep -n '^[^#]*` *cd ' $(srcdir)/automake.in \
95 $(srcdir)/lib/am/*.am $(srcdir)/m4/*.m4; then \
96 echo "Consider setting CDPATH in the lines above" 1>&2; \
99 ## Using @_ in a scalar context is most probably a programming error.
100 @if grep -Hn '[^) ] *= *@_' $(srcdir)/automake.in; then \
101 echo "Using @_ in a scalar context in the lines above." 1>&2; \
104 ## Forbid using parens with `local' to ease counting.
105 @if grep '^[ \t]*local *(' $(srcdir)/automake.in; then \
106 echo "Don't use \`local' with parens: use several \`local' above." >&2; \
109 ## Up to now we manage to limit to 1 use of local.
110 @locals=`grep -c '^[ \t]*local [^*]' $(srcdir)/automake.in`; \
113 echo "Wow, congrats! There are no \`local' now!." >&2; \
114 echo "Please update Makefile.am (maintainer-check)." >&2; \
119 echo "Too many \`local'! Are you sure you need $$locals of them?" >&2; \
120 echo "Up to now 1 was enough." >&2; \
124 ## Don't let AMDEP_TRUE substitution appear in automake.in.
125 @if grep '@AMDEP''_TRUE@' $(srcdir)/automake.in; then \
126 echo "Don't put AMDEP_TRUE substitution in automake.in" 1>&2; \
130 # Tag before making distribution. Also, don't make a distribution if
131 # checks fail. Also, make sure the NEWS file is up-to-date.
132 cvs-dist: maintainer-check distcheck
133 @if sed 1q $(srcdir)/NEWS | grep -e "$(VERSION)" > /dev/null; then :; else \
134 echo "NEWS not updated; not releasing" 1>&2; \
137 cd $(srcdir) && cvs -q tag `echo "Release-$(VERSION)" | sed 's/\./-/g'`
141 thisver=`echo "Release-$(VERSION)" | sed 's/\./-/g'`; \
142 if test -z "$$OLDVERSION"; then \
143 prevno=`echo "$(VERSION)" - 0.01 | bc | sed 's/^\./0./'`; \
144 else prevno="$$OLDVERSION"; fi; \
145 prevver=Release-`echo $$prevno | sed 's/\./-/g'`; \
146 cvs -f rdiff -c -r $$prevver -r $$thisver $(PACKAGE) \
147 > $(PACKAGE)-$$prevno-$(VERSION).diff
149 ## Check our path lengths.
152 ## FIXME there's got to be a better way! pathchk should take the list
153 ## of files on stdin, at least.
154 find . -print | xargs pathchk -p); \
156 chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir); \
159 ## Program to use to fetch files.
162 ## Files that we fetch and which we compare against.
163 ## FIXME should be a lot more here
164 ## Sadly we can't fetch ansi2knr.1 from the same location :-(
165 FETCHFILES = config.guess config.sub ansi2knr.c
167 ## Fetch the latest versions of files we care about.
169 rm -rf Fetchdir > /dev/null 2>&1
171 ## If a get fails then that is a problem.
173 $(WGET) ftp://ftp.gnu.org/gnu/config/config.guess; \
174 $(WGET) ftp://ftp.gnu.org/gnu/config/config.sub; \
175 $(WGET) ftp://ftp.cs.wisc.edu/ghost/ansi2knr.c)
176 ## Don't exit after test because we want to give as many errors as
178 @stat=0; for file in $(FETCHFILES); do \
179 if diff $(srcdir)/lib/$$file Fetchdir/$$file > /dev/null 2>&1; then :; \
182 echo "install Fetchdir/$$file into srcdir and commit"; \